palbaseDocs

Palbase IAP · API

POST/iap/catalog/plans

Plan bringing the stores to the catalog

Computes what writing the newest revision to the stores takes, store by store, before anything is written. The App Store and Google Play parts are as the stores module writes them once their accounts are connected; each creation there is permanent. The web's part writes nothing — a web checkout prices from the catalog at its moment — and says what it sells at: each plan's price in each currency, and its tax behavior (inclusive, exclusive, or the Stripe account's default). A plan is confirmed with the App Store part's hash (POST /iap/catalog/plans/{plan_id}/confirm), or the Google Play part's when the App Store's has nothing to write; one with nothing to write at either is not confirmed.

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

Headers

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/plans" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

201The plan

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`)

409The project has no catalog yet (`catalog_empty`); or a request with this Idempotency-Key is still running (`idempotency_key_in_use`, Retry-After)

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

422The Idempotency-Key was sent with a different request (`idempotency_key_reused`)

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

502Stripe could not be reached (`stripe_unreachable`); retrying is safe after Retry-After

503Temporarily unavailable; retrying is safe after Retry-After

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

Operation PlanCatalog of iap's contract.