Digital Payments

Abort

Aborting a created payment.

Edit "Abort" on GitHub

Abort

To abort a payment order, perform the abort operation that is returned in the payment order response. You need to include the following in the request body:

Abort PATCH Request

Request

1
2
3
4
PATCH /psp/paymentorders/09ccd29a-7c4f-4752-9396-12100cbfecce HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json;version=3.x/2.0      // Version optional for 3.0 and 2.0
1
2
3
4
5
6
7
{
{
  "paymentorder": {
    "operation": "Abort",
    "abortReason": "CancelledByConsumer"
  }
}
Field Type Description
paymentOrder object The payment order object.
operation string Abort
abortReason string CancelledByConsumer or CancelledByCustomer. Why the payment was aborted.

Abort PATCH Response

The response given when aborting a payment order is equivalent to a GET request towards the paymentorders resource, as displayed above, with its status set to Aborted.

Response

1
2
3
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8; version=3.x/2.0
api-supported-versions: 3.x/2.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
    "paymentOrder": {
        "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd",
        "created": "2022-01-24T10:54:05.6243371Z",
        "updated": "2022-01-24T10:54:19.2679591Z",
        "operation": "Purchase",
        "status": "Aborted",
        "currency": "SEK",
        "amount": 32000,
        "vatAmount": 0,
        "description": "Abort test",
        "initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
        "language": "sv-SE",
        "availableInstruments": [
            "CreditCard",
            "Invoice-PayExFinancingSe",
            "Invoice-PayMonthlyInvoiceSe",
            "Swish",
            "CreditAccount",
            "Trustly"
        ],    
        "instrumentMode": false,
        "guestMode": false,
        "orderItems": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/orderitems"
        },
        "urls": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/urls"
        },
        "payeeInfo": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/payeeinfo"
        },
        "payer": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/payers"
        },
        "history": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/history"
        },
        "failed": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/failed"
        },
        "aborted": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/aborted"
        },
        "paid": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/paid"
        },
        "cancelled": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/cancelled"
        },
        "financialTransactions": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/financialtransactions"
        },
        "failedAttempts": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/failedattempts"
        },
        "metadata": {
            "id": "/psp/paymentorders/2c3f7a3e-65ca-4493-ac93-08d9dcb313fd/metadata"
        }
    },
    "operations": [  
    ]
}
Field Type Description
paymentOrder object The payment order object.
id string The relative URL and unique identifier of the paymentorder resource . Please read about URL Usage to understand how this and other URLs should be used in your solution.
created string The ISO-8601 date of when the payment order was created.
updated string The ISO-8601 date of when the payment order was updated.
operation string Purchase
status string Initialized, Paid, Failed, Cancelled or Aborted. Indicates the state of the payment order.
currency string The currency of the payment order.
amount integer The transaction amount (including VAT, if any) entered in the lowest monetary unit of the selected currency. E.g.: 10000 = 100.00 SEK, 5000 = 50.00 SEK. The amount displayed is the final amount the payer paid for their order, including any payment method specific discounts or fees.
vatAmount integer The payment’s VAT (Value Added Tax) amount, entered in the lowest monetary unit of the selected currency. E.g.: 10000 = 100.00 SEK, 5000 = 50.00 SEK. The vatAmount entered will not affect the amount shown on the payment page, which only shows the total amount. This field is used to specify how much of the total amount the VAT will be. Set to 0 (zero) if there is no VAT amount charged.
description string(40) A 40 character length textual description of the purchase.
initiatingSystemUserAgent string The user agent of the HTTP client making the request, reflecting the value sent in the User-Agent header with the initial POST request which created the Payment Order.
language string sv-SE, nb-NO, da-DK, en-US or fi-FI.
availableInstruments string A list of payment methods available for this payment.
implementation string The Digital Payments implementation type. Omit if the integration is for Payments Only.
integration string The merchant’s Digital Payments integration type. HostedView (Seamless View) or Redirect. This field will not be populated until the payer has opened the payment UI, and the client script has identified if Swedbank Pay or another URI is hosting the container with the payment iframe.
instrumentMode bool Set to true or false. Indicates if the payment is initialized with only one payment method available.
guestMode bool Set to true or false. Indicates if the payer chose to pay as a guest or not. When using the Enterprise implementation, this is triggered by not including a payerReference or nationalIdentifier in the original payment order request.
orderItems string The array of items being purchased with the order. Note that authorization orderItems will not be printed on invoices, so lines meant for print must be added in the Capture request. The authorization orderItems will, however, be used in the Merchant Portal when captures or reversals are performed, and might be shown other places later. It is required to use this field to be able to send Capture orderItems. Capture requests should only contain items meant to be captured from the order.
urls string The URL to the urls resource where information about the urls can be retrieved.
payeeInfo id The payeeInfo object, containing information about the payee (the recipient of the money). See payeeInfo for details.
payer id The URL to the payer resource where information about the payer can be retrieved.
history id The URL to the history resource where information about the payment’s history can be retrieved.
failed id The URL to the failed resource where information about the failed transactions can be retrieved.
aborted id The URL to the aborted resource where information about the aborted transactions can be retrieved.
paid id The URL to the paid resource whereinformation about the paid transactions, including any possibly created tokens,can be retrieved.
cancelled id The URL to the cancelled resource where information about the cancelled transactions can be retrieved.
financialTransactions id The URL to the financialTransactions resource where information about the financial transactions can be retrieved.
failedAttempts id The URL to the failedAttempts resource where information about the failed attempts can be retrieved.
metadata id The URL to the metadata resource where information about the metadata can be retrieved.
operations array The array of operations that are possible to perform on the payment order in its current state. See Operations for details.