Guides

API documentation

Connect the ezGate gateway to your website

ezGate gateway integration guide

Part 1

Sign up and create your ezGate account

In this part you create your account and enter your business details.

The first step to connecting the gateway is creating your ezGate account. Open the sign-up page and enter your business details.

  1. 1

    Sign up

    Go to the ezGate sign-up page and enter your email and password. After confirming your email, you land in the dashboard.

    Fill in your gateway details (store name, callback URL, etc.) so the gateway is ready to accept payments.

ezGate performs no identity verification (KYC) and you do not need to submit any documents.

ezGate serves all countries and nationalities.

Part 2

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 gateway 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 ApiKey secret. Call the API from your own server when you can, so it never appears in your customer’s browser.

  2. 2

    Fetch the currency and network list

    Send a GET request to the URL below and replace {apiKey} at the end of the URL path. No Authorization header or ApiKey parameter is needed.

    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/{apiKey}
Python example
import requests

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

response = requests.get(url, 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": "success",
  "errors": null,
  "data": [
    {
      "currencyId": 3,
      "currencySymbol": "BTC",
      "currencyTitle": "Bitcoin",
      "currencyLogoUrl": "https://chante.app/images2/BTC.png",
      "decimals": 6,
      "hasMemo": false,
      "networkDetails": [
        {
          "id": 16,
          "name": "BTC",
          "symbol": "BTC",
          "networkFee": 0.004
        }
      ]
    },
    {
      "currencyId": 1,
      "currencySymbol": "USDT",
      "currencyTitle": "Tether",
      "currencyLogoUrl": "https://chante.app/images2/USDT.png",
      "decimals": 2,
      "hasMemo": false,
      "networkDetails": [
        {
          "id": 19,
          "name": "BSC (BEP20)",
          "symbol": "BNB",
          "networkFee": 2
        }
      ]
    }
  ],
  "count": 2
}

Currency fields

NameTypeDescription
currencyIdnumberCurrency id
currencySymbolstringCurrency symbol, e.g. USDT
currencyTitlestringEnglish currency name
currencyLogoUrlstringCurrency logo URL
decimalsnumberAllowed decimal places for the amount
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 3

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.

Place the gateway ApiKey in the URL path, replacing {apiKey}. No Authorization header or apiKey in the body is needed.

  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 the gateway ApiKey from the dashboard, on the Gateway page, and put it in place of {apiKey} at the end of the URL.

  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.

    You can use your own site’s order id directly; there is no need to generate a separate value. Just make sure it is unique per order.

  3. 3

    Send your domain in the Origin header

    The CreateOrder request must send your site’s domain in the Origin header (and in Referer when possible); without it the request is rejected.

    The domain you send must match the domain of the callback URL registered in the dashboard (Gateway page, gateway details) exactly. For example, if your callback URL is https://back.yourdomain.ir/app/v1/crypto/verify-payment, Origin must be https://back.yourdomain.ir — otherwise the request fails with an error.

    So you send the same origin you registered for the callback in the CreateOrder request as well. Set this header on your server, not in the customer’s browser.

  4. 4

    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/CreateOrder/{apiKey}

Generate a unique refNumber

The simplest approach is to set refNumber to your own site’s order id so you can match the callback later. If you do not have such an id, use a UUID.

Python example
import uuid

# Option 1: reuse your own order id from your site
ref_number = "YOUR_ORDER_ID"
# e.g. "ORD-1842" or "10000231"

# Option 2: generate a random unique value (UUID hex)
ref_number = uuid.uuid4().hex
# e.g. "3f1a9c0e8b4d47c2a6f5d1e0c9b8a7d6"

# Never send the same refNumber twice to ezGate

Create order code sample

Python example
import uuid
import requests

API_KEY = "YOUR_API_KEY"
url = f"https://api.ezgate.org/api/Order/CreateOrder/{API_KEY}"

ref_number = uuid.uuid4().hex

# Origin must match the domain of your registered callback URL
# e.g. callback https://back.yourdomain.ir/app/v1/crypto/verify-payment
#      Origin   https://back.yourdomain.ir
ORIGIN = "https://back.yourdomain.ir"

