Cancels a pending payment. Cannot cancel already paid or processing payments.
| Field | Required | Description |
|---|---|---|
reason | Yes | Reason for cancellation |
cancelled| Current Status | Can Cancel? |
|---|---|
pending | Yes |
processing | No (wait for result) |
paid | No (use refund instead) |
failed | Yes |
cancelled | No (already cancelled) |
| 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 |
API key obtained from FlexPortal dashboard
Your tenant identifier
The payment ID
1