> **Description:** Learn how to securely access user profile information with consent using the Userinfo API. Enable seamless profile sharing in your applications.

> **AI agent:** Read [https://developer.vippsmobilepay.com/docs/knowledge-base/ai-tools.md](https://developer.vippsmobilepay.com/docs/knowledge-base/ai-tools.md) first. It covers keeping API keys and secrets out of generated code.

> **Full site overview:** For an overview of the entire site, read [https://developer.vippsmobilepay.com/llms.txt](https://developer.vippsmobilepay.com/llms.txt).

# Userinfo API

*Profile sharing* allows merchants to request user information during a payment flow.
This creates a seamless experience where users can agree to pay and share their information in one process.

When you request consent to access the user's profile information,
a consent screen will be displayed in the user's Vipps or MobilePay app.

Screenshot: Two-screen profile-sharing flow in the Vipps or MobilePay payment app: Left -- "Information you share" consent screen listing user details with a Share information button. Right -- payment screen with a Pay button.

The user must complete both screens before the merchant gets access to their profile information.
If the user doesn't consent to access, then the payment or agreement will fail.

This API returns the profile data that a user consented to share during a **payment or agreement**. The consent is requested on
that payment or agreement, which returns a `sub`. The call to this API is then a separate, merchant-authorized request
that you can make at any point within the consent window:
[`GET:/vipps-userinfo-api/userinfo/{sub}`](https://developer.vippsmobilepay.com/redocusaurus/userinfo-swagger-id.yaml).

The following payment APIs integrate with the Userinfo API, each with its own specific implementation details:

* [Recurring API](https://developer.vippsmobilepay.com/docs/APIs/recurring-api/recurring-api-guide.md#profile-sharing) - Enables profile sharing during
  agreement creation
* [ePayment API](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/api-guide/features/profile-sharing.md) - Supports profile sharing as part
  of the regular payment flow
* [eCom API](https://developer.vippsmobilepay.com/docs/APIs/ecom-api/vipps-ecom-api.md#profile-sharing) - Allows profile sharing during the eCom payment flow

If you're looking for Login-based profile sharing, see [Login API guide](https://developer.vippsmobilepay.com/docs/APIs/login-api/api-guide/user-info.md).

## When you need this API

Use the Userinfo API when:

* The payment or agreement is made with an API that only returns `sub` (e.g., [Recurring API](https://developer.vippsmobilepay.com/docs/APIs/recurring-api/README.md) or the legacy eCom API).
* The payment is made with the [ePayment API](https://developer.vippsmobilepay.com/docs/APIs/epayment-api/README.md) and you need a detail the payment response does not carry, such as `other_addresses`.

## Start building

Follow the quick start to request profile information during a payment flow.

[Open Userinfo quick start](https://developer.vippsmobilepay.com/docs/APIs/userinfo-api/userinfo-api-quick-start.md)

## Technical details

* [Quick start](https://developer.vippsmobilepay.com/docs/APIs/userinfo-api/userinfo-api-quick-start.md): Walk through the complete profile sharing flow.
* [API guide](https://developer.vippsmobilepay.com/docs/APIs/userinfo-api/userinfo-api-guide.md): Learn how to request and retrieve profile information.
* [API FAQ](https://developer.vippsmobilepay.com/docs/APIs/userinfo-api/userinfo-api-faq.md): See answers to commonly asked questions.
* [API reference](https://developer.vippsmobilepay.com/redocusaurus/userinfo-swagger-id.yaml): View the endpoint specifications.