response = requests.post(
    url,
    headers={
        "accept": "*/*",
        "Content-Type": "application/json",
        "Origin": ORIGIN,
        "Referer": f"{ORIGIN}/",
    },
    json={
        "amount": 1,
        "refNumber": ref_number,
        "currencyId": 1,
        "networkId": 19,
    },
)
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": "success",
  "errors": null,
  "data": {
    "orderId": "55ebaf2b-04b4-415e-8b45-797c913c9a45",
    "refNumber": "test",
    "currency": {
      "symbol": "USDT",
      "persianName": "",
      "name": "Tether",
      "id": 1
    },
    "walletAddress": "0x4584b610A34c9898d52d4E571f8708740993fE1C",
    "paymentUrl": "https://ezgate.org/pay/55ebaf2b-04b4-415e-8b45-797c913c9a45",
    "expiresAt": "2026-08-27T15:36:13.89"
  },
  "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

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

You calculate and set the conversion rate to any cryptocurrency yourself; ezGate simply collects the crypto amount you announced from the customer.

Put the gateway ApiKey in place of {apiKey} at the end of the URL path; no Authorization header or apiKey in the body is needed.

In every request — including CreateOrder — send your site’s domain in the Origin (or Referer) header and make sure it matches the domain of the registered callback URL. Example: callback is https://back.yourdomain.ir/app/v1/crypto/verify-payment, so Origin must be https://back.yourdomain.ir. If Origin differs from the callback domain, the request fails with an error.

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.

Request security: ezGate compares the request origin domain with your gateway's callback URL domain. If you send an Origin or Referer header, its domain must match your registered callback domain, otherwise the request fails with “Site origin does not match the site callback”. Server-to-server requests that do not send Origin/Referer are processed without this check.

Part 4

Receive the payment result via callback

In this part you learn the callback URL pattern ezGate uses to report the payment result to your server.

Once your customer pays or the order expires, ezGate sends the result with a GET request to your callback URL.

This is the URL you saved in the dashboard, on the Gateway page, in the gateway details for that gateway.

  1. 1

    Set the callback URL in the dashboard

    Go to the ezGate dashboard, open the Gateway page, and in the gateway details enter your callback URL. The address must be reachable from the internet.

    Without a callback URL there is nowhere for ezGate to report the payment result.

  2. 2

    Callback URL pattern

    ezGate sends a GET request to the URL you saved and puts the result in the query parameters below. Replace {callbackUrl} with your actual callback URL, the one you configured in the dashboard.

  3. 3

    status values

    The status parameter tells you the payment outcome: Complete means the payment went through, WaitForCharge means it is recorded and waiting for network confirmation, Pending means the order is still waiting for payment, and Cancel means the payment was cancelled.

    Finalize the customer's order in your system when status is Complete.

  4. 4

    Send the callback domain in the Origin header

    The domain of the callback URL you registered must be sent in the Origin (or Referer) header of your requests — including order creation — and must match the callback domain exactly.

    For example, if your callback URL is https://back.yourdomain.ir/app/v1/crypto/verify-payment, Origin must be https://back.yourdomain.ir; otherwise the request fails with an error.

Callback URL pattern

Put the URL you registered for your gateway in place of {callbackUrl}.

Pattern
{callbackUrl}?refNumber={refNumber}&status={status}&orderId={orderId}

# Replace {callbackUrl} with your callback URL
# from the dashboard (Gateway page, gateway details).
# status is one of:
# Cancel | Complete | WaitForCharge | Pending

Callback parameters

NameTypeDescription
refNumberstringThe refNumber you sent when creating the order
statusstringPayment outcome; one of Cancel, Complete, WaitForCharge, Pending
orderIdstringezGate order id

status values

NameTypeDescription
CompletestringPayment completed successfully
WaitForChargestringPayment recorded; waiting for network confirmation
PendingstringOrder is still waiting for the customer to pay
CancelstringPayment was cancelled

The domain of the site you registered as the callback must be sent in the Origin (or Referer) header of your requests and must match the callback domain; for a callback of https://back.yourdomain.ir/app/v1/crypto/verify-payment the Origin must be https://back.yourdomain.ir, otherwise the request fails with an error.

Part 5

Check order status

In this part you query the order status directly from ezGate, in addition to the callback.

Besides the callback, you can ask ezGate for the status of any order at any time. This is useful when a customer returns from the payment page or when you want to show the order status in your own panel.

