palbaseDocs

Palbase IAP · API

POST/iap/catalog/revisions/{revision}/restore

Put an older revision back

Saves the revision's catalog as the next revision, as an edit is: checked against the catalog's rules now (an older revision may break one added since: 422 invalid_catalog), what customers bought kept in it, If-Match the revision the catalog is now. Nothing is written to a store: a plan of it is made and confirmed (POST /iap/catalog/plans). Emits iap.catalog.changed with restored_from.

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

Path

revisioninteger · requiredThe revision's number.

Headers

If-Matchstring · requiredThe catalog's revision now, as the ETag of GET /iap/catalog 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/catalog/revisions/<revision>/restore" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

200The new revision, the older one's catalog

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 revision (`revision_not_found`)

409The catalog is this revision now (`revision_current`), or a request with this Idempotency-Key is still running; retry after Retry-After

412The catalog changed since it was read (`catalog_changed`): read it again and apply the edit to the new revision

422The catalog breaks a rule (`invalid_catalog`, 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`): send the catalog's revision now

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

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

Operation RestoreCatalogRevision of iap's contract.