Skip to main content
POST
/
checkout
/
{id}
/
cancel
Cancel a payment link
curl --request POST \
  --url https://api.sbx.moduluslabs.io/ecom/v1/checkout/{id}/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reason": "Customer requested cancellation"
}
'
{ "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "merchant_branch_reference_number": "SH-ANG-001", "merchant_branch_name": "SM City Angeles - Branch 1", "currency": "PHP", "amount": 150000, "line_items": [ { "sku": "PROD-001", "name": "Wireless Earbuds", "unit_price": 75000, "quantity": 2, "metadata": {} } ], "expires_at": "2026-07-18T00:00:00Z", "hosted_url": "https://pay.moduluslabs.io/checkout/550e8400-e29b-41d4-a716-446655440000", "successful_payment_count": 3, "metadata": {}, "created_at": "2026-06-18T10:30:00Z", "updated_at": "2026-06-18T14:22:00Z", "description": "Order for wireless earbuds", "order_reference": "ORD-2026-0618-001", "redirect_urls": { "success": "https://merchant.com/payment/success", "declined": "https://merchant.com/payment/declined", "expired": "https://merchant.com/payment/expired" }, "max_uses": 10, "cancelled_at": "2023-11-07T05:31:56Z", "cancellation_reason": "<string>" } }
Cancellation is permanent. Cancelled links cannot be reactivated — create a new link to accept payments again. Only ACTIVE links can be cancelled.
Returns the cancelled payment link with status: "CANCELLED", cancelled_at populated, and cancellation_reason if a reason was provided.

Idempotency

An Idempotency-Key header is optional here — cancel is idempotent by nature, so re-cancelling an already-cancelled link is a safe no-op. If you do send one, use a unique client-generated identifier (letters, digits, dot, hyphen, underscore; 8–64 characters). The optional reason is stored for audit purposes.

Required scope

payment_links.cancel

Authorizations

Authorization
string
header
required

API key passed as a bearer token. Use sk_live_ keys for production and sk_test_ keys for sandbox. Keys are provisioned during merchant onboarding.

Headers

Idempotency-Key
string

Optional. Cancel is idempotent by nature — re-cancelling an already-cancelled link is a safe no-op — so a key is accepted but not required. Same charset as create: letters, digits, dot (.), hyphen (-), underscore (_); 8–64 characters.

Pattern: ^[A-Za-z0-9._-]{8,64}$

Path Parameters

id
string<uuid>
required

The payment link ID (UUID v4).

Body

application/json
reason
string

Why the link is being cancelled. Stored for audit purposes.

Maximum string length: 500
Example:

"Customer requested cancellation"

Response

The cancelled payment link

data
object
required

The payment link object returned by all endpoints.