Overview
The Cancel One-Time Payment endpoint allows you to cancel an active payment link before it is used or expires. Once cancelled, the payment link cannot be completed by customers and cannot be reactivated. Common use cases:- Customer requests to cancel an order
- Duplicate payment links were created by mistake
- Order or service was cancelled before payment
- Payment details need to be corrected (cancel and create new link)
Authentication
This endpoint requires API key authentication using thex-api-key header.
Your API key can be found in your organization settings. Keep it secure and never expose it in client-side code.
Cancellation Rules
You can only cancel a payment link if all of these conditions are met:1
Payment status is PENDING
The payment must be in
PENDING status. You cannot cancel payments that are already CONFIRMED or CANCELLED.2
Payment has not expired
The payment link must not have passed its expiration date (
expiresAt). Expired payments cannot be cancelled.3
Payment belongs to your organization
You can only cancel payment links that belong to your organization.
Request Format
string
required
The unique identifier (UUID) of the one-time payment to cancel.
Response Format
The endpoint returns the cancelled payment object withstatus: "CANCELLED":
Notice the
updatedAt timestamp reflects when the cancellation occurred.Examples
Cancel a payment link
Cancel with error handling
Check status before cancelling
Error Responses
error
Cannot cancel payment - The payment is not in
PENDING status or has already expired.Common reasons:- Payment status is
CONFIRMED(already paid) - Payment status is
CANCELLED(already cancelled) - Payment has passed its
expiresAtdate
error
Payment not found - No payment with the specified ID exists in your organization.
error
Unauthorized - Missing or invalid API key.
Best Practices
Common Use Cases
Order Cancellation Workflow
Bulk Cancellation
Duplicate Detection and Cancellation
Integration Tips
What Happens After Cancellation
After a payment link is successfully cancelled:- Status Change - The payment status changes from
PENDINGtoCANCELLED - Customer Access - Customers can no longer access or complete the payment using the payment link URL
- Irreversible - The cancellation cannot be undone
- New Payment Required - If payment is still needed, you must create a new payment link
Cancelled payments remain in your system for record-keeping and can be retrieved via the List or Get endpoints.
Next Steps
Create Payment
Create a new payment link to replace the cancelled one
List Payments
View all payment links including cancelled ones