ePayment API (1.6.0)
Download OpenAPI specification:Download
The ePayment API enables you to create Vipps MobilePay payments for online and in-person payments. See the ePayment API Guide for more details.
Create a payment
Create a new payment
Authorizations:
header Parameters
Idempotency-Key required | string <= 50 characters Example: fb492b5e-7907-4d83-ba20-c7fb60ca35de Idempotency key for the request, ensures idempotent actions. See idempotency |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Vipps-System-Name | string <= 30 characters Example: WooCommerce The name of the ecommerce solution. One word in lowercase letters is good. See http-headers. |
Vipps-System-Version | string <= 30 characters Example: 5.4.0 The version number of the ecommerce solution. See http-headers. |
Vipps-System-Plugin-Name | string <= 30 characters Example: woocommerce-payment The name of the ecommerce plugin (if applicable). One word in lowercase letters is good. See http-headers. |
Vipps-System-Plugin-Version | string <= 30 characters Example: 1.2.1 The version number of the ecommerce plugin (if applicable). See http-headers. |
Request Body schema: application/jsonrequired
New CreatePaymentRequest
body.
required | object (Amount) Amount object, containing a |
Customer phone number (object) or Personal QR code (object) or Customer token (object) (Customer) The target customer if the identity is known. The customer can be specified either with phone number, the customer token or with the user's personal QR code Specifying more than one of these will result in an error. | |
minimumUserAge | integer or null [ 0 .. 100 ] Minimum age in years required for the customer to make the purchase. |
customerInteraction | string Default: "CUSTOMER_NOT_PRESENT" Enum: "CUSTOMER_PRESENT" "CUSTOMER_NOT_PRESENT" The type of customer interaction that triggers the purchase.
|
object (IndustryData) Additional compliance data related to the transaction. | |
required | object (PaymentMethod) |
object (Profile) | |
reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ The |
returnUrl | string The URL the user is returned to after the payment session.
The URL must use the |
userFlow required | string Enum: "PUSH_MESSAGE" "NATIVE_REDIRECT" "WEB_REDIRECT" "QR" The flow for bringing the user to the Vipps or MobilePay app's payment confirmation screen.
If |
expiresAt | string or null^((?:(\d{4}-\d{2}-\d{2})(T|t)(\d{2}:\d{2}:\d{... The payment will expire at the given date and time.
The format must adhere to RFC 3339.
The value must be more than 10 minutes and less than 60 days in the future.
Can only be combined with If |
object or null Optional setting that is only applicable when | |
paymentDescription | string [ 3 .. 100 ] characters The payment description summary that will be provided to the user through the app, the merchant portal, and the settlement files. See the recommendations. |
object (Receipt) | |
object or null (Metadata) <= 5 properties Metadata is a key-value map that can be used to store additional
information about the payment. The metadata is not used by Vipps
MobilePay, but is passed through in the | |
receiptUrl | string or null The URL where a receipt can be viewed or downloaded.
The URL must use the |
Responses
Request samples
- Payload
{- "amount": {
- "currency": "NOK",
- "value": 49900
}, - "customer": {
- "phoneNumber": "4712345678"
}, - "minimumUserAge": 16,
- "customerInteraction": "CUSTOMER_NOT_PRESENT",
- "industryData": {
- "airlineData": {
- "agencyInvoiceNumber": "string",
- "airlineCode": "074",
- "airlineDesignatorCode": "KL",
- "passengerName": "FLYER / MARY MS.",
- "ticketNumber": "123-1234567890"
}
}, - "paymentMethod": {
- "type": "WALLET",
- "blockedSources": [
- "COMMERCIAL_CARDS"
]
}, - "profile": {
- "scope": "name phoneNumber"
}, - "reference": "acme-shop-123-order123abc",
- "userFlow": "WEB_REDIRECT",
- "expiresAt": "2023-02-26T17:32:28Z",
- "qrFormat": {
- "format": "IMAGE/SVG+XML",
- "size": 1024
}, - "paymentDescription": "Temporary reservation of maximum amount. You will only be charged for the actual use.",
- "receipt": {
- "orderLines": [
- {
- "name": "socks",
- "id": "1234567890",
- "totalAmount": 1000,
- "totalAmountExcludingTax": 800,
- "totalTaxAmount": 250,
- "taxPercentage": 25,
- "taxRate": 2500,
- "unitInfo": {
- "unitPrice": 0,
- "quantity": "0.822",
- "quantityUnit": "PCS"
}, - "discount": 2000,
- "isReturn": false,
- "isShipping": false
}
], - "bottomLine": {
- "currency": "NOK",
- "tipAmount": 2000,
- "giftCardAmount": 20000,
- "posId": "string",
- "totalAmount": 0,
- "totalTax": 0,
- "totalDiscount": 0,
- "shippingAmount": 0,
- "shippingInfo": {
- "amount": 1000,
- "amountExcludingTax": 1000,
- "taxAmount": 250,
- "taxPercentage": 25
}, - "paymentSources": {
- "giftCard": 0,
- "card": 0,
- "voucher": 0,
- "cash": 0
}, - "barcode": {
- "format": "EAN-13",
- "data": "string"
}, - "receiptNumber": "string",
- "terminalId": "string"
}
}, - "metadata": {
- "key1": "value1",
- "key2": "value2",
- "key3": "value3"
},
}
Response samples
- 201
- 400
- 403
- 409
{- "reference": "acme-shop-123-order123abc"
}
Get a payment
Get a payment object by its reference
id.
Authorizations:
path Parameters
Reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ Example: acme-shop-123-order123abc The |
header Parameters
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Responses
Response samples
- 200
{- "aggregate": {
- "authorizedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "cancelledAmount": {
- "currency": "NOK",
- "value": 49900
}, - "capturedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "refundedAmount": {
- "currency": "NOK",
- "value": 49900
}
}, - "amount": {
- "currency": "NOK",
- "value": 49900
}, - "state": "CREATED",
- "paymentMethod": {
- "type": "WALLET",
- "cardBin": "540185"
}, - "profile": {
- "sub": "string"
}, - "pspReference": "3343121302",
- "reference": "acme-shop-123-order123abc",
- "metadata": {
- "key1": "value1",
- "key2": "value2",
- "key3": "value3"
}
}
Get a payment's event log
Get event log for the specified payment's reference
id.
Authorizations:
path Parameters
Reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ Example: acme-shop-123-order123abc The |
header Parameters
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Responses
Response samples
- 200
[- {
- "reference": "acme-shop-123-order123abc",
- "pspReference": "3343121302",
- "name": "AUTHORIZED",
- "amount": {
- "currency": "NOK",
- "value": 49900
}, - "timestamp": "2022-12-31T00:00:00Z",
- "idempotencyKey": "fb492b5e-7907-4d83-ba20-c7fb60ca35de",
- "success": true
}
]
Cancel a payment
Cancel the payment with the specified reference
id.
Authorizations:
path Parameters
Reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ Example: acme-shop-123-order123abc The |
header Parameters
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Idempotency-Key required | string <= 50 characters Example: fb492b5e-7907-4d83-ba20-c7fb60ca35de Idempotency key for the request, ensures idempotent actions. See idempotency |
Vipps-System-Name | string <= 30 characters Example: WooCommerce The name of the ecommerce solution. One word in lowercase letters is good. See http-headers. |
Vipps-System-Version | string <= 30 characters Example: 5.4.0 The version number of the ecommerce solution. See http-headers. |
Vipps-System-Plugin-Name | string <= 30 characters Example: woocommerce-payment The name of the ecommerce plugin (if applicable). One word in lowercase letters is good. See http-headers. |
Vipps-System-Plugin-Version | string <= 30 characters Example: 1.2.1 The version number of the ecommerce plugin (if applicable). See http-headers. |
Request Body schema: application/jsonoptional
New CancelModificationRequest
body.
cancelTransactionOnly | boolean Only cancel transaction if it has not been authorized. If this flag is set and the transaction has been authorized, the reserved amount will not be canceled. |
Responses
Request samples
- Payload
{- "cancelTransactionOnly": true
}
Response samples
- 200
- 400
- 404
- 409
{- "amount": {
- "currency": "NOK",
- "value": 49900
}, - "state": "CREATED",
- "aggregate": {
- "authorizedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "cancelledAmount": {
- "currency": "NOK",
- "value": 49900
}, - "capturedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "refundedAmount": {
- "currency": "NOK",
- "value": 49900
}
}, - "pspReference": "3343121302",
- "reference": "acme-shop-123-order123abc"
}
Capture a payment
Capture the given payment
Authorizations:
path Parameters
Reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ Example: acme-shop-123-order123abc The |
header Parameters
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Idempotency-Key required | string <= 50 characters Example: fb492b5e-7907-4d83-ba20-c7fb60ca35de Idempotency key for the request, ensures idempotent actions. See idempotency |
Vipps-System-Name | string <= 30 characters Example: WooCommerce The name of the ecommerce solution. One word in lowercase letters is good. See http-headers. |
Vipps-System-Version | string <= 30 characters Example: 5.4.0 The version number of the ecommerce solution. See http-headers. |
Vipps-System-Plugin-Name | string <= 30 characters Example: woocommerce-payment The name of the ecommerce plugin (if applicable). One word in lowercase letters is good. See http-headers. |
Vipps-System-Plugin-Version | string <= 30 characters Example: 1.2.1 The version number of the ecommerce plugin (if applicable). See http-headers. |
Request Body schema: application/json
Requested capture modification
required | object (Amount) Amount object, containing a | ||||
|
Responses
Request samples
- Payload
{- "modificationAmount": {
- "currency": "NOK",
- "value": 49900
}
}
Response samples
- 200
- 400
- 404
- 409
{- "amount": {
- "currency": "NOK",
- "value": 49900
}, - "state": "CREATED",
- "aggregate": {
- "authorizedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "cancelledAmount": {
- "currency": "NOK",
- "value": 49900
}, - "capturedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "refundedAmount": {
- "currency": "NOK",
- "value": 49900
}
}, - "pspReference": "3343121302",
- "reference": "acme-shop-123-order123abc"
}
Refund a payment
Refund the given payment
Authorizations:
path Parameters
Reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ Example: acme-shop-123-order123abc The |
header Parameters
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Idempotency-Key required | string <= 50 characters Example: fb492b5e-7907-4d83-ba20-c7fb60ca35de Idempotency key for the request, ensures idempotent actions. See idempotency |
Vipps-System-Name | string <= 30 characters Example: WooCommerce The name of the ecommerce solution. One word in lowercase letters is good. See http-headers. |
Vipps-System-Version | string <= 30 characters Example: 5.4.0 The version number of the ecommerce solution. See http-headers. |
Vipps-System-Plugin-Name | string <= 30 characters Example: woocommerce-payment The name of the ecommerce plugin (if applicable). One word in lowercase letters is good. See http-headers. |
Vipps-System-Plugin-Version | string <= 30 characters Example: 1.2.1 The version number of the ecommerce plugin (if applicable). See http-headers. |
Request Body schema: application/json
Requested refund modification
required | object (Amount) Amount object, containing a | ||||
|
Responses
Request samples
- Payload
{- "modificationAmount": {
- "currency": "NOK",
- "value": 49900
}
}
Response samples
- 200
- 400
- 404
- 409
{- "amount": {
- "currency": "NOK",
- "value": 49900
}, - "state": "CREATED",
- "aggregate": {
- "authorizedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "cancelledAmount": {
- "currency": "NOK",
- "value": 49900
}, - "capturedAmount": {
- "currency": "NOK",
- "value": 49900
}, - "refundedAmount": {
- "currency": "NOK",
- "value": 49900
}
}, - "pspReference": "3343121302",
- "reference": "acme-shop-123-order123abc"
}
Force approve a payment
This endpoint is only available in the test environment. It allows developers to approve a payment through the ePayment API without the use of the Vipps or MobilePay app. This is useful for automated testing. Express checkout is not supported for this endpoint. Attempted use in production is not allowed, and will fail. Important: All test users must manually approve at least one payment in the Vipps or MobilePay app before this endpoint can be used for that user.
Authorizations:
path Parameters
Reference required | string (ReferenceType) [ 8 .. 50 ] characters ^[a-zA-Z0-9-]{8,50}$ Example: acme-shop-123-order123abc The |
header Parameters
Merchant-Serial-Number required | string (MSNType) [ 4 .. 7 ] characters ^[0-9]{4,7}$ Example: 1234567 The merchant serial number (MSN) for the sales unit. |
Ocp-Apim-Subscription-Key required | string Example: da7d5b0e18a84aeda961c0c31b75c2a9 The subscription key for a sales unit. See API keys. |
Request Body schema: application/json
Force approve request body
Customer phone number (object) or Personal QR code (object) or Customer token (object) (Customer) The target customer if the identity is known. The customer can be specified either with phone number, the customer token or with the user's personal QR code Specifying more than one of these will result in an error. | |
token | string The token value received in the |
Responses
Request samples
- Payload
{- "customer": {
- "phoneNumber": "4712345678"
}, - "token": "string"
}