Overview
If a payment request no longer needs to be collected, you can cancel it through the/Payment/{paymentRequestId}/Cancel endpoint. Canceling a request stops the payer from completing that payment and moves the payment request to the Canceled status.
Use this endpoint for payment requests that are still outstanding, such as requests that are pending payer action, scheduled for a future date, or otherwise not yet completed.
How It Works
1
Obtain an Access Token
Before calling the cancel endpoint, secure an access token by making a
POST request to /auth/token using your ClientId and ClientSecret.2
Identify the Payment Request
Use the
PaymentRequestId returned when the payment request was created, or the ID received in a payment status webhook.3
Submit the Cancellation
Send a
PUT request to /Payment/{paymentRequestId}/Cancel with the payment request ID in the path.4
Track the Updated Status
After cancellation, the payment request status becomes
Canceled. You can use payment status webhooks to keep your system in sync.Canceling the Payment Request
The/Payment/{paymentRequestId}/Cancel endpoint cancels an existing payment request by referencing its PaymentRequestId.
Endpoint
- URL:
https://api.synchpay.com/Payment/{paymentRequestId}/Cancel - Method:
PUT - Authorization:
Bearer <AccessToken>
Path Parameters
Request Body
This endpoint does not require a request body.Example Request
Response
A successful request returns200 OK with no response body.
Error Responses
When to Use This Endpoint
Use the cancel endpoint when you want to:- Stop an unpaid payment request before the payer completes it.
- Cancel a scheduled payment request before it is processed.
- Prevent a duplicate or incorrect request from being paid.
Payment Status
After a successful cancellation, the payment request moves toCanceled, which is a final state. See payment statuses for the full status transition table.