Redeem a coupon code for a profile
Redeems a coupon within the key’s project for a given profile. Idempotent per (profileId, couponId) unless an explicit idempotencyKey is supplied. Returns the granted benefits from the coupon pool.
Auth: X-API-Key with scope coupon:redeem (x-required-scope: coupon:redeem). projectId in the body must match the key’s project.
Rate limit: 30 req/min per (projectId, IP) — over → 429.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Must match the API key’s project.
Coupon code to redeem.
User/profile redeeming the coupon.
Optional. Defaults to <profileId>:<couponId> when omitted.
Optional free-form redemption context.
object
Example
{ "projectId": "prj_123", "code": "SAVE10", "profileId": "uid_456", "idempotencyKey": "order-789"}Responses
Section titled “Responses”Redemption accepted (pending settlement).
object
Benefits defined on the coupon pool (empty object if none).
object
Invalid JSON or missing required fields.
object
Human-readable error message.
Seconds to wait before retrying (present on 429/503).
Examples
{ "error": "invalid_json"}{ "error": "missing_required_fields"}Missing/invalid API key.
object
Human-readable error message.
Seconds to wait before retrying (present on 429/503).
Examplegenerated
{ "error": "example", "retryAfter": 1, "message": "example", "affectedIndices": [ 1 ]}API key lacks the coupon:redeem scope.
object
Human-readable error message.
Seconds to wait before retrying (present on 429/503).
Examplegenerated
{ "error": "example", "retryAfter": 1, "message": "example", "affectedIndices": [ 1 ]}Coupon not found, or cross-tenant (same shape to prevent enumeration).
object
Human-readable error message.
Seconds to wait before retrying (present on 429/503).
Example
{ "error": "not_found"}Coupon not redeemable.
object
Human-readable error message.
Seconds to wait before retrying (present on 429/503).
Examples
{ "error": "already_redeemed"}{ "error": "expired"}{ "error": "revoked"}{ "error": "pool_not_ready"}Rate limit exceeded (30/min per project+IP).
object
Human-readable error message.
Seconds to wait before retrying (present on 429/503).
Example
{ "error": "rate_limited"}