Skip to main content
Start a new payment context — the first step in a voucher payment flow.
POST /api/v1/vouchers/contexts/context-open A context is a secure link between a payer’s wallet and a payment session. The payer opens a context in their wallet, which generates a context code they share with the payee. The payee then uses this code to authenticate and reserve vouchers. This endpoint requires authentication as a registered user (the payer).

Parameters

Body

NameTypeRequiredDescription
formatenumYesnumeric or alphanum — the format of the context code
payersarrayYesList of payers, 1–10 entries
Payer object:
NameTypeRequiredDescription
addressstringYesBlockchain wallet address of the payer

Request example

curl --request POST 'https://payments.bleepay.com/api/v1/vouchers/contexts/context-open' \
  --header 'Authorization: Bearer <payer_token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "format": "numeric",
    "payers": [
      { "address": "0x1234567890abcdef1234567890abcdef12345678" }
    ]
  }'

Response

Response schema

FieldTypeDescription
idstringUnique context identifier
codestringContext code — share this with the payee
statusstringContext status (OPEN, etc.)
formatstringCode format (numeric or alphanum)
payersarrayPayer objects in the context
createdAtstringISO 8601 creation timestamp

Example response

{
  "id": "ctx_a1b2c3d4e5f6",
  "code": "A1B2C3",
  "status": "OPEN",
  "format": "numeric",
  "payers": [
    {
      "address": "0x1234567890abcdef1234567890abcdef12345678"
    }
  ],
  "createdAt": "2026-06-09T12:00:00.000Z"
}

Error responses

StatusCodeDescription
400validation_failedInvalid or missing required fields
401unauthorizedMissing or invalid bearer token
500unexpectedAn unexpected error occurred