palbaseDocs

Palbase IAP · API

DELETE/iap/coupons/{coupon_key}

Revoke a coupon

Revokes a coupon: no code of it is redeemed from now; what was redeemed stays.

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

Path

coupon_keystring · requiredThe coupon's 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 DELETE "https://<your-ref>.palbase.studio/iap/coupons/<coupon_key>" \
  -H "apikey: $PALBASE_SECRET_KEY"

Responses

204Revoked; an App Store coupon's offer code is ended at App Store Connect by the stores module (its `apple.state` is `revoking`, then `revoked`, or `failed` with why: revoke it again)

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 coupon, or it is revoked (`coupon_not_found`). A revoked App Store coupon whose offer code Apple did not end, and a revoked coupon with a Stripe promotion code, are revoked again

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

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

502Stripe could not be reached to end the coupon's promotion code (`stripe_unreachable`): nothing was revoked; 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 RevokeCoupon of iap's contract.