Profile sharing
The ePayment API enables merchants to request the user's profile information (such as phone number or
email address) as part of the payment flow. We call this the userinfo
flow.
- Vipps
- MobilePay
Create a payment with a profile sharing request
Remember to have a fresh access token, see
Set up and Authorize.
Then, call the POST:/epayment/v1/payments
with profile
.
For example:
curl -X POST https://apitest.vipps.no/epayment/v1/payments \
-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 'Idempotency-Key: YOUR-IDEMPOTENCY-KEY' \
-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" \
-d '{
"amount": {
"value": 49900,
"currency": "NOK"
},
"paymentMethod": {
"type": "WALLET"
},
"customer": {
"phoneNumber": 4712345678
},
"reference": UNIQUE-PAYMENT-REFERENCE,
"userFlow": "WEB_REDIRECT",
"returnUrl": "https://example.com/redirect?reference=UNIQUE-PAYMENT-REFERENCE",
"paymentDescription": "Purchase of socks",
"profile": {
"scope": "name phoneNumber address birthDate"
}
}'
The scope
determines what information the user is asked to share.
The scope
can include any of the values, separated by a space:
Scope | Description | User consent required |
---|---|---|
address | A list containing the user's addresses. | yes |
birthDate | Birth date. Verified with BankID. ISO 8601 format (2022-12-31) | yes |
email | Email address. The flag email_verified : true (or false ) in the response indicates whether the email address is verified. | yes |
name | First, middle and given name. Verified with the National Population Register. | yes |
phoneNumber | Phone number. Verified when creating the Vipps ![]() ![]() | yes |
gender | Gender. User chosen gender with options: male , female , other or prefer not to say . This scope is only supported through the Login API currently. | yes |
nin | National Identity Number (NIN) (verified with National Population Register). Note, merchants need to apply for access to NIN. See Who can get access to NIN and how. | yes |
Examples:
phoneNumber
email
name address email
name phoneNumber
name birthDate
name email nin
Profile sharing call-by-call guide
Scenario: You want to complete a payment and get the name and phone number of a customer. Details about each step are described in the sections below.
- Retrieve the access token.
- Add scope to the transaction object and include the scope you wish to get access to (valid scope) before calling. Include the scopes you need access to (e.g., "name address email phoneNumber birthDate"), separated by spaces.
- The user consents to the information sharing and perform the payment in the Vipps
or MobilePay
app.
- Retrieve the
sub
by callingGET:/epayment/v1/payments/{reference}
- Using the
sub
from step 4, callGET:/vipps-userinfo-api/userinfo/{sub}
to retrieve the user's information.
For more details, see the Userinfo quick start guide.