Payment Flow
- When the payer starts the purchase process, you make a
POST
request towards Swedbank Pay with the collected Purchase information. - The next step is to collect the payer’s Swish registered mobile number
and make a
POST
request towards Swedbank Pay to create a sales transaction. - Swedbank Pay will handle the dialog with Swish and the payer will have to confirm the purchase in the Swish app.
- If
callbackURL
is set, you will receive a payment callback when the Swish dialog is completed. - Make a
GET
request to check the payment status.
Swish is a one-phase payment method that is based on sales
transactions not involving capture
or cancellation
operations.
Callback URL: It is mandatory to set a callbackUrl
in the POST
request creating the payment. When callbackUrl
is set, Swedbank Pay will send
a POST
request to this URL when the payer has fulfilled the payment. Upon
receiving this POST
request, a subsequent GET
request towards the id
of
the payment generated initially must be made to receive the state of the
transaction.
Step 1: Create A Purchase
A Purchase
payment is created by performing the following request.
GDPR: GDPR
sensitive data such as email, phone numbers and social security numbers must
not be used directly in request fields such as payerReference
. If it is
necessary to use GDPR sensitive data, it must be hashed and then the hash can be
used in requests towards Swedbank Pay.
Initial Direct Request
Request
1
2
3
POST /psp/swish/payments HTTP/1.1
Authorization: Bearer <AccessToken>
Content-Type: application/json
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
{
"payment": {
"operation": "Purchase",
"intent": "Sale",
"currency": "SEK",
"prices": [
{
"type": "Swish",
"amount": 1500,
"vatAmount": 0
}
],
"description": "Test Purchase",
"userAgent": "Mozilla/5.0...",
"language": "sv-SE",
"urls": {
"hostUrls": [ "https://example.com" ],
"paymentUrl": "https://example.com/perform-payment",
"completeUrl": "https://example.com/payment-completed",
"cancelUrl": "https://example.com/payment-cancelled",
"callbackUrl": "https://example.com/payment-callback",
"logoUrl": "https://example.com/logo.png",
"termsOfServiceUrl": "https://example.com/terms.pdf"
},
"payeeInfo": {
"payeeId": "5cabf558-5283-482f-b252-4d58e06f6f3b",
"payeeReference": "ref-123456",
"payeeName": "Merchant1",
"productCategory": "A123",
"orderReference": "or-123456",
"subsite": "MySubsite"
},
"payer": {
"payerReference": "AB1234",
},
"prefillInfo": {
"msisdn": "+46739000001"
}
},
"swish": {
"enableEcomOnly": false,
"paymentRestrictedToAgeLimit": 18,
"paymentRestrictedToSocialSecurityNumber": "199710202392"
}
}
Required | Field | Type | Description | |
---|---|---|---|---|
check | payment |
object |
The payment object contains information about the specific payment. |
|
check | operation |
string |
Determines the initial operation, defining the type of payment created. | |
check | intent |
string |
Authorization . |
|
check | currency |
string |
SEK. | |
check | prices |
object |
The prices resource lists the prices related to a specific payment. |
|
check | type |
string |
Swish |
|
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(40) |
A 40 character length textual description of the purchase. | |
payeeName |
string |
The payee name (like merchant name) that will be displayed when redirected to Swedbank Pay. | ||
check | userAgent |
string |
The user agent of the payer. Should typically be set to the value of the User-Agent header sent by the payer’s web browser. |
|
check | language |
string |
sv-SE , nb-NO or en-US . |
|
check | urls |
object |
The urls resource lists urls that redirects users to relevant sites. |
|
check | completeUrl |
string |
The URL that Swedbank Pay will redirect back to when the payer has completed their interactions with the payment. This does not indicate a successful payment, only that it has reached a final (complete) state. A GET request needs to be performed on the payment to inspect it further. See completeUrl for details. |
|
cancelUrl |
string |
The URL to redirect the payer to if the payment is cancelled. Only used in redirect scenarios. Can not be used simultaneously with paymentUrl ; only cancelUrl or paymentUrl can be used, not both. |
||
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. |
||
logoUrl |
string |
The URL that will be used for showing the customer logo. Must be a picture with maximum 50px height and 400px width. Requires HTTPS. | ||
termsOfServiceUrl |
string |
The URL to the terms of service document which the payer must accept in order to complete the payment. HTTPS is a requirement. | ||
check | payeenInfo |
object |
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 |
A unique reference from the merchant system. Set per operation to ensure an exactly-once delivery of a transactional operation. Length and content validation depends on whether the transaction.number or the payeeReference is sent to the acquirer. If Swedbank Pay handles the settlement, the transaction.number is sent and the payeeReference must be in the format of A-Za-z0-9 and string(30) . If you handle the settlement, Swedbank Pay will send the payeeReference and it will be limited to the format of string(12) . All characters must be digits. |
|
payeeName |
string |
The payee name (like merchant name) that will be displayed when redirected to Swedbank Pay. | ||
productCategory |
string(50) |
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. | ||
orderReference |
string(50) |
The order reference should reflect the order reference found in the merchant’s systems. | ||
subsite |
string(40) |
The subsite field can be used to perform a split settlement on the payment. The different subsite values must be resolved with Swedbank Pay reconciliation before being used. If you send in an unknown subsite value, it will be ignored and the payment will be settled using the merchant’s default settlement account. Must be in the format of A-Za-z0-9 . |
||
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. Mandatory if generateRecurrenceToken , RecurrenceToken , generatePaymentToken or paymentToken is true . |
||
prefillInfo |
object |
An object holding information which, when available, will be prefilled on the payment page. | ||
msisdn |
string |
Number will be prefilled on payment page, if valid. The mobile number must have a country code prefix and be 8 to 15 digits in length. | ||
swish |
object |
An object that holds different scenarios for Swish payments. | ||
enableEcomOnly |
boolean |
true if to only enable Swish on web based transactions.; otherwise false to also enable Swish transactions via in-app payments |
||
paymentRestrictedToAgeLimit |
integer |
Positive number that sets the required age needed to fulfill the payment. To use this feature it has to be configured in the contract. | ||
paymentRestrictedToSocialSecurityNumber |
string |
When provided, the payment will be restricted to a specific social security number to make sure its the same logged in customer who is also the payer. Format: yyyyMMddxxxx. To use this feature it has to be configured in the contract. |
Initial Direct Response
Response
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
HTTP/1.1 200 OK
Content-Type: application/json
{
"payment": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"number": 992308,
"created": "2017-10-23T08:38:57.2248733Z",
"instrument": "Swish",
"operation": "Purchase",
"intent": "Sale",
"state": "Ready",
"currency": "SEK",
"amount": 0,
"description": "Test Purchase",
"initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
"userAgent": "Mozilla/5.0...",
"language": "sv-SE",
"urls": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/urls"
},
"payeeInfo": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payeeinfo"
},
"payers": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payers"
}
},
"operations": [
{
"method": "PATCH",
"href": "https://api.externalintegration.payex.com/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"rel": "update-payment-abort"
},
{
"method": "POST",
"href": "https://api.externalintegration.payex.com/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/sales",
"rel": "create-sale"
}
]
}
Step 2a: Create E-Commerce Sale Transaction
This operation creates an e-commerce sales transaction in the Direct payment
scenario. This is managed either by sending a POST
request as seen below, or
by directing the payer to the hosted payment pages. Note that the msisdn
value (the payer’s mobile number) is required in this request.
E-Commerce Request
E-commerce request
1
2
3
POST /psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/sales HTTP/1.1
Authorization: Bearer <AccessToken>
Content-Type: application/json
1
2
3
4
5
{
"transaction": {
"msisdn": "+46739000001"
}
}
Field | Type | Required |
---|---|---|
transaction |
object |
The transaction object contains information about the specific transaction. |
msisdn |
string |
The payer’s mobile number. It must have a country code prefix and be 8 to 15 digits in length. |
E-Commerce Response
The created sale
resource contains information about the
sale
transaction made against a swish
payment.
Capture Response
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
{
"paymentorder": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"sale": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"itemDescriptions": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177/itemDescriptions"
},
"transaction": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"created": "2016-09-14T01:01:01.01Z",
"updated": "2016-09-14T01:01:01.03Z",
"type": "Sale",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "ABC123",
"isOperational": false,
"problem": {
"type": "https://api.payex.com/psp/errordetail/swish/3DSECUREERROR",
"title": "Error when complete authorization",
"status": 400,
"detail": "Unable to complete 3DSecure verification!",
"problems": [
]
"operations": [
{
"href": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"rel": "edit-sale",
"method": "PATCH"
}
]
}
}
}
Field | Type | Description | |
---|---|---|---|
paymentOrder |
string |
The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
|
id |
string |
The relative URL and unique identifier of the sale resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
|
itemDescriptions |
object |
The object representation of the itemDescriptions resource. |
|
id |
string |
The relative URL and unique identifier of the itemDescriptions resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
|
transaction |
object |
The object representation of the generic transaction resource, containing information about the current transaction. |
|
id |
string |
The relative URL and unique identifier of the transaction 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 and time of when the transaction was created. | |
updated |
string |
The ISO-8601 date and time of when the transaction was updated. | |
type |
string |
Indicates the transaction type. | |
state |
string |
Indicates the state of the transaction, usually initialized , completed or failed . If a partial sale has been done and further transactions are possible, the state will be awaitingActivity . |
|
number |
integer |
The transaction number , useful when there’s need to reference the transaction in human communication. Not usable for programmatic identification of the transaction, where id should be used instead. |
|
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. |
|
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 |
A 40 character length textual description of the purchase. | |
payeeReference |
string |
A unique reference from the merchant system. Set per operation to ensure an exactly-once delivery of a transactional operation. Length and content validation depends on whether the transaction.number or the payeeReference is sent to the acquirer. If Swedbank Pay handles the settlement, the transaction.number is sent and the payeeReference must be in the format of A-Za-z0-9 and string(30) . If you handle the settlement, Swedbank Pay will send the payeeReference and it will be limited to the format of string(12) . All characters must be digits. In Invoice Payments payeeReference is used as an invoice/receipt number, if the receiptReference is not defined. |
|
receiptReference |
string |
A unique reference to the transaction, provided by the merchant. Can be used as an invoice or receipt number as a supplement to payeeReference . |
|
failedReason |
string |
The human readable explanation of why the payment failed. | |
isOperational |
bool |
true if the transaction is operational; otherwise false . |
|
operations |
array |
The array of operations that are possible to perform on the transaction in its current state. |
E-Commerce Sequence Diagram
The sequence diagram below shows the two requests you have to send to Swedbank Pay to make a purchase. The Callback response is a simplified example in this flow. Go to the Callback section to view the complete flow.
sequenceDiagram
activate Browser
Browser->>-Merchant: Start purchase
activate Merchant
Merchant->>-SwedbankPay: POST <Swish payment> (operation=PURCHASE)
activate SwedbankPay
note left of Merchant: First API request
SwedbankPay-->>-Merchant: Payment resource
activate Merchant
Merchant->>- SwedbankPay: POST <Sales Transaction> (operation=create-sale)
activate SwedbankPay
SwedbankPay-->>-Merchant: Transactions resource
activate Merchant
note left of Merchant: POST containing MSISDN
Merchant->>-Browser: Tell payer to open Swish app
Swish_API->>Swish_App: Ask for payment confirmation
activate Swish_App
Swish_App-->>-Swish_API: Payer confirms payment
alt Callback
activate SwedbankPay
SwedbankPay-->>-Swish_API: Callback response
activate SwedbankPay
SwedbankPay->>-Merchant: Transaction Callback
end
activate Merchant
Merchant->>- SwedbankPay: GET <Swish payment>
activate SwedbankPay
SwedbankPay-->>-Merchant: Payment response
activate Merchant
Merchant->>-Browser: Payment Status
Step 2b: Create M-Commerce Sale Transaction
This operation creates an m-commerce sales transaction in the Direct payment
scenario. This is managed either by sending a POST
request as seen below, or
by directing the payer to the hosted payment pages. Note that the msisdn
value (the payer’s mobile number) is left out in this request. The
redirect-app-swish
operation is only present in the m-commerce flow response.
M-Commerce Request
M-Commerce Request
1
2
3
POST /psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/sales HTTP/1.1
Authorization: Bearer <AccessToken>
Content-Type: application/json
1
2
3
4
{
"transaction": {
}
}
Field | Type | Required |
---|---|---|
transaction |
object |
The transaction object is empty for m-commerce sale transactions. |
M-Commerce Response
The created sale
resource contains information about the
sale
transaction made against a swish
payment.
Capture Response
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
{
"paymentorder": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"sale": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"itemDescriptions": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177/itemDescriptions"
},
"transaction": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"created": "2016-09-14T01:01:01.01Z",
"updated": "2016-09-14T01:01:01.03Z",
"type": "Sale",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "ABC123",
"isOperational": false,
"problem": {
"type": "https://api.payex.com/psp/errordetail/swish/3DSECUREERROR",
"title": "Error when complete authorization",
"status": 400,
"detail": "Unable to complete 3DSecure verification!",
"problems": [
]
"operations": [
{
"href": "swish://paymentrequest?token=LhXrK84MSpWU2RO09f8kUP-FHiBo-1pB",
"method": "GET",
"rel": "redirect-app-swish"
},
{
"href": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"rel": "edit-sale",
"method": "PATCH"
}
]
}
}
}
Field | Type | Description | |
---|---|---|---|
paymentOrder |
string |
The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
|
id |
string |
The relative URL and unique identifier of the sale resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
|
itemDescriptions |
object |
The object representation of the itemDescriptions resource. |
|
id |
string |
The relative URL and unique identifier of the itemDescriptions resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
|
transaction |
object |
The object representation of the generic transaction resource, containing information about the current transaction. |
|
id |
string |
The relative URL and unique identifier of the transaction 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 and time of when the transaction was created. | |
updated |
string |
The ISO-8601 date and time of when the transaction was updated. | |
type |
string |
Indicates the transaction type. | |
state |
string |
Indicates the state of the transaction, usually initialized , completed or failed . If a partial sale has been done and further transactions are possible, the state will be awaitingActivity . |
|
number |
integer |
The transaction number , useful when there’s need to reference the transaction in human communication. Not usable for programmatic identification of the transaction, where id should be used instead. |
|
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. |
|
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 |
A 40 character length textual description of the purchase. | |
payeeReference |
string |
A unique reference from the merchant system. Set per operation to ensure an exactly-once delivery of a transactional operation. Length and content validation depends on whether the transaction.number or the payeeReference is sent to the acquirer. If Swedbank Pay handles the settlement, the transaction.number is sent and the payeeReference must be in the format of A-Za-z0-9 and string(30) . If you handle the settlement, Swedbank Pay will send the payeeReference and it will be limited to the format of string(12) . All characters must be digits. In Invoice Payments payeeReference is used as an invoice/receipt number, if the receiptReference is not defined. |
|
receiptReference |
string |
A unique reference to the transaction, provided by the merchant. Can be used as an invoice or receipt number as a supplement to payeeReference . |
|
failedReason |
string |
The human readable explanation of why the payment failed. | |
isOperational |
bool |
true if the transaction is operational; otherwise false . |
|
operations |
array |
The array of operations that are possible to perform on the transaction in its current state. |
Step 3: GET The Payment Status
GET Request
1
2
3
4
GET /psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/ HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
1
2
3
4
{
"transaction": {
}
}
GET Payment Response
GET Response
1
2
HTTP/1.1 200 OK
Content-Type: application/json
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
{
"payment": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"number": 1234567890,
"created": "2016-09-14T13:21:29.3182115Z",
"updated": "2016-09-14T13:21:57.6627579Z",
"state": "Ready",
"operation": "Purchase",
"intent": "Authorization",
"currency": "NOK",
"amount": 1500,
"remainingCaptureAmount": 1500,
"remainingCancellationAmount": 1500,
"remainingReversalAmount": 0,
"description": "Test Purchase",
"initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
"userAgent": "Mozilla/5.0...",
"language": "nb-NO",
"prices": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/prices"
},
"payeeInfo": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payeeInfo"
},
"payers": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payers"
},
"urls": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/urls"
},
"transactions": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/transactions"
},
"captures": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/captures"
},
"reversals": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/reversals"
},
"cancellations": {
"id": "/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/cancellations"
}
},
"operations": [
{
"method": "PATCH",
"href": "https://api.externalintegration.payex.com/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"rel": "update-payment-abort",
"contentType": "application/json"
},
{
"method": "POST",
"href": "https://api.externalintegration.payex.com/psp/swish/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/captures",
"rel": "create-capture",
"contentType": "application/json"
}
]
}
Field | Type | Description |
---|---|---|
payment |
object |
The payment object contains information about the specific payment. |
id |
string |
The relative URL and unique identifier of the payment resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
number |
integer |
The payment number , useful when there’s need to reference the payment in human communication. Not usable for programmatic identification of the payment, where id should be used instead. |
created |
string |
The ISO-8601 date of when the payment was created. |
updated |
string |
The ISO-8601 date of when the payment was updated. |
state |
string |
Ready , Pending , Failed or Aborted . Indicates the state of the payment, not the state of any transactions performed on the payment. To find the state of the payment’s transactions (such as a successful authorization), see the transactions resource or the different specialized type-specific resources such as authorizations or sales . |
prices |
object |
The prices resource lists the prices related to a specific payment. |
prices.id |
string |
The relative URL and unique identifier of the prices resource . Please read about URL Usage to understand how this and other URLs should be used in your solution. |
description |
string(40) |
A 40 character length textual description of the purchase. |
userAgent |
string |
The user agent of the payer. Should typically be set to the value of the User-Agent header sent by the payer’s web browser. |
language |
string |
sv-SE , nb-NO or en-US . |
urls |
string |
The URL to the urls resource where all URLs related to the payment can be retrieved. |
payeeInfo |
string |
The URL to the payeeinfo resource where the information about the payee of the payment can be retrieved. |
payers |
string |
The URL to the payer resource where the information about the payer can be retrieved. |
operations |
array |
The array of operations that are possible to perform on the payment in its current state. |
method |
string |
The HTTP method to use when performing the operation. |
href |
string |
The target URL to perform the operation against. |
rel |
string |
The name of the relation the operation has to the current resource. |
M-Commerce Sequence Diagram
The sequence diagram below shows the three requests you have to send to Swedbank Pay to make a purchase. The Callback response is a simplified example in this flow. Go to the Callback section to view the complete flow.
sequenceDiagram
activate Browser
Browser->>-Merchant: Start purchase
activate Merchant
Merchant->>-SwedbankPay: POST <Swish payment> (operation=PURCHASE)
activate SwedbankPay
note left of Merchant: First API request
SwedbankPay-->>-Merchant: Payment resource
activate Merchant
Merchant->>- SwedbankPay: POST <Sales Transaction> (operation=create-sale)
activate SwedbankPay
SwedbankPay-->>-Merchant: Transaction resource
activate Merchant
note left of Merchant: POST containing MSISDN
Merchant-->>-Browser: Tell payer to open Swish app
Swish_API->>Swish_App: Ask for payment confirmation
activate Swish_App
Swish_App-->>-Swish_API: Payer confirms payment
activate Swish_API
Swish_API->>-Swish_App: Start redirect
activate Swish_App
Swish_App-->>-Browser: Redirect
alt Callback
activate SwedbankPay
SwedbankPay-->>-Swish_API: Callback response
activate SwedbankPay
SwedbankPay->>-Merchant: Transaction Callback
end
activate Merchant
Merchant->>- SwedbankPay: GET <Swish Payment>
activate SwedbankPay
SwedbankPay-->>-Merchant: Payment response
activate Merchant
Merchant-->>-Browser: Payment Status