Cancel a payment
Payments
Cancel Payment
Cancels a pending payment. Cannot cancel already paid or processing payments.
POST
Cancel a payment
Overview
Cancel a pending or failed payment. Use this when a payment should not be collected—for example, when a subscription was ended early or a billing adjustment is needed.Common Use Cases
- Early Termination: Subscription ended before payment due
- Billing Adjustment: Correcting overcharges or errors
- Customer Goodwill: Waiving a payment as a courtesy
- Duplicate Payments: Removing duplicate scheduled payments
- Subscription Cancelled: Associated subscription was cancelled
Request Fields
| Field | Required | Description |
|---|---|---|
reason | Yes | Reason for cancellation |
Example Request
What Happens
When you cancel a payment:- Payment status changes to
cancelled - Cannot be collected or marked as paid
- Subscription metrics may be updated
- Reason recorded for audit trail
Which Payments Can Be Cancelled
| Current Status | Can Cancel? |
|---|---|
pending | Yes |
processing | No (wait for result) |
paid | No (use refund instead) |
failed | Yes |
cancelled | No (already cancelled) |
Example: Cancel Due to Early Return
Example: Cancel with Customer Reason
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
NOT_FOUND | Payment doesn’t exist | Verify payment ID |
ALREADY_PAID | Cannot cancel paid payment | Use refund instead |
ALREADY_CANCELLED | Payment already cancelled | No action needed |
PAYMENT_PROCESSING | Payment currently processing | Wait for result |
Related Endpoints
- Get Payment - Check payment status
- List Payments - Find payments to cancel
- Mark Paid - Alternative: mark as paid
- Early Return - End subscription early
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The payment ID
Body
application/json
Minimum string length:
1