> ## 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/manage-merchants-via-api",
  "feedback": "Description of the issue"
}
```

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

</AgentInstructions>

# Manage a merchant account via API

> Manage a merchant account on behalf of a Dintero partner — call the API with an exchanged merchant access token to view settings, users, and configuration.

# Partner API

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

## Managing a merchant account

You will need to include the access token obtained through the authorization flow in described in \[Getting API access to a merchant account] and use the `access_token` as the Authorization header of your request.
\[Merchant account API access]: /docs/partners/partners-merchant-api-access

### Get the account details

Retrieve details about the merchant, this response also includes the optional `applicant.signup_reference` that was used during the merchant onboarding.

* [Get Account settings API reference](https://docs.dintero.com/management-auth-api.html#operation/aid_account_aid_get)

### Creating API clients and grants

Creating a new API client is a two step process where you first create an API client, and then delegate grants to the client

#### 1. Create the API client

* [Create Client API reference](https://docs.dintero.com/management-auth-api.html#operation/aid_auth_clients_post)

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

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

{
  "name": "API client for e-commerce",
  "description": "Created by partner",
  "client_id": "ecom-123",
}
```

Response example

```json theme={null}
{
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "API client for e-commerce",
    "description": "Created by partner",
    "client_id": "ecom-123",
    "client_secret": "JYCRP/x7iBGWA1fun0J9laH5sEg5cP9g/4QivhfGzm4",
    ...
}
```

#### 2. Create client grants

* [Create client grant API reference](https://docs.dintero.com/management-auth-api.html#operation/aid_auth_clients_post)

Note that the `client_id` in this request is the `id` returned in the first step.

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

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

{
    "client_id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "audience": "https://api.dintero.com/v1/accounts/{merchant_account_id}",
    "scope": [
        "checkout:admin"
    ],
    "type": "client_credentials"
}
```

### Managing payment profiles

* [Create a new payment profile API reference](https://docs.dintero.com/checkout-api.html#operation/admin_session_profile_post)
* [List payment profiles API reference](https://docs.dintero.com/checkout-api.html#operation/admin_session_profile_get)
* [Update a payment profile API reference](https://docs.dintero.com/checkout-api.html#operation/admin_session_profile_details_put)

### Reports

A Dintero merchant can have two types of reports, *Settlement Reports* and scheduled custom *Insight Reports*.

#### Settlement reports

Settlement reports are created when the settlements are paid out by the payment processors eg, Dintero Payout, Vipps, Swedbank Pay, Bambora, Walley and Klarna. See [our payouts guide](https://www.dintero.com/payouts) our for when to expect a settlement after a transaction is captured.

Each item in the [List settlements](https://docs.dintero.com/billing-api.html#operation/aid_settlements_list) can contain multiple attachments, both the source files from the payment processor and the normalized Dintero settlement reports. You can be notified when a settlement is added by creating a webhook subscription with the `settlement_add` event.

* [Settlement Reports API reference](https://docs.dintero.com/billing-api.html#tag/settlements)
* [Subscribe to webhooks API reference](https://docs.dintero.com/webhooks-api.html#operation/aid_source_hooks_post)

#### Insight reports

The insight reports are created from transaction data and they do not contain any settlement information, but they can be
useful for other purposes. Insight reports are created automatically at *scheduled intervals* eg. `weekly` or `monthly`.

* [Create new insight report configuration API reference](https://docs.dintero.com/insight-api.html#operation/aid_report_configuration_post)
* [List insight reports API reference](https://docs.dintero.com/reports-api.html#operation/api_reports_metadata_list_get)
