> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an access token for Checkout SDK features

> Generate an access token to initialize the Checkout SDK to provide PayPal One-Click

This endpoint allows you to obtain an access token that you can use to initialize [Checkout SDK](/sdks/checkout/web).

This access token is only required for the following features using Checkout SDK:

* [PayPal One-Click](/sdks/checkout/web#configuring-paypal-one-click-payments)

You do not need an access token if using Checkout SDK to service other payment methods or PayPal without PayPal One-Click.

A single access token can be used to service the experience to one user and has a lifespan of 15 minutes. You need to provide the `UserId` of the Natural User or Legal User who will use the Checkout session to make the payment.

### Body parameters

<ParamField body="clientId" type="string" required>
  Your Mangopay Client ID.
</ParamField>

<ParamField body="claims" type="object" required>
  <Expandable defaultOpen>
    <ParamField body="userId" type="string">
      Unique identifier of the Natural User or Legal User using the Checkout SDK session to make a payment.
    </ParamField>
  </Expandable>
</ParamField>

### Responses

<Accordion>
  <ResponseField name="access_token" type="string">
    The access token value to use as the `clientToken` value when initializing Checkout SDK.
  </ResponseField>

  <ResponseField name="token_type" type="string">
    The type of the token (always Bearer).
  </ResponseField>

  <ResponseField name="expires_in" type="integer">
    The number of seconds until the token expires.
  </ResponseField>

  <ResponseField name="scope" type="string">
    The API permission scopes of the token, in this case to read and write a Checkout session.
  </ResponseField>
</Accordion>

<RequestExample>
  ```bash theme={null}
  curl -X POST 'https://api.sandbox.mangopay.com/v2.01/oauth/token/embedded/checkout' \
       -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer ab08691f2ef34733a8451ed3742d4204' \
       -d '{
      "clientId": "your-mangopay-client-id",
      "claims": {
          "userId": "user_m_01JP2X1PK52W8PYD99Q3CXDMAP"
      }
  }'  
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
      "access_token": "chk_019bb6d3e14d723dada740a0d8d9ba17",
      "token_type": "Bearer",
      "expires_in": 900,
      "scope": "checkout.session:r checkout.session:w"
  }
  ```
</ResponseExample>