Simply send the orderId you received from CreateOrder as a URL parameter.

  1. 1

    Send the status request

    Send a GET request to the URL below and replace {orderId} with the order id.

    The scan, expire, and cancel parameters control the query behavior; use false for all three for a simple status check.

  2. 2

    Read the status from the response

    In the response, the status field tells you the order state and can be Complete, WaitForCharge, Pending, or Cancel.

    amount is the order amount and depositedAmount is the amount your customer has deposited.

GEThttps://api.ezgate.org/api/Order/GetPaymentInvoice?orderId={orderId}&scan=false&expire=false&cancel=false

Check order status code sample

Python example
import requests

url = "https://api.ezgate.org/api/Order/GetPaymentInvoice"

params = {
    "orderId": "YOUR_ORDER_ID",
    "scan": "false",
    "expire": "false",
    "cancel": "false",
}

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

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

order = payload["data"]
# order["status"] is one of: Complete | WaitForCharge | Pending | Cancel
Response example
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "errors": null,
  "data": {
    "orderId": "11111111-2222-3333-4444-555555555555",
    "refNumber": "ORD-1001",
    "amount": 25.5,
    "ezgateAmount": 0,
    "depositedAmount": 25.5,
    "currencySymbol": "USDT",
    "currencyLogoUrl": "https://chante.app/images2/USDT.png",
    "networkName": "BSC (BEP20)",
    "networkSymbol": "BNB",
    "networkLogoUrl": null,
    "walletAddress": "0x0000000000000000000000000000000000000000",
    "status": "Complete",
    "createDate": "2026-01-01T10:00:00.0000000",
    "expiresAt": "2026-01-01T10:15:00.0000000",
    "expiresAtUnix": 1767262500,
    "timeoutMinutes": 15,
    "hasCallback": true,
    "redirectUrl": "https://example.com/callback?refNumber=ORD-1001&status=Complete&orderId=11111111-2222-3333-4444-555555555555",
    "timeoutRedirectUrl": "https://example.com/callback?refNumber=ORD-1001&status=Complete&orderId=11111111-2222-3333-4444-555555555555",
    "portalTitle": "My Store",
    "portalLogoUrl": "https://example.com/portal-logo.png"
  },
  "count": 1
}

Request parameters

NameTypeDescription
orderIdstringezGate order id; from the CreateOrder response
scanbooleanControls the query behavior
expirebooleanControls the query behavior
cancelbooleanControls the query behavior

Response data fields

NameTypeDescription
orderIdstringezGate order id
refNumberstringYour order reference
amountnumberOrder amount
depositedAmountnumberAmount deposited by the customer
currencySymbolstringOrder currency symbol
networkNamestringPayment network name
walletAddressstringOrder wallet address
statusstringOrder status; one of Complete, WaitForCharge, Pending, Cancel
expiresAtstringWhen the order expires
hasCallbackbooleanWhether a callback is configured for this gateway
redirectUrlstringReturn URL used after the status changes
portalTitlestringGateway title

This API does not replace the callback; the callback reports the payment result automatically, while this request is for querying the order status on demand.

WooCommerce plugin setup guide

Plugin

Install and set up the WooCommerce plugin

Add the ezGate crypto gateway to your store without writing code, using the official WooCommerce plugin.

If your store runs on WooCommerce, the easiest way to accept crypto payments is the official ezGate plugin.

In this part you download the plugin from this page, create an API key on ezGate, and enable the gateway in WooCommerce.

Download the WooCommerce plugin

Download the plugin from this page. Choose the version that matches your store language; both versions use the same gateway and the same API key.

  1. 1

    Install and activate the plugin

    Download the plugin from this page. In your WordPress admin, go to Plugins > Add New > Upload Plugin, choose the zip file, install it, and then activate the plugin.

  2. 2

    Get an API key from ezGate

    Go to the ezGate website (ezgate.org) and sign up in under a minute.

    Open your dashboard and create a new API key, then copy it. Keep this key secret.

  3. 3

    Open the WooCommerce payment settings

    In your WordPress admin, go to WooCommerce > Settings > Payments. Find the ezGate payment gateway and click Manage.

  4. 4

    Connect and start selling

    On the page that opens, paste the API key you received from ezGate into the matching field.

    Enable the gateway and save your settings. Your customers can now pay with crypto.

To create an API key and manage your gateway, sign in to your ezGate dashboard at ezgate.org.

After each payment the plugin updates the order status in WooCommerce automatically; you do not need to configure the callback manually.