XPay

Cancel a payment

5min

In this tutorial, you'll learn how to:

✅ Cancel an XPay transfer

If you are new to XPay we recommend you read the XPay overview  before starting this tutorial

The tutorial assumes you have a knowledge of APIs and how they work. Refer to the API overview for more details

The tutorial uses these API endpoints

API

Description

Cancel an outgoing push payment

The tutorial uses these webhooks

Webhook

Description

XPay.Payment.Canceled

Payment canceled at the sender's request or has expired

Before you begin

Make sure you have:

Register the relevant webhook events

To receive the webhook events for this tutorial both partner accounts need to register each specific webhook event type. Once you are registered, the event objects are sent to the registered URLs.

The event object contains a list of resource identifiers used to download details on each event.

Originate an XPay push transaction

In order to have a payment to cancel, you need to originate a push payment. Learn how to originate a payment in the Originate a payment tutorial.

Cancel the XPay payment

1

Call POST /XPay/v1/payments/{id}/cancel. For this call, the id attribute is required.

The id attribute is the relatedPaymentID found in response body of the push request.

Cancel XPay payment request example

2

The XPay.Payment.Canceled webhook is triggered and the payment is canceled.



🤔
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.