Payment Menu

Unscheduled Purchase

schedule 4 min read

Setting up subscriptions and merchant-initiated payments.

Edit "Unscheduled Purchase" on GitHub

Unscheduled Purchase

An unscheduled purchase, also called a Merchant Initiated Transaction (MIT), is a payment which uses a unscheduledToken generated through a previous payment in order to charge the same card at a later time. They are done by the merchant without the cardholder being present.

Request

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
64
65
66
67
68
69
70
71
72
POST /psp/paymentorders HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json

{
    "paymentorder": {
        "operation": "UnscheduledPurchase",
        "unscheduledToken": "7e6cdfc3-1276-44e9-9992-7cf4419750e1",
        "currency": "NOK",
        "amount": 1500,
        "vatAmount": 0,
        "description": "Test Unscheduled Purchase",
        "userAgent": "Mozilla/5.0...",
        "language": "nb-NO",
        "urls": {
            "callbackUrl": "https://example.com/payment-callback"
        },
        "payeeInfo": {
            "payeeId": "5cabf558-5283-482f-b252-4d58e06f6f3b"
            "payeeReference": "CD1234",
            "payeeName": "Merchant1",
            "productCategory": "A123",
            "orderReference": "or-12456",
            "subsite": "MySubsite"
        },
        "payer": {
            "payerReference": "AB1234",
        },
        "orderItems": [
            {
                "reference": "P1",
                "name": "Product1",
                "type": "PRODUCT",
                "class": "ProductGroup1",
                "itemUrl": "https://example.com/products/123",
                "imageUrl": "https://example.com/product123.jpg",
                "description": "Product 1 description",
                "discountDescription": "Volume discount",
                "quantity": 4,
                "quantityUnit": "pcs",
                "unitPrice": 300,
                "discountPrice": 200,
                "vatPercent": 2500,
                "amount": 1000,
                "vatAmount": 250
            },
            {
                "reference": "I1",
                "name": "InvoiceFee",
                "type": "PAYMENT_FEE",
                "class": "Fees",
                "description": "Fee for paying with Invoice",
                "quantity": 1,
                "quantityUnit": "pcs",
                "unitPrice": 1900,
                "vatPercent": 0,
                "amount": 1900,
                "vatAmount": 0,
                "restrictedToInstruments": [
                    "Invoice-PayExFinancingSe"
                ]
            }
        ],
        "metadata": {
            "key1": "value1",
            "key2": 2,
            "key3": 3.1,
            "key4": false
        }
    }
}
Required Field Type Description  
check paymentorder object The payment object.  
check operation object UnscheduledPurchase.  
check └➔ unscheduledToken string The created unscheduledToken, if operation: Verify, operation: UnscheduledPurchase or generateUnscheduledToken: true was used.  
check └➔ currency string The currency of the payment order.  
check └➔ 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.  
check └➔ 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.  
check └➔ description string A 40 character length textual description of the purchase.  
check └─➔ userAgent string The User-Agent string of the payer’s web browser.  
check └─➔ language string sv-SE, nb-NO, da-DK, en-US or fi-FI.  
check └─➔ urls string The URL to the urls resource where all URLs related to the payment order can be retrieved.  
check └─➔ callbackUrl string The URL that Swedbank Pay will perform an HTTP POST against every time a transaction is created on the payment. See callback for details.  
check └➔ payeeInfo string The payeeInfo object, containing information about the payee (the recipient of the money). See payeeInfo for details.  
check └─➔ payeeId string This is the unique id that identifies this payee (like merchant) set by Swedbank Pay.  
check └➔ payeeReference string(30) A unique reference from the merchant system. It is set per operation to ensure an exactly-once delivery of a transactional operation. See payeeReference for details. In Invoice Payments payeeReference is used as an invoice/receipt number, if the receiptReference is not defined.  
  └➔ receiptReference string(30) A unique reference from the merchant system. It is used to supplement payeeReference as an additional receipt number.  
check └─➔ payeeName string The payee name (like merchant name) that will be displayed when redirected to Swedbank Pay.  
check └─➔ productCategory string A product category or number sent in from the payee/merchant. This is not validated by Swedbank Pay, but will be passed through the payment process and may be used in the settlement process.  
check └─➔ orderReference String(50) The order reference should reflect the order reference found in the merchant’s systems.  
check └─➔ subsite String(40) The subsite field can be used to perform split settlement on the payment. The subsites must be resolved with Swedbank Pay reconciliation before being used.  
  └➔ payer string The payer object, containing information about the payer.  
  └─➔ payerReference string The reference to the payer from the merchant system, like e-mail address, mobile number, customer number etc. Also used in Payer Aware Payment Menu. Mandatory if generateRecurrenceToken, RecurrenceToken, generatePaymentToken or paymentToken is true.  
  └➔ metadata object A unique reference from the merchant system. It is set per operation to ensure an exactly-once delivery of a transactional operation. See payeeReference for details. In Invoice Payments payeeReference is used as an invoice/receipt number, if the receiptReference is not defined.  
check └➔ orderItems array The array of items being purchased with the order. Used to print on invoices if the payer chooses to pay with invoice, among other things. orderItems is required in all requests. In capture requests it should only contain the items to be captured from the order.  
check └─➔ reference string A reference that identifies the order item.  
check └─➔ name string The name of the order item.  
check └─➔ type string PRODUCT, SERVICE, SHIPPING_FEE, PAYMENT_FEE DISCOUNT, VALUE_CODE or OTHER. The type of the order item. PAYMENT_FEE is the amount you are charged with when you are paying with invoice. The amount can be defined in the amount field below.  
check └─➔ class string The classification of the order item. Can be used for assigning the order item to a specific product category, such as MobilePhone. Note that class cannot contain spaces and must follow the regex pattern [\w-]*. Swedbank Pay may use this field for statistics.  
  └─➔ itemUrl string The URL to a page that can display the purchased item, product or similar.  
︎︎︎ └─➔ imageUrl string The URL to an image of the order item.  
  └─➔ description string A 40 character length textual description of the purchase.  
  └─➔ discountDescription string The human readable description of the possible discount.  
check └─➔ quantity integer The 4 decimal precision quantity of order items being purchased.  
check └─➔ quantityUnit string The unit of the quantity, such as pcs, grams, or similar. This is used for your own book keeping.  
check └─➔ unitPrice integer The price per unit of order item, including VAT.  
  └─➔ discountPrice integer If the order item is purchased at a discounted price. This field should contain that price, including VAT.  
check └─➔ vatPercent integer The percent value of the VAT multiplied by 100, so 25% becomes 2500.  
check └─➔ 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.  
check └─➔ 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.  
  └➔ restrictedToInstruments array CreditCard, Invoice, Vipps, Swish, Trustly and/or CreditAccount. Invoice supports the subtypes PayExFinancingNo, PayExFinancingSe and PayMonthlyInvoiceSe, separated by a dash, e.g.; Invoice-PayExFinancingNo. Limits the options available to the consumer in the payment menu. Default value is all supported payment instruments. Usage of this field requires an agreement with Swedbank Pay.