Billing Redeem License
POST /api/v1/billing/redeem-license
Redeems an eligible license code and adds its credit to the authenticated account balance. Requires an authenticated user. Bearer access tokens need the billing.write ability, and the associated account needs the billing.change permission. The * wildcard also satisfies the bearer ability check. Browser session authentication uses the account permission check without a token-ability check. API-key credentials are not accepted. A bearer token missing its ability receives a 403 JSON body with error: "token_ability_missing", required: ["billing.write"], and have.
Authenticate with a portal session token.
Request body
application/json object
codestring requiredLength: 1 to 64 characters
Generated sample
{
"code": "string"
}Responses
200 The code was redeemed and the account balance was updated.
application/json object
balance_centsinteger requiredbalance_dollarsnumber requiredcredit_centsinteger requiredcredit_dollarsnumber requiredbalance_microsinteger requiredExact wallet balance in USD micro-dollars after redemption.
Generated sample
{
"balance_cents": 0,
"balance_dollars": 0,
"credit_cents": 0,
"credit_dollars": 0,
"balance_micros": 0
}401 Authentication is missing or invalid.
application/json object
errorobject requiredcodestring requiredValue:"unauthenticated"messagestring required
403 The bearer token lacks the required ability or the authenticated account lacks the required permission.
application/json any
Any of
- object
errorstring requiredValue:"token_ability_missing"havearray of string requiredmessagestring requiredrequiredarray of string required
- object
messagestring required
409 The Idempotency-Key cannot be used for this request because it conflicts with another request (idempotency_key_conflict), is still in progress (idempotency_request_in_progress), or its response was not retained (idempotency_response_not_retained).
application/json IdempotencyError
errorobject requiredcodestring requiredOne of:"idempotency_key_conflict","idempotency_request_in_progress","idempotency_response_not_retained"messagestring requiredtypestring requiredValue:"idempotency_error"
410 The code is expired, exhausted, or has already been redeemed by this account.
application/json object
errorobject requiredcodestring requiredOne of:"expired","exhausted","already_redeemed"messagestring required
422 The code is missing, invalid, or failed validation.
application/json object
errorany requiredOne of
- string
- object
codestringfieldsobjectOther keys: array of string
messagestring
- object
codestringmessagestring
429 The limit of 10 redemption requests per minute was exceeded.
Response headers
Retry-Afterinteger headerSeconds to wait before retrying.
X-RateLimit-Scopestring header
application/json object
errorobject requiredcodestring requiredValue:"too_many_attempts"messagestring requiredretry_after_sinteger requiredRange: at least 1scopestring requiredValue:"route"
text/html string
500 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.