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.

🚧

Multi-Factor Authentication

To create a token, you must have MFA enabled in your account. Please check the Enable Multi-Factor Authentication guide for step-by-step instructions on how to do it.

Obtain a Token through the API

You can obtain a token through an API call at the 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.
  2. At the top-left corner, under the System tab, select the Merchant API Setup option.
  1. 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".
  1. The endpoint will require you to send your credentials encoded in base64. The code below exemplifies how to encode it, replacing username and password with your credentials from the step above:
echo -n '<username>:<password>' | base64
  1. After encoding it, call the Get API Token endpoint, adding the authorization header with your encoded string as its value, as shown below:
curl --request GET \
     --url https://merchantapi.testewallet.com/api/v1/authentication/login \
     --header 'accept: application/json' \
     --header 'authorization: Basic <ENCODED_STRING>'

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

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

🚧

Expiration date

The token created through the API endpoint expires every 24 hours.

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.
  2. On the homepage, click the System menu.
  1. Select Merchant API Setup.
  1. Select Token Generation.
  1. Fill in the Token Name, Expiry Date, and your MFA Code.

📘

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.

  1. Click the Generate button.

📘

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.

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:

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 page to familiarize yourself with the basic concepts needed to use i-payout.