Cancel a payout
Sometimes you need to stop a payout after initiation, this guide covers cancellation procedures.
If you need to cancel a payout due to an error or change in requirements, you can do so as long as the payout is in one of the following statuses: Pending Authorization, Received, On Hold, or Locked.
You can cancel payouts through the Dashboard or programmatically via the API.
Prerequisites
Before canceling a payout, ensure you have:
- An active payout transaction with status:
PendingAuth,Received,OnHold, orLocked - Valid API credentials with proper permissions
- The transaction identifier (
externalId)
Important: Once a payout moves to Processing or Completed status, it cannot be cancelled through API. Contact support for assistance with processed transactions.
API Endpoint
To cancel a payout send a PATCHrequest to the Cancel a Payoutendpoint.
Cancel Payout Request
PATCH https://api.stage.localpayment.com/api/payout/cancelAuthentication
Include your access token in the request headers:
Authorization: Bearer <your_access_token>Key Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
externalId | string | Your system's unique transaction identifier | ✅ |
Example Request
curl --request PATCH \
--url https://api.stage.localpayment.com/api/payout/cancel \
--header 'Authorization: Bearer <your_access_token>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"externalId": "a971b7ee-fe47-4112-81fc-484f8e5c64d7"
}'Response Handling
Success Response
When cancellation is successful, you'll receive a response with the updated status:
{
"externalId": "a971b7ee-fe47-4112-81fc-484f8e5c64d7",
"internalId": "3d36811d-1c02-41ea-a576-68df62c4603a",
"status": {
"code": "900",
"description": "Cancelled",
"detail": "The payout was cancelled successfully"
}
}Key Response Fields
| Field | Type | Description |
|---|---|---|
externalId | string | Your system's transaction identifier |
internalId | string | LocalPayment's internal transaction ID |
status.code | string | Status code (900 = Cancelled) |
status.description | string | Human-readable status description |
status.detail | string | Additional details about the cancellation |
Error Responses
{
"Status": 404,
"Message": "This transaction does not exist.",
"TraceId": "dae2d1cb-7e9e-48a5-8530-980f38b31712"
}Implementation Best Practices
Security & Performance Tips
- Always validate transaction status before attempting cancellation
- Use HTTPS for all API requests
- Store access tokens securely and rotate them regularly
- Implement proper error handling and retry logic
- Log all cancellation attempts for audit purposes
Testing Your Implementation
Before deploying to production, test your cancellation logic thoroughly:
- Test with valid transactions in cancellable statuses
- Test with invalid transactions to handle errors gracefully
- Test authentication failures and token expiration
- Verify webhook handling if implemented
- Test rate limiting and retry logic
Next Steps
Webhook Integration
Set up real-time notifications for payout status changes
Transaction Status
Learn how to monitor and track payout lifecycle
Error Handling Guide
Implement robust error handling for your integration
API Reference
Complete endpoint documentation with interactive examples
Support & Resources
Need assistance with your payout cancellation integration?
- Technical Support: Contact our support team for integration help
- API Documentation: Complete endpoint reference and guides
Pro Tip: Test your cancellation workflow in our sandbox environment before implementing in production. This ensures your integration handles all edge cases and error scenarios correctly.
Updated 10 days ago
