Palbase IAP · API
/iap/offers/{offer_key}/claimClaim a grant offer
Takes a grant offer: its entitlement for its duration, from now. Emits iap.offer.redeemed and iap.entitlement.changed.
Called by a signed-in user of your app, with their token and the publishable key.
Path
offer_keystring · requiredThe catalog's offer.curl -X POST "https://<your-ref>.palbase.studio/iap/offers/<offer_key>/claim" \
-H "apikey: $PALBASE_PUBLISHABLE_KEY" \
-H "authorization: Bearer $USER_ACCESS_TOKEN"Responses
201The grant
400The request is malformed, or a field breaks a rule (the error names which)
401No customer's session (`session_required`): a customer's own is reached with the publishable key and their access token; or the edge refused the key or the token
403The offer is not the customer's to take (`offer_not_open`), or a guest claims a grant outright (`account_required`: a grant is an account's unless a coupon opened it); or the edge refused the key
404The catalog has no such offer (`offer_not_found`)
409The customer took it already (`offer_taken`)
422A discount or a trial is bought at a store with the offer, not claimed (`not_a_grant`)
503Temporarily unavailable; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation ClaimOffer of iap's contract.