Skip to main content

Test API Mode

API checkout mode can be exercised in sandbox exactly like production — the same IP gate, offer selection, and status polling apply, only the settlement is simulated.

Setup

  • Add your test server's IP to the gateway's allowlist — every API-mode call (create, read, select, expire, sandbox simulate) is source-IP gated (403 off-allowlist).
  • Create with checkoutMode: "API", isSandbox: true, a webhookUrl, and no callbackUrl.

What to test

  • Create returns the inlined payment object with offers[] — render your picker from it.
  • Select an offer: handle 200 ASSIGNED (deposit address returned) and 202 PENDING (re-call after retryAfterMs) with a retry loop.
  • Status poll with ?statusOnly=true returns the slim payload and never flips isVerified.
  • IP gate: a call from a non-allowlisted IP returns 403 with the observed IP echoed.
  • Drive the outcome with sandbox/simulate (also IP-gated for API-mode payments), then confirm the webhook fires and you fulfil only from verify.
curl -X POST https://api-staging.finomesh.com/api/v1/public/payments/{paymentId}/sandbox/simulate \
-H "Content-Type: application/json" \
-d '{ "outcome": "success", "offerId": "{offerId}" }'