palbaseDocs

Palbase IAP · API

POST/iap/catalog/plans/{plan_id}/confirm

Confirm a plan

Writes the plan: only with the hash of the plan shown (the App Store part's; with nothing to write there, the Google Play part's), and only while it is planned — a plan the catalog moved past is refused, not written as something nobody saw. The App Store and Google Play parts go to the stores module, which writes them with the project's Apple and Google accounts and answers later (apple_result, google_result; the plan stays applying until then); from the confirmation on, a purchase of what it sells maps to the catalog's product and plan. The web's part writes nothing. Emits iap.catalog.applied once the stores module answered.

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

Path

plan_idstring (uuid) · requiredThe plan's id.

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.

Request body

hashstring · requiredThe App Store part's hash; with nothing to write there, the Google Play part's.
curl
curl -X POST "https://<your-ref>.palbase.studio/iap/catalog/plans/<plan_id>/confirm" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"hash":"string"}'

Responses

200The plan, applied or failed

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 plan (`plan_not_found`)

409The plan is not planned (`plan_not_open`: make a new one), or the hash is not the one it is confirmed with (`plan_hash_mismatch`); 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

503Temporarily unavailable; retrying is safe after Retry-After

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

Operation ConfirmCatalogPlan of iap's contract.