Before You Begin
Ensure you have:API Credentials
Valid API credentials and access token for authentication.
Account Setup
Proper account setup for your target country and business verification.
IP Whitelisting
Whitelist your server IP addresses for API access.
Webhook Endpoint
Set up a webhook URL to receive payment notifications.
Additional Cancellation Requirements:
- User role with cancellation permissions (see User Roles documentation).
- The original transaction must be in a cancellable state.
- The
externalIdof the APM payment transaction you wish to cancel. - Complete beneficiary information for data-required refunds.
Direct Cancellation for APM Payments
APM payment cancellations are processed as Direct Cancellations, meaning you only need the original transaction’sexternalId and the status parameter set to CANCELLED. The system immediately stops any further processing of the payment.
Step 1: Cancel APM Payment via API
To cancel a APM payment, send aPATCH request to the Cancel endpoint.
Key Request Parameters
The request requires several key parameters:Example Request
Below is an example usingcurl:
curl
Step 2: Handle the Response
Successful Response
A successfully cancelled APM payment returns confirmation details:Key Response Fields
Error Response
When a cancellation request fails, you’ll receive error information:Common Error Scenarios
Step 3: Track Cancellation Status
After initiating a cancellation, monitor its progress through these methods:Webhooks (Recommended)
Receive real-time notifications when transaction status changes. Most efficient for production environments.
Status API Endpoint
Query transaction status programmatically. Useful for polling or recovering lost webhook notifications.
Business Portal View
Visual interface for monitoring transactions. Great for manual oversight and detailed transaction analysis.
Common Cancellation Status Codes
Complete ReferenceView all status codes in our Transaction Status Documentation.
Testing Your Integration
Test Scenarios
Verify your integration handles these scenarios:- Successful Cancellation: Cancel a pending APM payment with valid externalId.
- Invalid Transaction: Try to cancel non-existent externalId.
- Already Completed: Attempt to cancel a completed transaction.
- Permission Validation: Test with users having different permission levels.
- Missing Status Parameter: Attempt cancellation without the required status field.
Next Steps
View transaction status
Check the current status of transactions and cancellations using the
Transaction Status API.
Process refunds
Learn how to process refunds for completed APM payments that cannot be
cancelled.

