Invoices

Redeem a paid invoice

Marks a paid invoice as used. It succeeds only once per invoice, so one payment grants access to content or an API call a single time. Returns 409 with type invalid_state when the invoice is not paid, or already_redeemed when it was used before. With an Idempotency-Key, a retry after a lost response returns the first result instead of already_redeemed. Rate limit: 1200 per minute per API key, counted separately from other endpoints.

POST
/api/v1/invoices/{id}/redeem

Authorization

bearerAuth
headerAuthorizationBearer <token>

A live API key, sk_live_ followed by 32 base58 characters.

Path Parameters

id*string

Invoice id, starting with inv_.

Header Parameters

Idempotency-Key?string

A unique string of 1 to 255 characters for this operation. A key belongs to the business across every endpoint for 24 hours, so give each operation its own key, for example invoice-order-1042 and refund-order-1042, not the order id alone. A retry with the same key on the same endpoint and with the same body returns the stored response with the header Idempotent-Replayed: true. The same key with a different body or on another endpoint returns 409 idempotency_conflict. Errors are not stored, so a request that failed can be retried with the same key, even with a corrected body. While the first request with a key is still running, a retry gets 409 idempotency_conflict with Retry-After: 1.

Length1 <= length <= 255

Response Body

The invoice is now marked as used.

application/json
  1. response
id*string
redeemed_at*string
Formatdate-time
payment*|

The payment that paid the invoice.

Example Request
curl -X POST 'https://example.com/api/v1/invoices/string/redeem'
Example Response
{  "id": "string",  "redeemed_at": "2019-08-24T14:15:22Z",  "payment": {    "id": "quo_4kT9mW2xQpL7vN3rB8sZ",    "object": "payment",    "status": "pending_deposit",    "coin": {      "asset_id": "string",      "symbol": "string",      "blockchain": "string",      "chain_name": "string",      "decimals": 0    },    "amount_in": "string",    "amount_in_base": "string",    "min_amount_in_base": "string",    "amount_in_usd": "string",    "deposit_address": "string",    "deposit_memo": "string",    "refund_address": "string",    "confidential": true,    "deadline": "2019-08-24T14:15:22Z",    "time_estimate_seconds": 0,    "deposited_amount": "string",    "refunded_amount": "string",    "refund_fee": "string",    "refund_reason": "string",    "origin_transactions": [      {        "hash": "string",        "url": "string"      }    ],    "destination_transactions": [      {        "hash": "string",        "url": "string"      }    ],    "correlation_id": "string",    "quote_signature": "string",    "created_at": "2019-08-24T14:15:22Z"  }}