Guides

API documentation

Connect the ezGate gateway to your website

ezGate gateway integration guide

Part 1

Get accepted currencies and networks

In this part you fetch the currencies and networks enabled for your site’s gateway.

Before you can accept payments on your site, you need the currencies and networks your customers are allowed to pay with.

You already chose those options in the dashboard, on the Gateway page, for that gateway. This API returns the same configuration.

  1. 1

    Copy the ApiKey from the dashboard

    Sign in to the ezGate dashboard and open the Gateway page. Copy the ApiKey of the gateway you want to connect.

    Keep this key secret. Call the API from your own server when you can, so the key never appears in your customer’s browser.

  2. 2

    Fetch the currency and network list

    Send a GET request to the URL below and pass the ApiKey as a query parameter.

    The response is an array of currencies. Each currency lists its enabled networks in networkDetails. Show these options on your checkout page.

GEThttps://api.ezgate.org/api/PortalWallet/GetPortalCurrenciesByToken
Python example
import requests

API_KEY = "YOUR_API_KEY"
url = "https://api.ezgate.org/api/PortalWallet/GetPortalCurrenciesByToken"

response = requests.get(
    url,
    params={"ApiKey": API_KEY},
    headers={"accept": "*/*"},
)
payload = response.json()

if payload.get("statusCode") != 200:
    raise RuntimeError(payload.get("message") or "Could not load currencies")

currencies = payload.get("data") or []
Response example
{
  "statusCode": 200,
  "message": "عملیات با موفقیت انجام شد",
  "errors": null,
  "data": [
    {
      "currencyId": 1,
      "currencySymbol": "USDT",
      "currencyTitle": "Tether",
      "currencyPersianName": "تتر",
      "currencyLogoUrl": "https://chante.app/images2/USDT.png",
      "decimals": 2,
      "buyPriceIncreasePercent": 0,
      "sellPriceIncreasePercent": 0,
      "hasMemo": false,
      "networkDetails": [
        {
          "id": 15,
          "name": "ترون TRX (TRC-20)",
          "symbol": "TRX",
          "networkFee": 4
        },
        {
          "id": 19,
          "name": "بایننس اسمارت چین BSC (BEP20)",
          "symbol": "BNB",
          "networkFee": 2
        }
      ]
    }
  ],
  "count": 1
}

Currency fields

NameTypeDescription
currencyIdnumberCurrency id
currencySymbolstringCurrency symbol, e.g. USDT
currencyTitlestringEnglish currency name
currencyPersianNamestringPersian currency name
currencyLogoUrlstringCurrency logo URL
decimalsnumberAllowed decimal places for the amount
buyPriceIncreasePercentnumberBuy-price markup percent set in the dashboard
sellPriceIncreasePercentnumberSell-price markup percent set in the dashboard
hasMemobooleanIf true, the network requires a memo or destination tag
networkDetailsarrayNetworks enabled for this currency on your gateway

Network fields (networkDetails)

NameTypeDescription
idnumberNetwork id; this is networkId in the next step
namestringDisplay name of the network
symbolstringNetwork symbol, e.g. TRX or BNB
networkFeenumberNetwork fee

Part 2

Create an order and send your customer to pay

In this part you create the order and redirect your customer to the payment page.

Once your customer has chosen a currency and network, create the order with a POST request.

Send the access token in the Authorization header as Bearer. Also include that gateway’s ApiKey in the request body.

  1. 1

    Prepare the request fields

    amount is the exact cryptocurrency amount your customer must pay — not a fiat amount.

    Take currencyId and networkId from the previous API (currencyId on each currency, and id inside networkDetails).

    Copy apiKey from the dashboard, on the Gateway page.

  2. 2

    Generate a unique refNumber

    refNumber is your order id at ezGate and must not be reused. Sending a duplicate value will fail order creation.

    A UUID is the simplest unique value. You can prefix it with your internal order id so you can match it later in your own books.

  3. 3

    Redirect your customer to paymentUrl

    On success, paymentUrl is the field that matters. Redirect your customer to that link; the ezGate payment page handles the rest.

    After payment or expiry, order status is sent as a callback to the URL you configured in the dashboard, on the Gateway page, in the gateway details.

POSThttps://api.ezgate.org/api/Order

Generate a unique refNumber

Create the refNumber before you call the API, and store it next to your own order so you can match the callback later.

Python example
import uuid

# Recommended: UUID hex is unique without a central counter
ref_number = uuid.uuid4().hex
# e.g. "3f1a9c0e8b4d47c2a6f5d1e0c9b8a7d6"

# Or prefix it with your own internal order id
internal_id = 1842
ref_number = f"{internal_id}-{uuid.uuid4().hex[:12]}"
# e.g. "1842-9c0e8b4d47c2"

# Never send the same refNumber twice to ezGate
Python example
import uuid
import requests

ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
API_KEY = "YOUR_API_KEY"
url = "https://api.ezgate.org/api/Order"

ref_number = uuid.uuid4().hex

response = requests.post(
    url,
    headers={
        "accept": "*/*",
        "Authorization": f"Bearer {ACCESS_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "amount": 1,
        "refNumber": ref_number,
        "currencyId": 1,
        "networkId": 19,
        "apiKey": API_KEY,
    },
)
payload = response.json()

if payload.get("statusCode") != 200:
    raise RuntimeError(payload.get("message") or "Could not create order")

order = payload["data"]
payment_url = order["paymentUrl"]
# Redirect your customer to payment_url
Response example
{
  "statusCode": 200,
  "message": "عملیات با موفقیت انجام شد",
  "errors": null,
  "data": {
    "orderId": "a0d38e98-5738-4329-8c46-a1c2096e70bf",
    "refNumber": "testtest",
    "currency": {
      "symbol": "USDT",
      "persianName": "تتر",
      "name": "USDT",
      "id": 2
    },
    "walletAddress": "0x4584b610A34c9898d52d4E571f8708740993fE1C",
    "paymentUrl": "https://ezgate.org/pay/a0d38e98-5738-4329-8c46-a1c2096e70bf",
    "expiresAt": "2026-08-18T11:30:45.8066667"
  },
  "count": 1
}

Request body

NameTypeDescription
amountnumberExact crypto amount your customer must pay
refNumberstringUnique order reference; must not be reused
currencyIdnumberFrom the previous API; the currencyId field
networkIdnumberFrom the previous API; id inside networkDetails
apiKeystringGateway ApiKey from the dashboard Gateway page

Response data fields

NameTypeDescription
orderIdstringezGate order id
refNumberstringThe value you sent
currencyobjectCurrency details for the order
walletAddressstringDeposit address for this order
paymentUrlstringCheckout URL; redirect your customer here
expiresAtstringWhen the order expires

Send the Authorization header as Bearer YOUR_ACCESS_TOKEN.

Payment result is delivered as a callback to the URL you saved in the gateway details (Gateway page). You do not need to wait after the redirect; the callback tells your server the outcome.