Create Payment
To create a Vipps payment, you perform an HTTP POST against the
/psp/vipps/payments resource.
An example of a payment creation request is provided below. Each individual field of the JSON document is described in the following section. Use the expand request parameter to get a response that includes one or more expanded sub-resources inlined.
Vipps Request
Request
1
2
3
4
POST /psp/vipps/payments HTTP/1.1
Host: api.externalintegration.payex.com
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
{
"payment": {
"operation": "Purchase",
"intent": "Authorization",
"currency": "NOK",
"prices": [
{
"type": "Vipps",
"amount": 1500,
"vatAmount": 0
}
],
"description": "Vipps Test",
"userAgent": "Mozilla/5.0",
"language": "nb-NO",
"urls": {
"hostUrls": [ "https://example.com", "https://example.net" ],
"completeUrl": "https://example.com/payment-completed",
"cancelUrl": "https://example.com/payment-cancelled",
"paymentUrl": "https://example.com/perform-payment",
"callbackUrl": "https://api.externalintegration.payex.com/psp/payment-callback",
"logoUrl": "https://example.com/path/to/logo.png",
"termsOfServiceUrl": "https://example.com/terms.pdf"
},
"payeeInfo": {
"payeeId": "5cabf558-5283-482f-b252-4d58e06f6f3b",
"payeeReference": "Postmantimestamp",
"payeeName": "Merchant1",
"productCategory": "A123",
"orderReference": "or-12456",
"subsite": "MySubsite"
},
"payer": {
"payerReference": "AB1234",
},
"prefillInfo": {
"msisdn": "+4793000001"
}
}
}
| Required | Field | Type | Description |
|---|---|---|---|
| check︎ | payment |
object |
The payment object. |
| check︎ | operation |
string |
Determines the initial operation, defining the type of payment created. Possible options are Purchase, Abort Verify, UnscheduledPurchase, Recur and Payout. |
| check︎ | intent |
string |
Authorization |
| check︎ | currency |
string |
NOK |
| check︎ | prices |
object |
The prices object. |
| check︎ | type |
string |
vipps |
| 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 NOK, 5000 = 50.00 NOK. |
| 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 NOK, 5000 = 50.00 NOK. 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 textual description of the purchase. Maximum length is 40 characters. |
| 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 object containing URLs relevant for the payment. |
| check︎ | hostUrls |
array |
The array of valid host URLs. |
| 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, either by the payer or by the merchant trough an abort request of the payment. |
|
paymentUrl |
string |
The paymentUrl represents the URL that Swedbank Pay will redirect back to when the view-operation needs to be loaded, to inspect and act on the current status of the payment, such as when the payer is redirected out of the Seamless View (the <iframe>) and sent back after completing the payment. paymentUrl is only used in Seamless Views and should point to the page of where the Payment Order Seamless View is hosted. If both cancelUrl and paymentUrl is sent, the paymentUrl will used. |
|
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. It must be a picture with maximum 50px height and 400px width. HTTPS is required. | |
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︎ | payeeInfo |
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(30) |
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 to the acquirer 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 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. Mandatory if generateRecurrenceToken, RecurrenceToken, generatePaymentToken or paymentToken is true. |
|
prefillInfo |
object |
An object that holds prefill information that can be inserted on the payment page. | |
msisdn |
string |
Number will be prefilled on payment page, if valid. Only Norwegian phone numbers are supported. The country code prefix is +47 |
Vipps Response
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
{
"payment": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"number": 72100003079,
"created": "2018-09-05T14:18:44.4259255Z",
"instrument": "Vipps",
"operation": "Purchase",
"intent": "Authorization",
"state": "Ready",
"currency": "NOK",
"amount": 0,
"description": "Vipps Test",
"initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
"userAgent": "Mozilla/5.0 weeeeee",
"language": "nb-NO",
"prices": { "id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/prices" },
"urls": { "id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/urls" },
"payeeInfo": { "id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payeeinfo" },
"payers": { "id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payers" },
"metadata": { "id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/metadata" }
},
"operations": [
{
"method": "PATCH",
"href": "https://api.externalintegration.payex.com/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"rel": "update-payment-abort"
},
{
"method": "GET",
"href": "https://ecom.externalintegration.payex.com/vipps/payments/authorize/afccf3d0016340620756d5ff3e08f69b555fbe2e45ca71f4bd159ebdb0f00065",
"rel": "redirect-authorization"
}
]
}
Purchase
Posting a payment (operation Purchase) returns the options of aborting the
payment altogether or creating an authorization transaction through the
redirect-authorization hyperlink.
Request
1
2
3
4
POST /psp/vipps/payments HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
1
2
3
4
5
{
"payment": {
"operation": "Purchase"
}
}
Operations
When a payment resource is created and during its lifetime, it will have a set of operations that can be performed on it. Which operations are available will vary depending on the state of the payment resource, what the access token is authorized to do, etc.
| Field | Description |
|---|---|
href |
The target URL to perform the operation against. |
rel |
The name of the relation the operation has to the current resource. |
method |
The HTTP method to use when performing the operation. |
The operations should be performed as described in each response and not as
described here in the documentation.
Always use the href and method as specified in the response by finding
the appropriate operation based on its rel value.
The only thing that should be hard coded in the client is the value of the
rel and the request that will be sent in the HTTP body of the request for
the given operation.
| Operation | Description |
|---|---|
update-payment-abort |
Aborts the payment before any financial transactions are performed. |
redirect-authorization |
Used to redirect the payer to Swedbank Pay Payments and the authorization UI. |
create-capture |
Creates a capture transaction. |
create-cancellation |
Creates a cancellation transaction. |
create-reversal |
Creates a reversal transaction. |
Vipps Transactions
All Vipps after payment transactions are described below.
Authorizations
The authorizations resource contains information about the authorization
transactions made on a specific payment.
GET Request Authorizations
Request
1
2
3
4
GET /psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/authorizations HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
GET Response Authorizations
The created authorization resource contains information about the
authorization transaction made against a vipps 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",
"authorization": {
"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": "Authorization",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "ABC123",
"isOperational": false,
"problem": {
"type": "https://api.payex.com/psp/errordetail/vipps/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-authorization",
"method": "PATCH"
}
]
}
}
}
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.
authorization
object
id
string
The relative URL and unique identifier of the authorization resource this authorizations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
itemDescriptions
object
itemDescriptions resource.
id
string
The relative URL and unique identifier of the itemDescriptions resource this authorizations belongs to. 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 this authorizations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
created
string
updated
string
type
string
state
string
Indicates the state of the transaction, usually initialized, completed or failed. If a partial authorization 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 textual description of the purchase. Maximum length is 40 characters.
payeeReference
string(30)
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 to the acquirer 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
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.
Cancellations
The cancellations resource lists the cancellation transactions on a
specific payment.
GET Request Cancel
Request
1
2
3
4
GET /psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/cancellations HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
GET Response Cancel
The cancel resource contains information about the
cancel transaction made against a vipps payment. You can
return a specific cancel transaction by performing a GET request
towards the specific transaction’s id.
Transaction List Response
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
{
"paymentorder": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"cancellations": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment",
"cancelList": [{
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"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": "Cancel",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "AH123456",
"isOperational": false,
"operations": []
}
}]
}
}
paymentOrder
string
The relative URL and unique identifier of the payment resource this authorizations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
cancellations
object
cancellations resource.
id
string
The relative URL and unique identifier of the cancellations resource this authorizations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
cancellationList
array
cancel resource below.
id
string
The relative URL and unique identifier of the transaction resource this authorizations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
created
string
updated
string
type
string
state
string
Indicates the state of the transaction, usually initialized, completed or failed. If a partial cancel 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 textual description of the purchase. Maximum length is 40 characters.
payeeReference
string(30)
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 to the acquirer 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.
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.
Create Cancellation Transaction
A payment may be cancelled if the rel create-cancellation is available. You
can only cancel a payment, or part of it, if it has yet to be captured. To
revert a capture, or part of a capture, you must perform a reversal.
Performing a cancellation will cancel all the remaining authorized amount on a
payment.
Cancel Request
Request
1
2
3
4
POST /psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/cancellations HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
1
2
3
4
5
6
{
"transaction": {
"payeeReference": "testabc",
"description" : "description for transaction"
}
}
Cancel Response
The created cancel resource contains information about the
cancel transaction made against a vipps 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",
"cancel": {
"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": "Cancel",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "ABC123",
"isOperational": false,
"problem": {
"type": "https://api.payex.com/psp/errordetail/vipps/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-cancel",
"method": "PATCH"
}
]
}
}
}
paymentOrder
string
The relative URL and unique identifier of the payment resource this authorizations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
authorization
object
id
string
The relative URL and unique identifier of the authorization resource this cancellations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
itemDescriptions
object
itemDescriptions resource.
id
string
The relative URL and unique identifier of the itemDescriptions resource this cancellations belongs to. 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 this cancellations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
created
string
updated
string
type
string
state
string
Indicates the state of the transaction, usually initialized, completed or failed. If a partial cancel 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 textual description of the purchase. Maximum length is 40 characters.
payeeReference
string(30)
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 to the acquirer 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
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.
Reversals
The reversals resource lists the reversal transactions (one or more)
on a specific payment.
GET Request Reversal
Request
1
2
3
4
GET /psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/reversals HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json
GET Response Reversal
The reversal resource contains information about the
reversal transaction made against a vipps payment. You can
return a specific reversal transaction by performing a GET request
towards the specific transaction’s id.
Transaction List Response
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
{
"paymentorder": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"reversals": {
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment",
"reversalList": [{
"id": "/psp/paymentorders/7e6cdfc3-1276-44e9-9992-7cf4419750e1/currentpayment/ec2a9b09-601a-42ae-8e33-a5737e1cf177",
"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": "Reversal",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "AH123456",
"isOperational": false,
"operations": []
}
}]
}
}
paymentOrder
string
The relative URL and unique identifier of the payment resource this cancellations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
reversals
object
reversals resource.
id
string
The relative URL and unique identifier of the reversals resource this cancellations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
reversalList
array
reversal resource below.
id
string
The relative URL and unique identifier of the transaction resource this cancellations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
created
string
updated
string
type
string
state
string
Indicates the state of the transaction, usually initialized, completed or failed. If a partial reversal 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 textual description of the purchase. Maximum length is 40 characters.
payeeReference
string(30)
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 to the acquirer 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.
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.
Create Reversal Transaction
A reversal transaction can be created if the rel create-reversal is
available.
Reversal Request
Request
1
2
3
4
5
6
7
8
{
"transaction": {
"amount": 1500,
"vatAmount": 250,
"payeeReference": "cpttimestamp",
"description" : "description for transaction"
}
}
1
2
3
4
5
6
{
"transaction": {
"payeeReference": "testabc",
"description" : "description for transaction"
}
}
| Required | Field | Type | Description |
|---|---|---|---|
| check | transaction |
object |
The transaction object. |
| 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 NOK, 5000 = 50.00 NOK. |
| 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 NOK, 5000 = 50.00 NOK. 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 textual description of the capture |
| check | payeeReference |
string(30) |
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 to the acquirer 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. |
Reversal Response
The created reversal resource contains information about the
reversal transaction made against a vipps 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",
"reversal": {
"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": "Reversal",
"state": "Completed",
"number": 1234567890,
"amount": 1000,
"vatAmount": 250,
"description": "Test transaction",
"payeeReference": "ABC123",
"isOperational": false,
"problem": {
"type": "https://api.payex.com/psp/errordetail/vipps/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-reversal",
"method": "PATCH"
}
]
}
}
}
paymentOrder
string
The relative URL and unique identifier of the payment resource this cancellations belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
authorization
object
id
string
The relative URL and unique identifier of the authorization resource this reversals belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
itemDescriptions
object
itemDescriptions resource.
id
string
The relative URL and unique identifier of the itemDescriptions resource this reversals belongs to. 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 this reversals belongs to. Please read about URL Usage to understand how this and other URLs should be used in your solution.
created
string
updated
string
type
string
state
string
Indicates the state of the transaction, usually initialized, completed or failed. If a partial reversal 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 textual description of the purchase. Maximum length is 40 characters.
payeeReference
string(30)
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 to the acquirer 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
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.
Abort
To abort a payment, perform the update-payment-abort operation that is
returned in the payment request.
Abort Request
Request
1
2
3
4
PATCH /psp/vipps/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
5
6
{
"payment": {
"operation": "Abort",
"abortReason": "CancelledByConsumer"
}
}
Abort Response
The response will be the payment resource with its state set to Aborted.
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
HTTP/1.1 200 OK
Content-Type: application/json
{
"payment": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1",
"number": 70100130293,
"created": "2019-01-09T13:11:28.371179Z",
"updated": "2019-01-09T13:11:46.5949967Z",
"instrument": "Vipps",
"operation": "Purchase",
"intent": "Authorization",
"state": "Aborted",
"currency": "NOK",
"prices": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/prices"
},
"amount": 0,
"description": "vipps Test",
"initiatingSystemUserAgent": "swedbankpay-sdk-dotnet/3.0.1",
"userAgent": "Mozilla/5.0",
"language": "nb-NO",
"urls": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/urls"
},
"payeeInfo": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payeeinfo"
},
"payers": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/payers"
},
"metadata": {
"id": "/psp/vipps/payments/7e6cdfc3-1276-44e9-9992-7cf4419750e1/metadata"
}
},
"operations": []
}