Server API version 1.0
Java

icon-search-large

Cancel payment

POST https://{domainname}/v1/{merchantId}/payments/{paymentId}/cancel

Payments

The payments REST services allow you to initiate a payment, retrieve the payment details or perform specific actions like refunding or requesting capture of a payment. A payment is identified by its paymentId. Some payment products allow a two step approach allowing you to control when the authorization takes place separate from when the funds are actually captured.

Request

If you decided that you don't want to process the payment it is always smart to cancel the payment. This makes it impossible to process the payment any further and will also try to reverse an authorization on a card. Reversing an authorization that you will not be utilizing will prevent you from having to pay a fee/penalty for unused authorization requests.

Whilst scheme regulations require that acquirers (and their providers, like us) support authorization reversals, there are no rules towards issuers mandating them to process the reversal advice. Therefore there is no guarantee the authorization hold is released. Also be aware that the issuer needs time to process the request. The funds may not be unblocked immediately even whilst the request is sent real-time.

For any authorization reversal request initiated by a merchant, we will pass the request through to an acquirer for subsequent submission to the card issuer for processing. The authorization reversal can only be performed by the card issuer, and under no circumstances will we be responsible for performing the authorization reversal.

There is no guarantee that the card issuer will process the authorization reversal, nor is there any guarantee that the authorization reversal will occur in real-time. Neither we nor any of its affiliates will be liable to a merchant for any costs, losses and/or damages arising out of a card issuer not processing or delaying to process an authorization reversal request.

The request does not have a body.

Request example

SDK: Java

This scenario you will probably use the most

  • CancelPaymentResponse response = client.merchant("merchantId").payments().cancel("paymentId");
    

Responses

Please find below an overview of the possible responses.

Response 200 - OKCancelPaymentResponse

The payment has been cancelled. Some acquirers/issuers will provide some feedback in case a reversal of the authorization has been performed, this can be found in the voidResponseId that can be found in the cardPaymentMethodSpecificOutput object.

Possible values for the voidResponseId results are:

Description voidResponseId
Successful reversal 00
Reversal request submitted 0, 8 or 11
Reversal request declined or referred 5 or 55
The provider did not provide a response empty or 98

Properties
Property Type Required Details
Group cardPaymentMethodSpecificOutput object no read close
close

Description

Object that holds specific information on cancelled card payments
  • SDK Object type
    CancelPaymentCardPaymentMethodSpecificOutput
  • Property is part of a group
    Learn more

    Properties that make up a group are mutually exclusive, which means you can only include one of each group in any given call.

    If there are multiple groups at one level in the object hierarchy we use numbers to distinguish groups from one another.

close

Description

Result of the authorization reversal request

Possible values are:

  • 00 - Successful reversal
  • 0, 8 or 11 - Reversal request submitted
  • 5 or 55 - Reversal request declined or referred
  • empty or 98 - The provider did not provide a response
payment object no read close
close

Description

Object that holds the payment related properties
  • SDK Object type
    Payment
close

Description

Our unique payment transaction identifier.
close

Description

Object containing payment details
  • SDK Object type
    PaymentOutput
close

Description

Object containing amount and ISO currency code attributes
  • SDK Object type
    AmountOfMoney
close

Description

Amount in cents and always having 2 decimals
close

Description

Three-letter ISO currency code representing the currency for the amount
close

Description

Results from the fraud prevention check. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted in an error and the fraud check was thus not performed
close

Description

Object containing the card payment method details
  • SDK Object type
    CardPaymentMethodSpecificOutput
  • Property is part of a group
    Learn more

    Properties that make up a group are mutually exclusive, which means you can only include one of each group in any given call.

    If there are multiple groups at one level in the object hierarchy we use numbers to distinguish groups from one another.

close

Description

Card Authorization code as returned by the acquirer
close

Description

Object containing card details
  • SDK Object type
    CardEssentials
close

Description

The complete credit/debit card number
close

Description

Expiry date of the card
Format: MMYY
close

Description

Fraud results contained in the CardFraudResults object
  • SDK Object type
    CardFraudResults
close

Description

Resulting advice of the fraud prevention checks. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted an error. Note that the fraud check was thus not performed.
close

Description

The unique scheme transactionId of the initial transaction that was performed with SCA.
Should be stored by the merchant to allow it to be submitted in future transactions.
close

