Skip to main content
Close an open payment context.
POST /api/v1/vouchers/contexts/:contextId/context-close Closes a context, preventing any new vouchers from being reserved against it. Existing vouchers in the context are unaffected.

Parameters

Path

NameTypeRequiredDescription
contextIdstringYesThe context ID to close

Body

NameTypeRequiredDescription
payeeIdstring or nullYesThe payee ID (exactly 64 characters), or null if no payee was involved

Request example

curl --request POST 'https://payments.bleepay.com/api/v1/vouchers/contexts/ctx_a1b2c3d4e5f6/context-close' \
  --header 'Authorization: Bearer <payer_token>' \
  --header 'Content-Type: application/json' \
  --data '{ "payeeId": null }'

Response

Response schema

Returns the updated context object with status CLOSED.

Example response

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

Error responses

StatusCodeDescription
400already_closedThe context is already closed
401unauthorizedMissing or invalid bearer token
404not_foundContext not found