Get payment details
To get the current information about a payment, use the
GET:/epayment/v1/payments/{reference}
request. This will return the state of the payment at the current time.
Example request:
curl -X GET https://apitest.vipps.no/epayment/v1/payments/UNIQUE-PAYMENT-REFERENCE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: YOUR-MSN" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-H "Vipps-System-Plugin-Name: acme-webshop" \
-H "Vipps-System-Plugin-Version: 4.5.6"
Response example:
{
"aggregate": {
"authorizedAmount": {
"currency": "NOK",
"value": 49900
},
"cancelledAmount": {
"currency": "NOK",
"value": 49900
},
"capturedAmount": {
"currency": "NOK",
"value": 0
},
"refundedAmount": {
"currency": "NOK",
"value": 0
}
},
"amount": {
"currency": "NOK",
"value": 49900
},
"state": "AUTHORIZED",
"paymentMethod": {
"type": "WALLET"
},
"profile": {},
"pspReference": "37c34d8c-2649-448e-864b-060d5d93e4c4",
"reference": "acme-shop-123-order123abc"
}
Schema:
Payments with profile infoβ
If the merchant includes scope
in the Create payment request,
the profile
object will include a sub
that identifies the customerβonce the customer has authorized the payment.
For example (truncated):
{
"state": "AUTHORIZED",
"profile" : {
"sub": "c06c4afe-d9e1-4c5d-939a-177d752a0944"
}
}
The sub
can then be used to retrieve the user's info with the
Userinfo API:
GET:/userinfo/{sub}
.
The sub
is a unique identifier for a user and relates to their consent to share information.
A user may have more than one sub
for the same merchant, but there can only be one sub
per sales unit (Merchant Serial Number).
You cannot combine the sub
for one MSN and the API keys for a different MSN.
The sub
will not change if a user removes their consents, logs in again, and re-consents.
Please note: There are some special cases where the sub
will change for a user:
- If a user deletes their Vipps MobilePay profile and creates a new one, the
sub
will change.
In the case where the merchant sent metadata
in the
Create payment
request, the response object will contain the same information metadata
that was sent earlier.
For example (truncated):
{
"metadata" : {
"key1" : "value1",
"key2" : 12345
}
}
Polling guidelinesβ
We have added rate limiting to our APIs to increase the stability and security of our APIs. Please see: