Skip to main content
POST
/
api
/
v1
/
invoices
/
{id}
/
cancel
curl -X POST https://api.settlx.io/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel \
  -H "Authorization: Bearer pk_live_your_api_key"
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "merchantId": "f9e8d7c6-b5a4-3210-9876-543210fedcba",
    "amount": "99.99",
    "currency": "USD",
    "status": "expired",
    "description": "Order #1234",
    "expiresAt": "2024-01-15T10:30:00.000Z",
    "webhookUrl": "https://yoursite.com/webhooks/settlx",
    "paymentUrl": "https://api.settlx.io/checkout/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "createdAt": "2024-01-15T10:00:00.000Z",
    "updatedAt": "2024-01-15T10:02:00.000Z"
  }
}

Cancel Invoice

Cancels a pending invoice. Only invoices in pending status can be cancelled. Once cancelled, the invoice status is set to expired and no further payments can be made against it.

Path Parameters

id
string
required
UUID of the invoice to cancel.

Response

Returns the updated invoice object with status: "expired".
data
object
Updated invoice object. Same shape as Get Invoice response (without addresses).
You can only cancel invoices with status pending. Attempting to cancel a confirmed, settled, or already expired invoice will return a 400 error.
curl -X POST https://api.settlx.io/api/v1/invoices/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel \
  -H "Authorization: Bearer pk_live_your_api_key"
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "merchantId": "f9e8d7c6-b5a4-3210-9876-543210fedcba",
    "amount": "99.99",
    "currency": "USD",
    "status": "expired",
    "description": "Order #1234",
    "expiresAt": "2024-01-15T10:30:00.000Z",
    "webhookUrl": "https://yoursite.com/webhooks/settlx",
    "paymentUrl": "https://api.settlx.io/checkout/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "createdAt": "2024-01-15T10:00:00.000Z",
    "updatedAt": "2024-01-15T10:02:00.000Z"
  }
}