---
updatedAt: 2026-09-29T09:32:24.000Z
agentTools:
  projectIndex: https://developer.i-payout.com/llms.txt
---

# Get a Token

To use the i-payout APIs' endpoints, you must employ a token. The tokens you create have an expiration date and become invalid once it date arrives. You can create a token via API or the i-payout dashboard.

i-payout has two separate environments, each with its own admin portal and API base URL. Credentials from one environment will not work in the other. Make sure you are using the correct URLs for your target environment.

|                  | Sandbox                                                 | Production                                        |
| ---------------- | ------------------------------------------------------- | ------------------------------------------------- |
| **Admin Portal** | [admin.testewallet.net](https://admin.testewallet.com/) | [admin.i-payout.net](https://admin.i-payout.com/) |
| **API Base URL** | `https://merchantapi.testewallet.com/api/v1`            | `https://merchantapi.i-payout.com/api/v1`         |

The examples on this page use sandbox URLs. Replace `testewallet.com` with `i-payout.com` when working with your production account.

<Callout icon="🚧" theme="warn">
  ### **Multi-Factor Authentication**

  To create a token, you must have MFA enabled in your account. Please check the [Enable Multi-Factor Authentication](https://developer.i-payout.com/docs/how-to-complete-your-account-setup#enable-multi-factor-authentication) guide for step-by-step instructions on how to do it.
</Callout>

## Obtain a Token through the API

You can obtain a token through an API call at the [Get API Token](https://developer.i-payout.com/reference/get-api-token) endpoint. You will need your **username** and **password**, which can be found in the Admin Portal. Follow these steps to create your token through the API:

1. Log in to the [Admin Portal](https://admin.testewallet.com/).
2. At the top-left corner, under the **System** tab, select the **Merchant API Setup** option.

<Image src="https://files.readme.io/d82e30b-01_MerchantAPI.png" align="center" width="500px" />

3. This page contains your **username** and **password**, which you will need to generate your token with the API. To display your full password, enter the MFA code and click "Display Password".

<Image src="https://files.readme.io/e902049-02_api_credentials.png" align="center" width="500px" />

4. The endpoint will require you to send your credentials encoded in [base64](https://www.base64encode.org/). The code below exemplifies how to encode it, replacing `username` and `password` with your credentials from the step above:

```curl
echo -n '<username>:<password>' | base64
```

5. After encoding it, call the [Get API Token](https://developer.i-payout.com/reference/get-api-token) endpoint, adding the **authorization** header with your encoded string as its value, as shown below:

<br />

```curl
curl --request GET \
     --url https://merchantapi.testewallet.com/api/v1/authentication/login \
     --header 'accept: application/json' \
     --header 'authorization: Basic <ENCODED_STRING>'
```

<Callout icon="📘" theme="info">
  ### **Production URL**

  For production, replace the URL above with:
  `https://merchantapi.i-payout.com/api/v1/authentication/login`
</Callout>

This call will return a JSON response with your newly created token inside the data object. Below is an example of this response:

```json
{
  "isSuccess": true,
  "message": "Success",
  "statusCode": 0,
  "logIdentifier": "123456789",
  "data": {
    "merchantId": "merchant123",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c2VyMTIzNDU2IiwiaWF0IjoxNjI2NzU2OTY0LCJleHAiOjE2MjY4NDMzNjR9.NV09P4GF1BD_cY9nMDrz9T39hNl4F2z3QlIM2XyZ8WA",
    "expireInMinutes": 1440
  }
}

```

<Callout icon="🚧" theme="warn">
  ### Expiration date

  The token created through the API endpoint expires every 24 hours.
</Callout>

Once generated, you can use your token to call the i-payout API.

## Obtain a Token through the i-payout Admin Portal

You can obtain a token through the dashboard and **Merchant API Setup** by following the steps below:

1. Log in to the [Admin Portal](https://admin.testewallet.com/).
2. On the homepage, click the **System** menu.

<Image src="https://files.readme.io/41f4f25-04_system_cropped.png" align="center" width="500px" />

3. Select **Merchant API Setup**.

<Image src="https://files.readme.io/d049d3b-05_Merchant_API_Setup_cropped.png" align="center" width="500px" />

4. Select **Token Generation**.

<Image src="https://files.readme.io/394b8be-03_token_generation.png" align="center" width="500px" />

5. Fill in the **Token Name**, **Expiry Date**, and your **MFA Code**.

<Image src="https://files.readme.io/42a9edb-04_token_infos.png" align="center" width="500px" />

<Callout icon="📘" theme="info">
  ### Expiry date

  Tokens are valid until the expiration date you set when creating them. When they expire, you must generate a new token to keep using i-payout's functionalities.
</Callout>

5. Click the **Generate** button.

<Image src="https://files.readme.io/193bbc7-05_generate.png" align="center" width="500px" />

<Callout icon="📘" theme="info">
  ### API key

  Once you have the generated API key, it should be included in the Authorization header using the Bearer scheme for API calls. To complete the request, you need a `merchantID`.
</Callout>

## Using your API Token

Once created, the token will grant you access to the i-payout API. Below is an example of how to use your token to authenticate your API calls:

```bash
curl --request <Method> \
     --url <endpoint_url> \
     --header 'Authorization: Bearer <YOUR_API_TOKEN>' \
     --header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
     --header 'accept: application/json' \
     --header 'content-type: application/*+json'
```

Replace the following placeholders:

* `<Method>`: The HTTP method you want to use for the request, such as `GET`, `POST`, `PUT`, etc.
* `<endpoint_url>`: The URL of the specific endpoint you are trying to access.
* `<YOUR_API_TOKEN>`: The token you received from the Get API Token endpoint.
* `<YOUR_MERCHANT_ID>`: Your unique merchant identifier provided by i-payout.

## What's next?

Read the [i-payout Concepts](https://developer.i-payout.com/docs/i-payout-concepts) page to familiarize yourself with the basic concepts needed to use i-payout.