Skip to main content
Localpayment enables you to cancel pending APM payments through API integration. This guide covers the complete cancellation workflow for APM transactions using the direct cancellation method that requires only the transaction’s externalId.

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 externalId of 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’s externalId and the status parameter set to CANCELLED. The system immediately stops any further processing of the payment.
ImportantAPM payments can only be cancelled while they are in a pending or in-progress state. Once a APM payment has been completed or settled, you must process a refund instead of a cancellation.

Step 1: Cancel APM Payment via API

To cancel a APM payment, send a PATCH request to the Cancel endpoint.

Key Request Parameters

The request requires several key parameters:

Example Request

Below is an example using curl:
curl
See all available parameters in the request.

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:
  1. Successful Cancellation: Cancel a pending APM payment with valid externalId.
  2. Invalid Transaction: Try to cancel non-existent externalId.
  3. Already Completed: Attempt to cancel a completed transaction.
  4. Permission Validation: Test with users having different permission levels.
  5. 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.
Last modified on November 10, 2026