Payment Cancellation Request

Prev Next

The tutorials in the section provide examples of initiating a payment using the PagoNxt Payments Hub API camt.056 message format. For each tutorial example, the following sections must be completed.

Cancel the payment

This section describes how to request the cancellation of a payment via a camt.056 HTTP request to the Payments Hub API.

Request

Create and send a request using the following operation:

POST https://sandbox.api.pagonxt.com/payments/camt056/v08

Headers

The request must contain the headers shown in the following table.

Header name

Description

Required/ Optional

Values

X-Client-Id

Client ID

Required

<Client ID>

sca-token

SCA JWT bearer token:

  • In the sandbox environment, you can use a predefined test SCA JWT Bearer token (see the Prerequisites section).

  • In the live environment, you must create the token based on the message body (whose details are described below) and sign it with your private key. For more information on the token details, see the Appendix inAuthentication guide

Required

<SCA token>

Request body

The request must include a JSON payload object in the request body. The JSON payload is a camt.056 ISO message with the fitoFIPmtCxlReq root element, and it contains the request details for cancelling a payment.

The following table only provides information about some especially important fields. For details on all the required and optional message fields, see Message field definition for camt.056

Tutorials

SEPA Instant example

SEPA Credit Transfer example

CHAPS example

Response

If the request is valid, you receive an HTTP 201 Created response, which means that the payment cancellation request was successfully submitted. In addition, the response body returns the data JSON object, which contains payment cancellation details. If the request is submitted again with the same message ID, you receive an HTTP 200 OK response. For further details of HTTP response codes and instructions on how to handle errors, see HTTP codes and request error handling .

The following table shows the response body elements that are relevant for the current use case. For details on all the response body elements, see Message field definition for camt.056 .

Element

Description

Data type

paymentsHubId

Payments Hub ID, which uniquely identifies your payment return request in Payments Hub. You can use it if you later need to retrieve the payment return details.

String

paymentId

Message ID you defined in the request as the grpHdr.msgId field value

String

status

Current status of the payment return. Since Payments Hub stores all requests for a while before performing the transaction settlement, this value is returned as PENDING.

String

creationDateTime

Date and time of creation

String

Extract the value of the paymentsHubId key, as you'll need it in the next section.

Example response body:

{
    "data": {
        "paymentsHubId": "aa0420ae-e742-3082-ba3a-a24ebd765798",
        "paymentId": "MsgId-2046908283",
        "status": "PENDING",
        "creationDateTime": "2022-05-30T12:45:23.089088"
    }
}