Description

Payment product identifier
Please see payment products for a full overview of possible values.
close

Description

3D Secure results object
  • SDK Object type
    ThreeDSecureResults
close

Description

Identifier of the authenticated transaction at the ACS/Issuer
close

Description

Exemption code from Carte Bancaire (130) (unknown possible values so far -free format)
close

Description

The amount for which this transaction has been authenticated.
  • SDK Object type
    AmountOfMoney
close

Description

Amount in cents and always having 2 decimals
close

Description

Three-letter ISO currency code representing the currency for the amount
close

Description

Global score calculated by the Carte Bancaire (130) Scoring platform. Possible values from 0 to 99
close

Description

The ACS Transaction ID for a prior 3-D Secure authenticated transaction (for example, the first recurring transaction that was authenticated with the customer)
close

Description

Method of authentication used for this transaction. Possible values:
  • frictionless = The authentication went without a challenge
  • challenged = Cardholder was challenged
  • avs-verified = The authentication was verified by AVS
  • other = Another issuer method was used to authenticate this transaction
close

Description

Timestamp in UTC (YYYYMMDDHHmm) of the 3-D Secure authentication of this transaction
close

Description

If a token was used for or created during the payment, then the ID of that token.
close

Description

Results from the fraud prevention check. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted in an error and the fraud check was thus not performed
close

Description

Results from the fraud prevention check. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted in an error and the fraud check was thus not performed
close

Description

Results from the fraud prevention check. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted in an error and the fraud check was thus not performed
close

Description

Resulting advice of the fraud prevention checks. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted an error. Note that the fraud check was thus not performed.
close

Description

Identifier of the authenticated transaction at the ACS/Issuer
close

Description

Exemption code from Carte Bancaire (130) (unknown possible values so far -free format)
close

Description

The amount for which this transaction has been authenticated.
  • SDK Object type
    AmountOfMoney
close

Description

Amount in cents and always having 2 decimals
close

Description

Three-letter ISO currency code representing the currency for the amount
close

Description

Global score calculated by the Carte Bancaire (130) Scoring platform. Possible values from 0 to 99
close

Description

The ACS Transaction ID for a prior 3-D Secure authenticated transaction (for example, the first recurring transaction that was authenticated with the customer)
close

Description

Method of authentication used for this transaction. Possible values:
  • frictionless = The authentication went without a challenge
  • challenged = Cardholder was challenged
  • avs-verified = The authentication was verified by AVS
  • other = Another issuer method was used to authenticate this transaction
close

Description

Timestamp in UTC (YYYYMMDDHHmm) of the 3-D Secure authentication of this transaction
close

Description

Object containing the redirect payment product details
  • SDK Object type
    RedirectPaymentMethodSpecificOutput
  • Property is part of a group
    Learn more

    Properties that make up a group are mutually exclusive, which means you can only include one of each group in any given call.

    If there are multiple groups at one level in the object hierarchy we use numbers to distinguish groups from one another.

close

Description

The IBAN is the International Bank Account Number. It is an internationally agreed format for the BBAN and includes the ISO country code and two check digits.
close

Description

Object containing the results of the fraud screening
  • SDK Object type
    FraudResults
close

Description

Results from the fraud prevention check. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted in an error and the fraud check was thus not performed
close

Description

Object containing card details
  • SDK Object type
    CardEssentials
close

Description

The complete credit/debit card number
close

Description

Expiry date of the card
Format: MMYY
close

Description

Additional address information
close

Description

City
Note: For payments with product 1503 the maximum length is not 40 but 20.
close

Description

ISO 3166-1 alpha-2 country code
close

Description

House number
close

Description

Full name of the state or province
close

Description

Streetname
close

Description

Zip code
Note: For payments with product 1503 the maximum length is not 10 but 8.
close

Description

PayPal (payment product 840) specific details
  • SDK Object type
    PaymentProduct840SpecificOutput
  • Property is part of a group
    Learn more

    Properties that make up a group are mutually exclusive, which means you can only include one of each group in any given call.

    If there are multiple groups at one level in the object hierarchy we use numbers to distinguish groups from one another.

close

Description

Object containing the billing address details of the customer
  • SDK Object type
    Address
close

Description

Additional address information
close

Description

