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
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
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.
https://api.ezgate.org/api/PortalWallet/GetPortalCurrenciesByTokenimport 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 []{
"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
| Name | Type | Description |
|---|---|---|
| currencyId | number | Currency id |
| currencySymbol | string | Currency symbol, e.g. USDT |
| currencyTitle | string | English currency name |
| currencyPersianName | string | Persian currency name |
| currencyLogoUrl | string | Currency logo URL |
| decimals | number | Allowed decimal places for the amount |
| buyPriceIncreasePercent | number | Buy-price markup percent set in the dashboard |
| sellPriceIncreasePercent | number | Sell-price markup percent set in the dashboard |
| hasMemo | boolean | If true, the network requires a memo or destination tag |
| networkDetails | array | Networks enabled for this currency on your gateway |
Network fields (networkDetails)
| Name | Type | Description |
|---|---|---|
| id | number | Network id; this is networkId in the next step |
| name | string | Display name of the network |
| symbol | string | Network symbol, e.g. TRX or BNB |
| networkFee | number | Network fee |