Skip to main content

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:

required
object (Aggregate)
required
object (Amount)

Amount object, containing a value and a currency.

state
required
string (State)
Enum: "CREATED" "ABORTED" "EXPIRED" "AUTHORIZED" "TERMINATED"

The state of the Payment. One of:

  • CREATED: The user has not yet acted upon the payment. Example: The user has received a push message, but not yet opened it.
  • ABORTED: The user has aborted the payment before authorization. This is a final state. Example: The user cancelled instead of accepting the payment.
  • EXPIRED: The user did not act on the payment within the payment expiration time. This is a final state. Example: The user received a push message, but did nothing before the payment request timed out.
  • AUTHORIZED: The user has approved the payment. This is a final state. Example: A payment that has been refunded may have one or more refund events, but the state would be AUTHORIZED.
  • TERMINATED: The merchant has terminated the payment via the cancelPayment endpoint. This is a final state. Example: The merchant was not able to provide the product or service, and has cancelled the payment.
required
object (PaymentMethodResponse)
required
object (Profile)
pspReference
required
string (PspReference)

Each payment operation (i.e., create, capture, refund, cancel) will have a unique pspReference, defined by Vipps MobilePay. One of:

  • The Get event log response contains each event and its unique pspReference value.
  • The Get payment response contains the pspReference for the payment creation event.
  • The Adjustment response, returned by Cancel, Capture, and Refund requests, contains the pspReference for the payment creation event.
redirectUrl
string <uri>

The URL you should redirect the user to to continue with the payment. This is the URL to the Vipps MobilePay landing page. See: https://developer.vippsmobilepay.com/docs/knowledge-base/landing-page/

reference
required
string (ReferenceType) [ 8 .. 64 ] characters ^[a-zA-Z0-9-]{8,64}$

The reference is the unique identifier for the payment, specified when initiating the payment. The reference must be unique for the sales unit (MSN), but is not globally unique, so several MSNs may use the same reference. See the recommendations.

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 GetPaymentResponse object. Key length is limited to 100 characters, and value length is limited to 500 characters. Max capacity is 5 key-value pairs.

object (Shipping Details)

Shipping details for the order.

object (User Details)

User details for the payment (Express only).

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}.

note

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:

Help us improve our documentation

Did you find what you were looking for?