City
Note: For payments with product 1503 the maximum length is not 40 but 20.
close

Description

ISO 3166-1 alpha-2 country code
close

Description

House number
close

Description

Full name of the state or province
close

Description

Streetname
close

Description

Zip code
Note: For payments with product 1503 the maximum length is not 10 but 8.
close

Description

Object containing the details of the PayPal account
  • SDK Object type
    PaymentProduct840CustomerAccount
close

Description

Username with which the PayPal account holder has registered at PayPal
close

Description

Identification of the PayPal recurring billing agreement
close

Description

Name of the company in case the PayPal account is owned by a business
close

Description

The phone number of the PayPal account holder
close

Description

Country where the PayPal account is located
close

Description

Status of the PayPal account.
Possible values are:
  • verified - PayPal has verified the funding means for this account
  • unverified - PayPal has not verified the funding means for this account
close

Description

Status of the customer's shipping address as registered by PayPal
Possible values are:
  • none - Status is unknown at PayPal
  • confirmed - The address has been confirmed
  • unconfirmed - The address has not been confirmed
close

Description

First name of the PayPal account holder
close

Description

The unique identifier of a PayPal account and will never change in the life cycle of a PayPal account
close

Description

Surname of the PayPal account holder
close

Description

Object containing the address details of the customer
  • SDK Object type
    Address
close

Description

Additional address information
close

Description

City
Note: For payments with product 1503 the maximum length is not 40 but 20.
close

Description

ISO 3166-1 alpha-2 country code
close

Description

House number
close

Description

Full name of the state or province
close

Description

Streetname
close

Description

Zip code
Note: For payments with product 1503 the maximum length is not 10 but 8.
close

Description

Protection Eligibility data of the PayPal customer
  • SDK Object type
    ProtectionEligibility
close

Description

Possible values:
  • Eligible
  • PartiallyEligible
  • Ineligible
close

Description

Possible values:
  • ItemNotReceivedEligible
  • UnauthorizedPaymentEligible
  • Ineligible
close

Description

Payment product identifier
Please see payment products for a full overview of possible values.
close

Description

ID of the token. This property is populated when the payment was done with a token or when the payment was tokenized.
close

Description

Object containing the results of the fraud screening
  • SDK Object type
    FraudResults
close

Description

Results from the fraud prevention check. Possible values are:
  • accepted - Based on the checks performed the transaction can be accepted
  • challenged - Based on the checks performed the transaction should be manually reviewed
  • denied - Based on the checks performed the transaction should be rejected
  • no-advice - No fraud check was requested/performed
  • error - The fraud check resulted in an error and the fraud check was thus not performed
close

Description

Unique reference to a Mandate
close

Description

Payment product identifier
Please see payment products for a full overview of possible values.
close

Description

Payment method identifier used by the our payment engine with the following possible values:
  • bankRefund
  • bankTransfer
  • card
  • cash
  • directDebit
  • eInvoice
  • invoice
  • redirect
close

Description

Object that holds all reference properties that are linked to this transaction
  • SDK Object type
    PaymentReferences
close

Description

Your unique reference of the transaction that is also returned in our report files. This is almost always used for your reconciliation of our report files.
close

Description

When you did not supply a merchantReference for your payment, you need to fill this property with the reference of the original payment when you want to refund it
close

Description

Current high-level status of the payment in a human-readable form. Possible values are :
  • ACCOUNT_VERIFIED - The account has been verified using a validation services like 0$ auth
  • CREATED - The transaction has been created. This is the initial state once a new payment is created.
  • REDIRECTED - The customer has been redirected to a 3rd party to complete the authentication/payment
  • PENDING_PAYMENT - Instructions have been provided and we are now waiting for the money to come in
  • PENDING_FRAUD_APPROVAL - The transaction has been marked for manual review after an automatic fraud screening
  • PENDING_APPROVAL - The transaction is awaiting approval from you to proceed with the capturing of the funds
  • PENDING_COMPLETION - The transaction needs to be completed.
  • PENDING_CAPTURE - The transaction is waiting for you to request one or more captures of the funds.
  • REJECTED - The transaction has been rejected
  • AUTHORIZATION_REQUESTED - we have requested an authorization against an asynchronous system and is awaiting its response
  • CAPTURE_REQUESTED - The transaction is in the queue to be captured
  • CAPTURED - The transaction has been captured and we have received online confirmation
  • PAID - We have matched the incoming funds to the transaction
  • CANCELLED - You have cancelled the transaction
  • REJECTED_CAPTURE - We or one of our downstream acquirers/providers have rejected the capture request
  • REVERSED - The transaction has been reversed
  • CHARGEBACK_NOTIFICATION - We have received a notification of chargeback and this status informs you that your account will be debited for a particular transaction
  • CHARGEBACKED - The transaction has been chargebacked
  • REFUNDED - The transaction has been refunded

