All pages
Powered by GitBook
1 of 1

Loading...

Cancel payment

Use case

In this example, we will review how to cancel a payment draft.

Use case data
API parameters with values

We will cancel the PAYM-21736 payment.

...api/v3/payments/PAYM-21736...

An optional comment.

Sample API call

To cancel the payment, use the following endpoint:

Sample request

The sample request body is as follows:

"comment": "Cancel payment"
curl --location 'https://payment-api.sandbox.tuumplatform.com/api/v3/payments/PAYM-21736/cancel' \
--header 'x-channel-code: SYSTEM' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHBpcnlEVGltZSI6IjIwMjQtMTItMDJUMTM6MjU6MzEiLCJleHAiOjE3MzMxNDU5MzEsInJvbGVzIjpbIkFETUlOIiwiUE9TVElOR1NfVEVBTSJdfQ.W9yv0iAmm3QoQILoCJit9uZbp10kSRQsWoIq9spDG2w' \
--header 'Content-Type: application/json' \
--data '"comment": "Cancel payment"'

Sample response

Below you will find the response to the sample request:

Response
{
    "errors": null,
    "validationErrors": null,
    "data": {
        "paymentId": "PAYM-21736",
        "accountId": "ID-12329",
        "directionCode": "OUT",
        "statusCode": "CANCELLED",
        "errorCode": null,
        "money": {
            "amount": 20.00,
            "currencyCode": "GBP"
        },
        "details": null,
        "referenceNumber": null,
        "source": null,
        "contractSource": null,
        "endToEndId": null,
        "valueDate": "2029-11-09",
        "postingDate": "2029-11-09",
        "insertedDateTime": "2024-11-30T01:40:54.048581Z",
        "paymentServiceProviderCode": "SWIFT",
        "paymentTypeCode": "ACC2SWIFT",
        "preferredPaymentScheme": null,
        "selectedPaymentScheme": null,
        "chargeBearer": null,
        "settlementStatusCode": null,
        "settlementErrorCode": null,
        "settlementDate": null,
        "settlementPaymentScheme": null,
        "returnStatusCode": null,
        "returnReason": null,
        "returnComment": null,
        "returnSettlementDate": null,
        "cancellationRequestStatusCode": null,
        "cancelRefuseReason": null,
        "cancelReason": null,
        "amlDeclineReason": null,
        "amlMonitoringEnabled": null,
        "lastStatusRequestDate": null,
        "residencyCountryCode": "GB",
        "counterpartyOriginalIban": null,
        "fxPaymentFlag": false,
        "fxPayment": null,
        "paymentParties": [
            {
                "paymentPartyId": "PAYM-57290",
                "typeCode": "COUNTERPARTY",
                "name": "Test Receiver",
                "personTypeCode": null,
                "givenName": null,
                "surname": null,
                "accountNumber": {
                    "value": "56497232",
                    "type": "BBAN"
                },
                "accountNumberSubtype": null,
                "accountNumberCountryCode": "GB",
                "financialInstitutionId": {
                    "value": "BARCGB22",
                    "type": "BIC"
                },
                "address": null,
                "roleCode": "BENEFICIARY",
                "partyIdentification": null
            },
            {
                "paymentPartyId": "PAYM-57291",
                "typeCode": "OUR_PARTY",
                "name": "Fianna Penelopa",
                "personTypeCode": "P",
                "givenName": "Fianna",
                "surname": "Penelopa",
                "accountNumber": {
                    "value": "GB55LHVB04030000001875",
                    "type": "IBAN"
                },
                "accountNumberSubtype": null,
                "accountNumberCountryCode": "GB",
                "financialInstitutionId": {
                    "value": "LHVBGB2LXXX",
                    "type": "BIC"
                },
                "address": {
                    "street1": "Fennstrasse 4",
                    "street2": "string",
                    "cityCounty": "Berlin",
                    "stateRegion": "Berlin",
                    "zip": "13347",
                    "countryCode": "DE",
                    "addressLine": "Fennstrasse 4, string, Berlin, DE, 13347",
                    "addressTypeCode": null
                },
                "roleCode": "PAYER",
                "partyIdentification": {
                    "identificationTypeCode": "NATIONAL_IDENTIFICATION_NUMBER",
                    "identificationValue": "id-919820058"
                }
            }
        ],
        "fees": [],
        "paymentSchemeElements": [],
        "fileImportLineNumber": null,
        "purposeCode": null,
        "labels": [
            "COUNTERPARTY_GB"
        ]
    }
}

Result

The payment with the paymentId: PAYM-21736 has been set to the CANCELLED status.

https://payment-api.sandbox.tuumplatform.com/api/v3/payments/{paymentId}/cancel

Learn more about the endpoint in the Tuum developer portal.

"comment": "Cancel payment"
cancel payment