Skip to main content
Design every caller for retries. Network uncertainty does not mean a payment or KYC write did not reach AgentBank.

Error response

Application errors include a machine-readable error object. Integrations should branch on error.code, not on the prose message:
Log the HTTP status, error code, and correlation ID. Redact KYC, passwords, signature headers, private keys, and webhook secrets.

Common integration failures

Payment idempotency

merchant_payment_reference is the durable idempotency key for POST /v1/partner/payments, scoped to the merchant.
  • Reuse the same reference with the same normalized payment request to get the original payment view.
  • Reuse it with a different payload to receive an idempotency conflict.
  • Generate a different reference for a new commercial order, never for a transport retry of the old one.
  • request_id is useful merchant correlation metadata but does not replace merchant_payment_reference for payment idempotency.
If a create request times out, first retry the exact same request with the same merchant payment reference or list/read your merchant payment history. Do not change the recipient, amount, or reference merely because the first response was lost.

KYC retries and versions

Create requires a complete KYC record. The same verified document identity is not a license to create an unrelated second end user. Keep the returned end_user_id, then use PUT with its base_kyc_version for updates. On a version conflict, fetch the latest redacted record and have your verified KYC source provide a fresh, allowed patch.

Webhook retries

Webhook delivery is at least once and separate from the API response. A 2xx acknowledges the specific delivery. Network errors, 429, and 5xx can cause the same x-agentbank-delivery-id to arrive again. Persist that ID before processing and make downstream state updates idempotent. Use the payment read endpoint as recovery authority if a webhook is delayed, unknown, or received after a service restart.