Please see Statuses for a full overview of possible values.
close

Description

This object has the numeric representation of the current payment status, timestamp of last status change and performable action on the current payment resource. In case of failed payments and negative scenarios, detailed error information is listed.
  • SDK Object type
    PaymentStatusOutput
close

Description

Custom object contains the set of errors
close

Description

Contains detailed information on one single error.
  • SDK Object type
    APIError
close

Description

Category the error belongs to. The category should give an indication of the type of error you are dealing with. Possible values:
  • CONNECT_PLATFORM_ERROR - indicating that a functional error has occurred in the E-Payment platform.
  • PAYMENT_PLATFORM_ERROR - indicating that a functional error has occurred in the Payment platform.
  • IO_ERROR - indicating that a technical error has occurred within the E-Payment platform or between E-Payment and any of the payment platforms or third party systems.
close

Description

Error code
close

Description

HTTP status code for this error that can be used to determine the type of error
close

Description

ID of the error. This is a short human-readable message that briefly describes the error.
close

Description

Human-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
close

Description

Returned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query.
Some common examples:
  • a.b selects the value of property b of root property a,
  • a[1] selects the first element of the array in root property a,
  • a[b='some value'] selects all elements of the array in root property a that have a property b with value 'some value'.
close

Description

Indicates if the transaction has been authorized
  • true
  • false
close

Description

Flag indicating if the payment can be cancelled
  • true
  • false
close

Description

Flag indicating if the payment can be refunded
  • true
  • false
close

Description

Highlevel status of the payment, payout or refund with the following possible values:
  • CREATED - The transaction has been created. This is the initial state once a new payment, payout or refund is created. This category groups the following statuses:
    • CREATED
  • PENDING_PAYMENT: The payment is waiting on customer action. This category groups the following statuses:
    • PENDING_PAYMENT
    • REDIRECTED
  • ACCOUNT_VERIFIED: The account has been verified. This category groups the following statuses:
    • ACCOUNT_VERIFIED
  • PENDING_MERCHANT: The transaction is awaiting approval to proceed with the payment, payout or refund. This category groups the following statuses:
    • PENDING_APPROVAL
    • PENDING_COMPLETION
    • PENDING_CAPTURE
    • PENDING_FRAUD_APPROVAL
  • PENDING_CONNECT_OR_3RD_PARTY: The transaction is in the queue to be processed. This category groups the following statuses:
    • AUTHORIZATION_REQUESTED
    • CAPTURE_REQUESTED
    • PAYOUT_REQUESTED
    • REFUND_REQUESTED
  • COMPLETED: The transaction has completed. This category groups the following statuses:
    • CAPTURED
    • PAID
    • ACCOUNT_CREDITED
    • CHARGEBACK_NOTIFICATION
  • REVERSED: The transaction has been reversed. This category groups the following statuses:
    • CHARGEBACKED
    • REVERSED
  • REFUNDED: The transaction has been refunded. This category groups the following statuses:
    • REFUNDED
  • UNSUCCESSFUL: The transaction has been rejected or is in such a state that it will never become successful. This category groups the following statuses:
    • CANCELLED
    • REJECTED
    • REJECTED_CAPTURE
    • REJECTED_CREDIT

Please see Statuses for a full overview of possible values.
close

Description

Numeric status code of the legacy API. It is returned to ease the migration from the legacy APIs to PostFinance E-Payment. You should not write new business logic based on this property as it will be deprecated in a future version of the API. The value can also be found in the BackOffice and in report files.

Response example

SDK: Java

