1. Provision the merchant and authenticate
Choose the Sandbox base URL and use that environment consistently for all credentials and resources. Complete Onboarding: generate an Ed25519 key pair in your backend, share only its public PEM with AgentBank, and securely store the returned merchant ID and portal credentials. Implement request signing before calling/v1/partner/*.
Sign the exact bytes you send and use a fresh nonce for every request, including
signed reads. Keep the private key in your server-side secret manager.
2. Register a webhook
Log in to the portal, then use itsaccess_token to
register a public HTTPS endpoint. Store the
returned signing_secret immediately: it is shown only once.
Implement delivery verification and deduplication
before creating KYC records or payments. Portal JWTs manage webhooks and read
payment history; they do not authorize Partner API writes.
3. Discover available assets and recipient forms
Before rendering a payment form, read the public discovery APIs:- List currencies for active symbols and decimals.
- List fiat payment capabilities
for live directions and final fiat-recipient instruments. Only
off_rampentries carry those recipient fields; an on-ramp ends at a crypto address. - Get payment instrument schemas for QR, direct bank-transfer, and mobile-money fields.
- List supported bank names when the customer selects direct bank transfer.
4. Create or refresh the end user
Call Create end user with a completepartner_end_user_kyc_v1 record and inline artifacts. Follow the required
fields and artifact rules in End-user KYC. Do not send an
end-user ID, merchant KYC reference, or provider user ID.
Persist the returned end_user_id. For a correction, read the end user and
update KYC with the latest
base_kyc_version. Do not create a second end user merely because a request
timed out; follow KYC retry guidance.
5. Wait for the required fiat rails
Poll Get end user or processend_user.rail_readiness.updated. Continue only when the fiat currencies
required by the payment have rail_readiness[].state: "available".
KYC acceptance alone is insufficient: provider forwarding is asynchronous, and
an end user can be ready for one currency but not another. See
Rail readiness for pending, unavailable, and expired states.
6. Preflight the final fiat recipient
Skip this step for an on-ramp whose final recipient is a crypto address.- For a QR payout, call Parse QR recipient
with
qr_content. Do not sendrailorend_user_id. Supplycountryonly as an independent constraint; a mismatch with the detected country is rejected. - For a direct bank payout, call Verify bank recipient
with
end_user_id,country, and the required bank details. Do not sendrail.
recipient_fields unchanged, including resolved
recipient details. Preflight does not store a recipient, reserve liquidity, or
move funds. QR parsing does not replace the end-user readiness check.
7. Estimate immediately before checkout
Call Estimate payment with the same end user and economic direction. The endpoint supportson_ramp and off_ramp
estimates and filters out rails that are not ready for that end user.
An estimate is non-binding: it neither reserves liquidity nor authorizes
settlement. See Payments for the supported payment shapes.
8. Create one payment when the customer commits
Call Create payment with the end user, source and destination assets, amount mode, and finalrecipient_fields.
For fiat-to-fiat, supply only the final fiat recipient, never a crypto bridge
address or a recipient for an internal hop.
Use one durable merchant_payment_reference per commercial order. If a request
times out, reuse the identical body and reference with a fresh signature and
nonce; changing the body under the same reference causes an idempotency
conflict. See Errors and idempotency.
Do not request identical source and destination assets or create parallel
active payments for one end user. Complete, cancel, or wait for the existing
payment to become terminal before starting another.
9. Fund only as instructed
Readnext_action and payment_instruction from the response. When instructed
to fund, display or execute exactly the issued asset, amount, account/address,
chain, memo, reference, QR, calldata, and expiry. Do not reconstruct an
instruction from a quote or substitute a familiar account.
When next_action.type is wait, do not ask the payer to pay again. For
fiat-to-fiat, fund only the first visible instruction; AgentBank handles the
intermediate transfer. See Funding and tracking.
10. Track to a terminal outcome
Consume verified webhooks, deduplicate byx-agentbank-delivery-id, and use
Get payment for recovery. Render timeline
as observed history grouped by hop_index; use next_action for what the
customer should do now, not a prior timeline item or an inferred future event.
Close the order only when terminal is true. A completed payment with
successful: true is a successful finish. A terminal failure with
funds_moved: true needs support or recovery, not automatic recreation.
