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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.dintero.com/feedback

```json
{
  "path": "/docs/partners/partners-merchant-api-access",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Get API access to a merchant account

> Exchange a partner exchange-token for a Dintero merchant access token so you can call APIs on behalf of one of your merchants under your partner account.

# Partner API

This documentation covers how a partner of Dintero can use the API to get access to their merchants.

## Merchant account API access

To access the API on behalf of a merchant, you must first obtain an access token.
To do this, you will use the exchange token endpoint to exchange the exchange token
for a merchant access token.

### Step 1: Authenticate as a partner

To authenticate, you create an API client and use the credentials to Create an access token. [Create an access token].

[Create an access token]: /docs/checkout/authentication

### Step 2: Obtain exchange token

Using the `access_token` from **step 1** do a request to the [Exchange Token] endpoint.

[Exchange Token]: https://docs.dintero.com/management-auth-api.html#operation/aid_auths_oauth_exchange_token_post

```json theme={null}
POST https://api.dintero.com/v1/accounts/{partner_id}/auth/exchange_token

Authorization: Bearer {access_token}
Content-Type: application/json

{
    account_id: {merchant_account_id}
}
```

The server will respond with an exchange access token.

```json theme={null}
{
    "access_token": "eyJhbGci...t7P4",
    "token_type": "Bearer",
    "expires_in": 86400,
    "refresh_token": "string"
}
```

### Step 3: Exchange the exchange token for a merchant access token

Using the `access_token` from **step 2** do a request to the [Get Token] endpoint.

[Get Token]: https://docs.dintero.com/management-auth-api.html#operation/aid_auths_oauth_token_post

```json theme={null}
POST https://api.dintero.com/v1/accounts/{merchant_account_id}/auth/token

Authorization: Bearer {access_token}
Content-Type: application/json

{
    "grant_type": "client_credentials",
    "audience":"https://api.dintero.com/v1/accounts/{partner_account_id}"
}
```

The server will respond with a merchant access token.

```json theme={null}
{
    "access_token": "eyJhbGci...d5F1",
    "token_type": "Bearer",
    "expires_in": 86400,
    "refresh_token": "string"
}
```
