How to Use the Merchant Module

The Merchant Module provides endpoints for retrieving information about merchants, including balance details, balance history, and monthly statements. This guide explains each endpoint, its parameters, and how to use them. The Merchant Module offers four endpoints:

  1. Get Merchant's Information: Retrieves detailed information about the merchant.
  2. Get Merchant's Balance Information: Provides current balance information for a specified currency.
  3. Get Merchant's Balance History: Retrieves the balance history for the merchant, filtered by type and currency.
  4. Get Merchant's Monthly Statement in PDF: Provides the merchant's monthly statement in PDF format.

📘

Authentication

All API calls require authentication using an API key and a merchant identifier (GUID). Refer to the Authentication page for more details.

Get Merchant's Information

The Get Merchant's Information endpoint lets you retrieve detailed information about the merchant, including the business name, address, and support contact details. Below, you can see an example of a request and response to this endpoint:

curl --request GET \
     --url "https://merchantapi.testewallet.com/api/v1/merchants" \
     --header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_TOKEN>'
{
  "isSuccess": true,
  "message": "Merchant information retrieved successfully.",
  "statusCode": 200,
  "logIdentifier": "log123456789",
  "data": {
    "merchantID": 12345,
    "merchantName": "Doe Enterprises",
    "merchantAddress": "123 Main St",
    "merchantCity": "New York",
    "merchantState": "NY",
    "merchantZIP": "10001",
    "merchantCountry": "US",
    "eWalletSupportPhoneNumber": "+1-555-555-5555",
    "eWalletSupportEmail": "[email protected]",
    "acceptedCurrenciesList": [
      "USD",
      "EUR",
      "GBP"
    ],
    "eWalletURL": "https://wallet.doeenterprises.com"
  }
}

Get Merchant's Balance Information

The Get Merchant's Balance Information endpoint provides the merchant's current balance information in a specified currency. The response includes available balance and holds balance details. You can use this to track the available balance in your merchant account. Below, you can see an example of a request and response to this endpoint:

curl --request GET \
     --url "https://merchantapi.testewallet.com/api/v1/merchants/balances/<CURRENCY_CODE>" \
     --header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_TOKEN>'
{
  "isSuccess": true,
  "message": "Merchant balance information retrieved successfully.",
  "statusCode": 200,
  "logIdentifier": "log987654321",
  "merchant_balance": [
    {
      "balance_type": "current",
      "balance": {
        "available_balance": 9500.00,
        "hold_balance": 500.00
      }
    }
  ]
}

Get Merchant's Balance History

The Get Merchant's Balance History endpoint allows you to retrieve the balance history for a merchant, filtered by type and currency. It provides detailed records of transactions, including amounts, balances, and related information, helpful in analyzing financial activity over time. The available types to search for are:

Type ValuesDescription
1eWallet Invoice Balance
2Funding Return Balance
3Public Invoice Balance
4Instant Bank Transfer Balance
5eWallet Balance

Below, you can see an example of a request and response to this endpoint:

curl --request GET \
     --url "https://merchantapi.testewallet.com/api/v1/merchants/balance-histories/<TYPE>/<CURRENCY_CODE>" \
     --header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_TOKEN>'
{
  "isSuccess": true,
  "message": "Merchant balance history retrieved successfully.",
  "statusCode": 200,
  "logIdentifier": "log123456789",
  "data": {
    "totalCount": 100,
    "pageNumber": 1,
    "pageSize": 10,
    "pageCount": 10,
    "merchantHistory": [
      {
        "amount": 500.00,
        "balance": 9500.00,
        "balanceType": "current",
        "comments": "Deposit made",
        "currency": "USD",
        "date": "2024-08-16T18:30:49.806Z",
        "holdAmount": 0,
        "holdBalance": 0,
        "holdExpirationDate": null,
        "holdReleasedDate": null,
        "entity": "Doe Enterprises",
        "fee": 5.00,
        "isDebited": false,
        "isHoldReleased": false,
        "runningBalance": 10000.00,
        "status": "Completed",
        "transactionID": 987654321,
        "transactionType": "Deposit",
        "userName": "johndoe",
        "recordID": 123456789,
        "transactionGUID": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      }
    ]
  }
}

Get Merchant's Monthly Statement in PDF

The Get Merchant's Monthly Statement in PDF endpoint provides the merchant's monthly statement in PDF format, filtered by the specified year, month, and currency. It is useful for financial reporting and record-keeping. Below, you can see an example of a request and response to this endpoint:

curl --request GET \
     --url "https://merchantapi.testewallet.com/api/v1/merchants/statements/<YEAR>/<MONTH>/<CURRENCY_CODE>" \
     --header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
     --header 'accept: application/pdf' \
     --header 'authorization: Bearer <YOUR_TOKEN>'
PDF File