Call us to set up your account: zGate merchant accounts and keys are issued by zPayLink; zCheck, zVoice and zPay organizations are created by zPayLink and their admins then create keys in the console (zPay: on the merchant's page, after zPayLink adds your server IP to the access list).
Start in test mode
Use test keys (zgk_test_, zck_test_) on the test URLs. zGate test payments run on BNB Smart Chain Testnet; zCheck test results are simulated.
Call the API from your server
Send the key as Authorization: Bearer <key> over HTTPS from your backend. Keys never belong in browsers or mobile apps; the APIs do not allow cross-origin browser calls.
Receive webhooks
Give zPayLink (zGate) or the console (zCheck, zPay) an HTTPS endpoint, verify every signature and answer 2xx quickly.
Go live
Switch to live keys where a product is open for live use. The status of each product is listed above and in its reference.
Authentication
Bearer API keys on every API
Every request carries one API key in the Authorization header. Keys are shown once when created, stored only as hashes and scoped; a test key never works in live mode and the reverse.
HTTP
Authorization: Bearer <your API key>
Product
Key format
How keys are issued
zGate
zgk_test_… / zgk_live_…
Keys are issued by zPayLink when your merchant account is set up: test keys work only on the test URL, live keys only on production. The full key is shown once; zPayLink stores only a keyed hash. Default scopes: invoices:read, invoices:write, transactions:read, webhooks:write, balance:read; a read-only key has the read scopes only.
zCheck
zck_test_…
Organization admins and developers create keys in the zCheck console (Developers, API keys). The key is shown once; rotation keeps the old key valid for a grace period (24 hours by default, up to 7 days). Scopes: verifications:read, verifications:write (both by default) and verifications:submit for server-to-server uploads.
zPay
zpm_live_… (legacy zpm_test_…)
An organization admin creates keys in the zPay dashboard on the merchant's page (Merchants, the merchant, API keys, Create key). Every new key is a standard key (zpm_live_), shown once and stored only as a SHA-256 hash. Optional IP allowlist (up to 20 addresses or CIDR ranges) and expiry. Rotation issues a new key and keeps the old one valid for a grace period (24 hours by default, 0 to 168). A key works only while its merchant is active. Scopes: payment_requests:write, payment_requests:read, rates:read.
zVoice
zvk_live_… / zvk_test_…
Organization owners and admins create keys in the zVoice console (Developers, API keys) with scopes: call_requests:read, call_requests:write, comments:write, agents:read, recordings:read, qc:read, commissions:read. Shown once, up to 20 active keys per organization.
zRateThe rates page and widget are for viewing; there is no API with keys, limits or a stability commitment.API not available
zTraderConnects your MetaTrader 5 terminal through the zTrader bridge with a key from the console; not an API for third-party software.API not available
zPulseIts Expert Advisors report to zPulse with a key from the console; not an API for third-party software.API not available
zWatchIn development: no software and no API yet. In DevelopmentAPI not available
API reference
Endpoints
JSON over HTTPS. Examples show the main fields with fictional values; responses can contain more fields. Placeholders such as 0xDEPOSIT_ADDRESS stand for real values.
USDT (BEP-20) payments on BNB Smart Chain: create an invoice, show its unique deposit address, hosted page or payment link, and receive signed webhooks as the payment is detected, confirmed and settled.
The test environment on BNB Smart Chain Testnet is open to merchants with a key. On Mainnet, invoices are accepted only within a small, operator-set limit per merchant while the launch is limited. Merchant balance withdrawals, sweeps and refunds are not enabled.
Keys are issued by zPayLink when your merchant account is set up: test keys work only on the test URL, live keys only on production. The full key is shown once; zPayLink stores only a keyed hash. Default scopes: invoices:read, invoices:write, transactions:read, webhooks:write, balance:read; a read-only key has the read scopes only.
Idempotency
POST /invoices accepts an optional Idempotency-Key header (1 to 128 characters: letters, digits and . _ : -), unique per merchant and kept for the life of the invoice. The same key with the same body returns 200 with the current invoice and Idempotent-Replayed: true; the same key with a different body returns 409 idempotency_conflict.
Rate limits
300 requests per minute per key and 60 invoice creations per minute per key; 600 requests per minute per IP before authentication and 30 failed authentications per minute per IP. Responses carry RateLimit-Limit and RateLimit-Remaining; a 429 carries Retry-After. The edge also limits each IP to 20 requests per second (that 429 is a plain page, not JSON).
Creates a USDT invoice with its own deposit address. Unknown body fields are rejected. Amounts are decimal strings (up to 18 decimals); the default range is 1 to 100000 USDT and merchant or launch limits can be lower.
Scope
invoices:write
Idempotency-Key
optional header
Response
201 Created
Body
Parameter
Type
Required
Description
merchant_order_id
string
yes
Your order reference: 1 to 64 characters, letters, digits and . _ : -
amount
string
yes
Decimal string such as "25.00"; no sign or exponent
asset
string
yes
Must be "USDT"
network
string
yes
"bsc-testnet" on the test URL, "bsc" on production
expires_in_minutes
integer
5 to 1440; default set by zPayLink (30)
description
string | null
Up to 255 characters, no control characters
metadata
object | null
Your data, up to 4096 bytes as JSON and 4 levels deep
Show the customer hosted_url, or deposit_address with the exact amount, or payment_uri (EIP-681) as a QR code. Each invoice has its own address.
Fetch token_contract and required_confirmations from GET /network instead of hard-coding them.
GET/invoices/{id}Retrieve an invoice
Returns the invoice with its on-chain transactions (up to 100, including orphaned ones after a reorganisation). Use it to confirm a status before you fulfil an order.
Token contract, confirmations required and the health of the chain connection (ok, degraded, down, misconfigured or not_started). Works with any valid key.
Identity verification (KYC): create a verification, send your user to the hosted page (or upload documents server to server), then read the checks and the decision and receive signed webhooks.
zCheck accepts test keys only while it is in development: live verification is switched off. With the default policy no verification is approved automatically; every case ends in manual review. Results in test mode are simulated (simulated: true). OCR, face comparison and liveness need providers that zPayLink connects per organization, and there is no government database check.
Organization admins and developers create keys in the zCheck console (Developers, API keys). The key is shown once; rotation keeps the old key valid for a grace period (24 hours by default, up to 7 days). Scopes: verifications:read, verifications:write (both by default) and verifications:submit for server-to-server uploads.
Idempotency
Create, cancel and resubmission accept an Idempotency-Key header (8 to 100 characters: letters, digits and _ - : .), scoped to your organization and mode and kept for 2 days. The same request replays the stored response; a different body returns 409 idempotency_conflict, and a request still in flight returns 409 idempotency_in_progress.
Rate limits
300 requests per minute per key (429 rate_limited with Retry-After: 60). The edge limits each IP to 20 requests per second on the API and 10 per second on uploads.
The decision and every check: document_quality, ocr_extraction, first_name_match, last_name_match, national_id_match, face_match, liveness, presentation_attack and document_authenticity. A check is pass, fail, suspicious, inconclusive, unavailable, not_required or error.
const res = await fetch('https://check.zpaylink.com/api/v1/verifications/6f1c2a9e-3b47-4d1a-9c55-2e8b7a0d4f13/result', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ZCHECK_API_KEY}`
}
});
const data = await res.json();
Response
JSON200 OK
{"id":"6f1c2a9e-3b47-4d1a-9c55-2e8b7a0d4f13","reference":"ZC-7K2M9QX4","status":"MANUAL_REVIEW","final":false,"simulated":true,"attempt":1,"policy_version":1,"decision":{"outcome":"MANUAL_REVIEW","automatic":true,"reasons":[{"code":"auto_approve_disabled","message":"All checks passed. Automatic approval is off in this policy: a reviewer decides."}],"manual_reason":null,"engine_version":"zcheck-decision-1","decided_at":"2026-10-15T09:13:05.000Z"},"checks":{"national_id_match":{"status":"pass","score":null,"threshold":null,"raw_score":null,"calibrated":false,"provider":"Simulated (sandbox)","simulated":true,"reasons":[],"entered_last4":"1234","extracted_last4":"1234","match_type":"exact"}},"providers":["Simulated (sandbox)"]}
Errors
404 not_found
checks contains one entry per check; the example shows one.
POST/verifications/{id}/files/{kind}Server-to-server: upload an image
Uploads one image. National ID cards and driving licences need front and back; passports and birth certificates need the front.
Scope
verifications:submit
Response
201 Created
Path parameters
Parameter
Type
Required
Description
id
uuid
yes
Verification id
kind
string
yes
front, back, selfie or liveness
Query parameters
Parameter
Type
Required
Description
seq / challenge
string
For live-capture frames only
Body (binary)
The raw image bytes (the type is detected from the content). Up to 8 MB by default; documents at least 800 px on the short side, selfies 480 px; no animated images.
Rial payments by card-to-card and SHEBA transfer: create a payment request with the card or SHEBA your user pays from, show them the destination account, and zPay matches the incoming deposit to the request, values it in USDT at a locked rate and reports it with a signed deposit.matched webhook. One environment: every new key is a standard key.
The zPay API v1 is open to merchants that zPayLink onboards: zPayLink adds your server's public IP address to the zPay access list, and requests from other addresses are refused with HTTP 401 before they reach the API. Live deposit matching and webhook delivery are switched off in production for now: payment requests made with a standard key stay pending, and webhooks are recorded and held, until zPayLink switches them on. Existing ZPay 1.0 integrations keep working unchanged.
Base URLs
https://pay.zpaylink.com/api/v1One environment; your server IP must be on the zPay access list
An organization admin creates keys in the zPay dashboard on the merchant's page (Merchants, the merchant, API keys, Create key). Every new key is a standard key (zpm_live_), shown once and stored only as a SHA-256 hash. Optional IP allowlist (up to 20 addresses or CIDR ranges) and expiry. Rotation issues a new key and keeps the old one valid for a grace period (24 hours by default, 0 to 168). A key works only while its merchant is active. Scopes: payment_requests:write, payment_requests:read, rates:read.
Idempotency
POST /payment-requests accepts an optional Idempotency-Key header (8 to 100 characters: letters, digits and _ - : .), scoped to the merchant and the key's mode. The same key with the same source, client_id and amount_rial returns the original request with 200 and Idempotent-Replayed: true; a different request returns 409 idempotency_conflict. Without the header every call creates a new request.
Rate limits
300 requests per minute per key, in a fixed one-minute window (429 rate_limited with Retry-After: 60). Every response carries an X-Request-Id header; errors repeat it as request_id.
Developer downloads
Kit statusFor merchants onboarded by zPayLink
Everything to integrate offline: give the kit to your team or AI coding assistant. Technical documents are in English.
Ask zPayLink to onboard you. zPayLink sets up your organization and its bank account and adds your server's public IP address to the zPay access list.
An organization admin creates and activates the merchant in the zPay dashboard and sets its HTTPS callback URL. The 64-character signing secret is shown once: store it on your server.
Create a standard key (zpm_live_) on the merchant's page, ideally with an IP allowlist, and keep it in a secret store.
For each payment, call POST /payment-requests with the payer's card or SHEBA and an Idempotency-Key, and show the returned destination account for payer_window_seconds.
Wait for deposit.matched (verify X-ZPay-Signature-V2, deduplicate on event_id) or poll GET /payment-requests/{ref}; confirm with the API, then credit your user once.
Test and live keys
Key
Issued
Requests
Matching
zpm_live_
Every new key (standard key)
mode: "live"; a standard key sees only live requests
Against real deposits on your organization's bank account, once zPayLink switches live matching on (off today: requests stay pending)
zpm_test_
No longer issued; keys created earlier keep working
mode: "test"; a test key sees only test requests
Never against real deposits; POST /sandbox/deposits simulates one (deprecated)
Lifecycle and statuses
Status
Meaning
pending
Waiting for a deposit from the declared source. Show the destination for payer_window_seconds (1 hour by default); the request stays open until expires_at (7 days by default, set by the organization). A live request does not expire while the bank collector is catching up, for at most 7 more days.
matched final
A deposit from the declared source was credited: received amount, USDT values, the locked rate and the sender are set and never change. deposit.matched is sent.
manual_review
A person decides: a deposit of exactly the suggested amount came from another source, the amount or bank time is unknown, the deposit is dated before the request, it may be a duplicate, or no usable settlement rate exists. It ends as matched or rejected, or goes back to pending.
expired final
No matching deposit arrived before expires_at.
rejected final
Closed by a reviewer without a credit.
cancelled final
Reserved status (accepted by the status filter); no API call or dashboard action sets it today.
Allowed transitions, enforced by the database: pending to matched, manual_review, expired or cancelled; manual_review to matched, rejected or pending. A request is credited at most once.
Registers the card, SHEBA or account your user will pay from and returns the destination account to show them. A replay with the same Idempotency-Key returns 200.
Scope
payment_requests:write
Idempotency-Key
optional header
Response
201 Created
Body
Parameter
Type
Required
Description
source
string
yes
The payer's card number, SHEBA or account number, 1 to 64 characters. Text containing IR or 22 or more digits is a SHEBA (last 24 digits), 16 or more digits a card (first 16), anything else an account number
client_id
string
Your user or order reference, up to 128 characters (returned as client_id and merchant_reference)
amount_rial
integer
Expected amount in rial, a positive integer (optional; the received amount is what counts)
Unknown body fields are rejected with 422. A source that contains no digits, or more than 40, is refused with 422 ("Could not read the source card/SHEBA.").
A request is matched only to a deposit from the declared source that arrives after the request (with a 10 minute clock tolerance by default); the received amount is credited even if it differs from amount_rial. A deposit of exactly the suggested amount from another source goes to manual review.
The destination is returned only by this call: keep it with the request on your side.
GET/payment-requestsList payment requests
The merchant's requests in the key's mode, newest first by default, with cursor pagination (next_cursor).
Scope
payment_requests:read
Response
200 OK
Query parameters
Parameter
Type
Required
Description
status
string
pending, matched, manual_review, expired, rejected or cancelled
Each item is a full payment request object (shortened here). Unknown query parameters are rejected with 422.
GET/payment-requests/{ref}Retrieve a payment request
The current status of one request. Once matched it carries the received amount, the USDT values at the locked rate and the sender name with the last 4 card digits.
404 not_found also means a request of another merchant or of the other mode (a test key never sees live requests and the reverse).
GET/rateUSDT settlement rate
The toman per USDT rate zPay would use now to value a matched deposit: the organization's manual rate, or the latest quote. A matched request keeps the rate locked when it was matched.
When no settlement rate is available, toman_per_usdt is null, source is "bitpin" and stale is true; a live deposit is then never credited automatically (manual review).
POST/sandbox/depositsLegacy test keys: simulate a deposit
Deprecated; works only with a legacy test key (zpm_test_). Records a simulated deposit on test data and runs test matching, so a test request can reach matched. A standard key gets 403 live_key.
Returned by every payment request endpoint. Money values are exact: rial as integers, USDT and rates as decimal strings. The create response adds destination and payer_window_seconds.
Fields
Parameter
Type
Required
Description
id
string
Request id, ZX-R- and 8 hex characters
object
string
Always payment_request
mode
string
live (standard key) or test (legacy test key)
status
string
See Lifecycle and statuses
client_id
string
What you sent; an empty string when you sent none
source.type / source.masked
string
card, sheba or account; masked as •••• and the last 4 digits, or IR… and the last 6 for a SHEBA
suggested_amount_rial
integer | null
amount_rial you sent
received_amount_rial
integer | null
What actually arrived (credited even if it differs)
usdt_amount
string | null
Credited USDT, 2 places: received rial / 10 / rate, half up
rate
object | null
toman_per_usdt (decimal string, up to 8 places) and source (manual or bitpin) of the locked rate
sender
object | null
When matched: name and card_last4 of the payer as the bank reported them
created_at / expires_at / matched_at
ISO date-time
UTC; matched_at is null until matched
merchant_reference
string
Same as client_id
currency
string
Always IRR
requested_amount_irr / paid_amount_irr
integer | null
Requested (amount_rial) and paid amount in rial
difference_irr
integer | null
paid minus requested (negative = underpaid); null without a requested amount
equivalent_usdt
string | null
paid / 10 / rate with 6 places, half up (informational)
credited_usdt
string | null
The credited value, 2 places (same number as usdt_amount)
exchange_rate
object | null
source, usdt_price_toman, usdt_price_irr and captured_at of the rate locked at match time
bank_transaction_id
integer | null
zPay id of the matched bank deposit
destination
object
Create response only: holder, card, sheba, account and bank of the account to pay to
payer_window_seconds
integer
Create response only: how long to show the destination (organization setting, 3600 by default)
deposit.matched body
The ZPay 1.0 keys come first, unchanged, followed by the zPay 2.0 keys. The body is built once and every retry sends the same bytes.
Fields
Parameter
Type
Required
Description
event / status
string
deposit.matched / matched
request_ref
string
The payment request id (ZX-R-…)
client_id
string | null
Your reference
source_card
string
The full declared source digits (card, SHEBA or account)
sender_name / sender_card
string | null
Payer name and full card number as the bank reported them
amount_rial / amount_toman
integer
Received amount (toman = rial / 10, rounded down)
amount_usdt
number | null
Legacy JSON number of the credited USDT; read credited_usdt instead
rate_used
integer | null
Legacy rounded toman per USDT
matched_at
string
UTC, for example 2026-10-16T09:20:00+00:00
event_id / idempotency_key
string
The event id (evt_…), same as X-ZPay-Event-Id and stable across retries: deduplicate on it
merchant_reference … bank_transaction_id
mixed
The same dual-currency fields as the payment request object
bank_reference
string | null
The bank's reference number when it was captured
Security notes
Give each key an IP allowlist with your servers' addresses; a call from another address is refused with 403 ip_not_allowed even with a valid key.
Credit a user only once per event_id and once per request_ref, inside one database transaction, and answer 2xx only after it is committed.
The webhook body contains the full payer card and source digits: store and display them as card data.
ZPay 1.0 compatible endpoints
Frozen routes for integrations built on ZPay 1.0, with the X-ZPay-Key header and the ZPay 1.0 request and response shapes. They are opened per integration on request; build new integrations on /api/v1.
Method
Path
Endpoint
POST
/wp-json/zpay/v1/gateway/requests
Create a payment request (ZPay 1.0 body)
GET
/wp-json/zpay/v1/gateway/requests
The merchant's 20 latest requests
GET
/wp-json/zpay/v1/gateway/requests/{ref}
One request
GET
/wp-json/zpay/v1/gateway/rate
Reference rate
zVoice APIFor organizations set up by zPayLink
Call requests, comments, agents, call recording metadata and quality reviews for account management and support teams, server to server.
The zVoice API works for organizations that zPayLink sets up; there is no self-service sign-up. Outgoing webhooks are not delivered yet (deliveries are simulated), customer assignment and inbound events work for demo organizations only, and commission rates are sample values.
Organization owners and admins create keys in the zVoice console (Developers, API keys) with scopes: call_requests:read, call_requests:write, comments:write, agents:read, recordings:read, qc:read, commissions:read. Shown once, up to 20 active keys per organization.
Idempotency
Create call request and add comment accept an idempotency_key field in the body (8 to 100 characters); a replay returns the original result. There is no Idempotency-Key header on this API.
Rate limits
120 requests per minute per key (429 rate_limited). Lists are paginated with page and size (default 25, maximum 100).
Filter by status (open, closed or a status key), priority, reason, tag, source_crm, team, agent, squad, customer, overdue, from and to (YYYY-MM-DD) or q; sort with sort and dir.
Scope
call_requests:read
Response
200 OK
Query parameters
Parameter
Type
Required
Description
page / size
integer
Page (default 1) and size (default 25, maximum 100)
curl-X POST https://voice.zpaylink.com/api/v1/call-requests \
-H"Authorization: Bearer $ZVOICE_API_KEY" \
-H"Content-Type: application/json" \
-d'{"customer":{"name":"Sara Rezaei","customer_ref":"C-77","type":"broker","source_system":"manual"},"source_department":"finance","reason_key":"deposit_issue","priority":"high","summary":"Deposit not visible in the account","idempotency_key":"cr-c77-20261015"}'
Change priority, due_at, status, summary, reason_key, source_department, product, crm_record_ref or tags; cancelling needs a note of at least 3 characters.
Scope
call_requests:write
Response
200 OK
Path parameters
Parameter
Type
Required
Description
id
string
yes
Numeric id or CR-…
Body
Parameter
Type
Required
Description
priority
string
critical, high, medium or low
status
string
New status key; cancelling needs a note
note
string
Note for the change; at least 3 characters when cancelling
zGate, zCheck, zVoice and zPay sign webhooks the same way: a header t=<unix seconds>,v1=<hex HMAC-SHA256> computed with your endpoint secret over the string "<t>.<raw body>". The signature is recomputed on every attempt.
Read the raw request body before any JSON parsing; re-serialised JSON will not match.
Verify the signature header with your secret and reject timestamps older than 5 minutes.
Deduplicate on the event id header: retries and redeliveries reuse it.
Answer 2xx quickly and do the work afterwards; redirects and slow answers count as failures.
Reconcile with the API (for example GET /invoices/{id}) before you fulfil an order.
Signature header by product
Product
Signature header
Events
zGate
ZGate-Signature
8
zCheck
ZCheck-Signature
9
zPay
X-ZPay-Signature-V2
1
zVoice
ZVoice-Signature
7
Verify a signature
Node.js
import crypto from'node:crypto';
// header: the signature header value, rawBody: the request body as received (Buffer or string)
export function verifySignature(header, rawBody, secret, toleranceSeconds = 300) {
const parts = {};
for (const item of header.split(',')) {
const i = item.indexOf('=');
const k = item.slice(0, i).trim(), v = item.slice(i + 1).trim();
(parts[k] ||= []).push(v);
}
const t = Number(parts.t?.[0]);
if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) returnfalse;
const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest();
return (parts.v1 || []).some((sig) => {
const got = Buffer.from(sig, 'hex');
return got.length === expected.length && crypto.timingSafeEqual(got, expected);
});
}
Python
import hashlib, hmac, time
def verify_signature(header: str, raw_body: bytes, secret: str, tolerance: int = 300) -> bool:
t, sigs = None, []
for item in header.split(','):
k, _, v = item.strip().partition('=')
if k == 't':
t = v
elif k == 'v1':
sigs.append(v)
if t is Noneornot t.isdigit() orabs(time.time() - int(t)) > tolerance:
returnFalse
expected = hmac.new(secret.encode(), t.encode() + b'.' + raw_body, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(expected, s) for s in sigs)
zGate8 Events
A status can move on after an event: an underpaid invoice can be topped up, and a late transfer to an expired invoice (within 30 days) sets late: true and moves it to paid. Each change sends a new event with a new id.
Event
When
invoice.created
An invoice was created
payment.detected
A transfer to the deposit address was seen on chain
payment.confirming
The transfer has started collecting confirmations
invoice.paid
The full amount is confirmed (fulfil the order here)
invoice.underpaid
Less than the amount arrived; a top-up before expiry can still complete it
Return any 2xx within 10 seconds. Redirects are not followed and count as failures.
Retries
Up to 12 attempts. After a failure the next attempt waits about 1, 2, 4, 8, 16, 32 and 64 minutes, then about 2, 4 and 6 hours (with 10% jitter), for about 20 hours in total. Delivery order is not guaranteed.
Endpoints and secret
zPayLink registers your HTTPS endpoint (port 443 or 8443, public address) and gives you its whsec_ secret once; every endpoint receives all event types. Up to 5 endpoints per merchant.
Return any 2xx within 10 seconds. Redirects are not followed.
Retries
First attempt at once; after a failure the next waits 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours. After 8 failed attempts the delivery stops.
Endpoints and secret
Add HTTPS endpoints in the zCheck console per mode and choose their events; the whsec_ secret is shown once. The console can also create a built-in test receiver and send a test.ping.
Webhook delivery is switched off in production for now: events are recorded and held, and zPayLink releases them explicitly once sending is switched on. Verify X-ZPay-Signature-V2, which includes the timestamp; X-ZPay-Signature (HMAC of the raw body only) remains for ZPay 1.0 receivers. The body is PHP-compatible JSON ("/" is sent as "\/", non-ASCII as \uXXXX): verify the raw bytes, never a re-serialised object.
Event
When
deposit.matched
A deposit was matched to a payment request (automatically or after manual review)
Return any 2xx within 12 seconds. Redirects are not followed and count as failures; the response body is ignored.
Retries
Up to 11 attempts: after a failure the next waits 1, 2, 5, 10 and 30 minutes, then 1, 2, 6, 12 and 24 hours (about 46 hours in total), then the delivery stops (dead letter). Delivery is at least once: after a crash the same event can arrive again.
Endpoints and secret
Set the merchant's callback URL in the zPay dashboard: HTTPS, a public address, no credentials in the URL, up to 500 characters. The 64-character hex signing secret is shown once when the merchant is created and when it is rotated; pending deliveries are signed with the new secret. A merchant without a callback URL receives no webhooks.
Check the network: GET /network on the test URL returns the test token contract and the confirmations required.
Create an invoice with an Idempotency-Key derived from your order id, so a retried request never creates a second invoice.
Send the customer to hosted_url, or show deposit_address with the exact amount or payment_uri as a QR code.
Pay it on BNB Smart Chain Testnet with the test token from GET /network. You receive payment.detected, payment.confirming and then invoice.paid once the confirmations are reached.
On invoice.paid, verify the signature, confirm with GET /invoices/{id} and fulfil the order once.
Expose an HTTPS endpoint on a public address and register it (zGate: through zPayLink; zCheck and zVoice: in the console; zPay: the merchant's callback URL in the dashboard). Keep the webhook secret on your server.
Verify the signature over the raw body with the function in the Webhooks section, using the product's signature header.
Store the event id and skip events you have already processed.
Return 2xx within the timeout and process in the background. Use POST /webhooks/test (zGate) or the console test (zCheck) to try it.
After downtime, list missed events with GET /events and redeliver them if needed (zGate: POST /events/{id}/redeliver).
3Retries, idempotency and failed requests
Send an Idempotency-Key on create requests (zGate invoices, zCheck verifications, zPay payment requests); zVoice takes idempotency_key in the body.
Retry network errors, 5xx and 429 with the same key and growing pauses; on 429 wait at least Retry-After seconds.
Do not retry 4xx validation errors unchanged: fix the request (422 lists the fields in details).
409 idempotency_conflict means the key was used with a different request: use a new key for a new operation.
Log the X-Request-Id response header (zCheck, zPay) when you contact support.
4zCheck: the hosted verification flow
Create a verification with your user id in external_customer_id and a redirect_url, and send the user to verification_url (it cannot be embedded in an iframe).
The user gives consent, enters name and national ID, photographs the document and takes a selfie, then submits.
The return button sends the user to redirect_url with status=submitted; the outcome is never in the URL.
Wait for verification.approved, verification.rejected or verification.pending_review, or poll GET /verifications/{id}/status.
Read the checks with GET /verifications/{id}/result. In test mode, choose an outcome with sandbox.scenario; with the default policy every case still ends in manual review.
5zPay: payment request to credited deposit
Keep ZPAY_API_KEY (a standard zpm_live_ key) and the merchant's webhook signing secret on your server; your server's public IP must be on the zPay access list.
Create a payment request per payment with an Idempotency-Key from your order id. Save id and show destination for payer_window_seconds; the user must pay from the card or SHEBA you declared as source.
On deposit.matched, verify X-ZPay-Signature-V2 over the raw body (5 minute window), then confirm with GET /payment-requests/{ref}.
Credit once: a unique constraint on event_id and on the request id, the amount you trust (paid_amount_irr or credited_usdt), and 2xx only after the commit.
While live matching and webhook delivery are switched off, requests stay pending: keep the handler ready and follow requests with GET /payment-requests/{ref}.
Node.js
import express from'express';
import { verifySignature } from'./verify-signature.js'; // the function in the Webhooks sectionconst API = 'https://pay.zpaylink.com/api/v1';
const auth = { Authorization: `Bearer ${process.env.ZPAY_API_KEY}` };
// 1. one payment request per order; a retry with the same Idempotency-Key returns the same request
export asyncfunction createPayment(order) {
const res = await fetch(`${API}/payment-requests`, {
method: 'POST',
headers: { ...auth, 'Content-Type': 'application/json', 'Idempotency-Key': `order-${order.id}` },
body: JSON.stringify({ source: order.payerCard, client_id: String(order.userId), amount_rial: order.amountRial }),
});
const pr = await res.json();
if (!res.ok) thrownew Error(`${pr.error.code}: ${pr.error.message} (${pr.request_id})`);
return pr; // save pr.id, show pr.destination for pr.payer_window_seconds
}
// 2. deposit.matched: verify the raw body, confirm with the API, credit onceconst app = express();
app.post('/zpay/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
if (!verifySignature(req.get('X-ZPay-Signature-V2') || '', req.body, process.env.ZPAY_WEBHOOK_SECRET)) return res.sendStatus(401);
const event = JSON.parse(req.body);
const pr = await (await fetch(`${API}/payment-requests/${encodeURIComponent(event.request_ref)}`, { headers: auth })).json();
if (pr.status === 'matched') await creditOnce(event.event_id, pr.id, pr.paid_amount_irr, pr.credited_usdt); // your code: unique event_id and request id
res.sendStatus(200);
});
6Moving from test to live
zGate: live keys (zgk_live_) work on https://gate.zpaylink.com/api/v1 with network "bsc" within the limits zPayLink sets during the limited launch.
zCheck: live verification is switched off; live keys are refused with 403 live_processing_disabled until it opens.
zPay: one environment; every new key is a standard key (zpm_live_). Live deposit matching and webhook delivery are switched on by zPayLink separately; until then requests stay pending. Move an integration that still uses a legacy test key (zpm_test_) to a standard key, then revoke the test key.
Before switching: separate secrets per environment, verify webhooks in production, set alerts on failed deliveries and keep reconciliation with GET requests.
Errors
Status codes and error codes
Errors use a JSON envelope with a machine-readable code; use the code, not the message, in your logic. zVoice uses the framework format { statusCode, error, message }.
zGate
{"error":{"code":"invalid_request","message":"Invalid invoice request.","details":{"amount":"must be a decimal string, e.g. \"25.50\""}}}
zCheck
{"error":{"code":"validation_error","message":"customer.national_id is not a valid Iranian national ID.","details":[{"field":"customer.national_id","message":"The check digit does not match: the number contains a typing or reading error."}]},"request_id":"req_4f9a1c7e2b8d3a6f0e5c"}
{"statusCode":403,"error":"insufficient_scope","message":"This API key does not have the scope required for this endpoint."}
Code
HTTP
Products
Meaning
unauthorized
401
zGate, zCheck, zPay, zVoice
Missing, malformed or unknown API key
key_revoked, key_expired
401
zCheck, zPay
The key was revoked, or its rotation grace period or expiry has passed
insufficient_scope
403
zGate, zCheck, zPay, zVoice
The key lacks the scope this endpoint needs
merchant_inactive
403
zGate
The merchant is not active; writes are refused
merchant_inactive
403
zPay
The merchant is not active (draft, awaiting activation, suspended, rejected or archived); every call with its keys is refused
ip_not_allowed
403
zPay
The key has an IP allowlist that does not include your server's address
live_key
403
zPay
POST /sandbox/deposits needs a legacy test key (zpm_test_)
organization_disabled
403
zCheck, zPay
The organization is suspended or not active
live_processing_disabled
403
zCheck
Live verification is switched off; use a test key
not_found
404
zGate, zCheck, zPay, zVoice
Unknown id, or an object of another account or mode
idempotency_conflict
409
zGate, zCheck, zPay
The Idempotency-Key was used with a different request
no_bank_account
409
zPay
The organization has no default bank account (sandbox deposits)
invalid_json, payload_too_large
400 / 413
zPay
The body is not valid JSON, or larger than 256 kB
idempotency_in_progress
409
zCheck
The first request with this key is still running
invalid_state, retry_limit
409
zCheck
The action is not allowed in the current status, or no attempts are left
invalid_request, validation_error
422
zGate / zCheck, zPay
The request is invalid; details lists the fields
merchant_limit
422
zGate
Above the per-invoice or daily limit of the merchant
rate_limited, too_many_auth_failures
429
zGate, zCheck, zPay, zVoice
Too many requests; wait Retry-After seconds
payments_not_activated, wallet_unavailable
503
zGate
Invoices cannot be created right now in this environment
internal_error
500
zGate, zCheck, zPay
Unexpected error; retry with the same Idempotency-Key
Security
Keep keys and webhooks safe
Keep API keys and webhook secrets on your server, in a secret store or environment variables; never in front-end code, mobile apps or source control.
Use separate keys per environment and per system, with the narrowest scopes you need (zGate read-only keys, zCheck verifications:submit only where you upload server to server).
Rotate keys when people or systems change: zCheck and zPay keep the old key valid for a grace period during rotation; revoke at once if a key may be exposed.
Verify every webhook signature with a constant-time comparison and a 5 minute timestamp window, and deduplicate on the event id.
Webhook endpoints must be HTTPS on a public address; zPayLink refuses private and internal addresses and does not follow redirects.
Treat webhooks as notifications: confirm amounts and statuses with the API before you credit a user or ship an order.
zCheck never returns images or full national IDs through the API or webhooks; keep the personal data you collect to the minimum.
FAQ
Frequently asked questions
Is there a sandbox?
zGate: yes, a full test environment on BNB Smart Chain Testnet (real testnet transfers, no simulated payments). zCheck: test keys with simulated results and selectable scenarios. zPay has one environment: test keys are no longer issued; existing ones keep working and their requests are never matched against real deposits. zVoice has no separate test environment.
How do I get API keys?
Call us. zGate keys are issued by zPayLink with your merchant account; for zCheck, zVoice and zPay, zPayLink creates your organization and your admins create keys in the console.
Can I call the APIs from a browser or mobile app?
No. They are server-to-server APIs: cross-origin browser calls are not allowed and a key in an app would be exposed. Call them from your backend.
Which networks and assets does zGate support?
USDT (BEP-20) on BNB Smart Chain only: "bsc" in production and "bsc-testnet" in the test environment. There is no fiat pricing and there are no refunds through the API.
Do webhooks arrive in order?
Not necessarily. Use the status and timestamps in the payload, confirm with the API, and handle every event idempotently.
Are there OpenAPI documents?
Yes: every developer kit includes openapi.yaml. zCheck and zVoice also serve theirs (linked in their reference sections); zPay serves /api/v1/openapi.json to servers on its access list.
What about zRate, zTrader, zPulse and zWatch?
They have no API for third-party software today; see the Products section.
Changelog
API changes
zPay API v1 documentation re-audited: one environment (standard zpm_live_ keys; legacy test keys keep working), access list for server IPs, dual-currency fields and event_id in responses and deposit.matched, payment lifecycle, error codes and a new developer kit.
Developer portal published: full API reference for zGate, zCheck, zPay and zVoice, webhooks, guides and error codes.
zPay 2.0 merchant API v1 implemented (payment requests, rate, test deposits, deposit.matched webhook); not open to merchants yet.
zGate: events feed (GET /events), redelivery (POST /events/{id}/redeliver) and on-chain transactions in invoice webhooks.
zVoice API v1: call requests, comments, agents, recordings, quality reviews and commissions with scoped keys.
zCheck API v1 in test mode: verifications, hosted page, server-to-server uploads, results and signed webhooks.
Ready to connect?
Call us for API access, test keys or a technical walkthrough.