palbaseDocs

Palbase IAP · API

POST/iap/paywalls/{paywall_id}/publish

Publish a paywall

Publishes the paywall's draft as its next version, checked as the apps will get it: every package must be sold by the catalog (422 invalid_paywall, with every problem). If-Match names the draft revision that was looked at (412 paywall_changed when it moved since). The apps asking for a placement that shows the paywall get the new version at once — those whose SDK draws its schema. A draft the same as the newest version publishes nothing new (200). The newest 50 versions are kept, and the newest of each schema. Emits iap.paywall.published. Every asset the draft names is looked at in the project's storage: one no longer there (asset_missing) or no longer the bytes registered (asset_changed) refuses the publish.

Called by your server, with the project's secret key.

Path

paywall_idstring (uuid) · requiredThe paywall's id.

Headers

If-Matchstring · requiredThe draft revision the paywall was read at, as its ETag names it.
Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.
curl
curl -X POST "https://<your-ref>.palbase.studio/iap/paywalls/<paywall_id>/publish" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200The draft is the newest version already: nothing new was published

201The version published

400The request is malformed, or a field breaks a rule (the error names which)

401No key, not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key (`secret_key_required`)

404No such paywall (`paywall_not_found`)

409A request with this Idempotency-Key is still running (`idempotency_key_in_use`, Retry-After)

412The draft changed since it was read (`paywall_changed`): look at it again before publishing it

413The request body is too large (`request_too_large`)

422The draft breaks a rule, or sells what the catalog does not (`invalid_paywall`, with every problem); nothing was saved. Or the Idempotency-Key was sent with a different request (`idempotency_key_reused`)

428No If-Match (`if_match_required`)

429Over the project's request limit; Retry-After says when to try again

503The project's storage could not be read to check the paywall's assets (`storage_unavailable`); retrying is safe after Retry-After. Or temporarily unavailable

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation PublishPaywall of iap's contract.