This scenario you will probably use the most

  • {
        "payment" : {
            "id" : "000000850010000188180000200001",
            "paymentOutput" : {
                "amountOfMoney" : {
                    "amount" : 2890,
                    "currencyCode" : "EUR"
                },
                "references" : {
                    "merchantReference" : "merchantReference",
                    "paymentReference" : "0"
                },
                "paymentMethod" : "card",
                "cardPaymentMethodSpecificOutput" : {
                    "paymentProductId" : 1,
                    "authorisationCode" : "726747",
                    "card" : {
                        "cardNumber" : "************7977",
                        "expiryDate" : "1299"
                    },
                    "fraudResults" : {
                        "avsResult" : "0",
                        "cvvResult" : "0",
                        "fraudServiceResult" : "no-advice"
                    },
                    "threeDSecureResults" : {
                        "authenticationAmount" : {
                            "currencyCode" : "EUR",
                            "amount" : 2890
                        }
                    }
                }
            },
            "status" : "CANCELLED",
            "statusOutput" : {
                "isCancellable" : false,
                "statusCode" : 99999,
                "statusCodeChangeDateTime" : "20150223153431"
            }
        },
        "cardPaymentMethodSpecificOutput" : {
            "voidResponseId" : "0"
        }
    }
    

Response 400 - Bad requestErrorResponse

Properties
Property Type Required Details
errorId string yes read close
close

Description

Unique reference, for debugging purposes, of this error response
errors array of object yes read close
close

Description

List of one or more errors
close

Description

Contains detailed information on one single error.
  • SDK Object type
    APIError
close

Description

Category the error belongs to. The category should give an indication of the type of error you are dealing with. Possible values:
  • CONNECT_PLATFORM_ERROR - indicating that a functional error has occurred in the E-Payment platform.
  • PAYMENT_PLATFORM_ERROR - indicating that a functional error has occurred in the Payment platform.
  • IO_ERROR - indicating that a technical error has occurred within the E-Payment platform or between E-Payment and any of the payment platforms or third party systems.
close

Description

Error code
close

Description

HTTP status code for this error that can be used to determine the type of error
close

Description

ID of the error. This is a short human-readable message that briefly describes the error.
close

Description

Human-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
close

Description

Returned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query.
Some common examples:
  • a.b selects the value of property b of root property a,
  • a[1] selects the first element of the array in root property a,
  • a[b='some value'] selects all elements of the array in root property a that have a property b with value 'some value'.

Response example

SDK: Java

This scenario you will probably use the most

  • {
        "errorId" : "15eabcd5-30b3-479b-ae03-67bb351c07e6-00000092",
        "errors" : [
            {
                "code" : "20000000",
                "propertyName" : "bankAccountBban.accountNumber",
                "message" : "PARAMETER_NOT_FOUND_IN_REQUEST"
            }
        ]
    }
    

Response 402 - Payment requiredErrorResponse

The most common cause for this response id that the payment was not in a cancelable state.

Properties
Property Type Required Details
errorId string yes read close
close

Description

Unique reference, for debugging purposes, of this error response
errors array of object yes read close
close

Description

List of one or more errors
close

Description

Contains detailed information on one single error.
  • SDK Object type
    APIError
close

Description

Category the error belongs to. The category should give an indication of the type of error you are dealing with. Possible values:
  • CONNECT_PLATFORM_ERROR - indicating that a functional error has occurred in the E-Payment platform.
  • PAYMENT_PLATFORM_ERROR - indicating that a functional error has occurred in the Payment platform.
  • IO_ERROR - indicating that a technical error has occurred within the E-Payment platform or between E-Payment and any of the payment platforms or third party systems.
close

Description

Error code
close

Description

HTTP status code for this error that can be used to determine the type of error
close

Description

ID of the error. This is a short human-readable message that briefly describes the error.
close

Description

Human-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
close

Description

Returned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query.
Some common examples:
  • a.b selects the value of property b of root property a,
  • a[1] selects the first element of the array in root property a,
  • a[b='some value'] selects all elements of the array in root property a that have a property b with value 'some value'.

Response example

SDK: Java

This scenario you will probably use the most

  • {
        "errorId" : "657b10da-d2f9-4088-a948-bf190ef516b1-000002ca",
        "errors" : [
            {
                "code" : "400210",
                "propertyName" : "paymentId",
                "message" : "UNKNOWN_ORDER_OR_NOT_CANCELLABLE"
            }
        ]
    }
    
icon_top_1