Docs/Going live/Testing

Testing

Verify your integration before you take real money. The v1 contract supports signed webhook tests today, while test-mode checkout sessions are separated from live funds and clearly marked as they roll out.

Test mode

Test mode is designed to exercise the payment flow without moving real funds on-chain. It uses the same https://apa.app/v1API shape and the same event names you'll see in production, so your integration can rehearse order handling before live settlement.

Test-mode API keys are planned and will be clearly labelled so they can never be confused with live credentials. Calls made with a test key never settle to a real wallet and never appear in your live payment list.

Webhook tests livesk_test_… rolling outNo real settlement
Backend contract
Signed webhook testing is part of the v1 backend contract. Registered endpoints receive a real signed sample event through the same delivery and signature path used for production payment events.

Test webhook events

Send a sample event to one of your registered endpoints with POST /v1/webhooks/test. The payload is signed with that endpoint's real whsec_ secret, so it exercises the exact same HMAC verification path as production traffic — a true test of your handler, not a stub.

POST /v1/webhooks/test
curl https://apa.app/v1/webhooks/test \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "endpoint_id": "we_123", "event": "payment.paid" }'

200 OK
{ "data": { "delivered": true, "response_code": 200 }, "request_id": "req_7qP1zM5x" }

Fire the failure events too — payment.failed and payment.expired — and confirm your order states recover cleanly. Make handlers idempotent: an event may be delivered more than once.

Sandbox checkout sessions

Once test-mode sessions are enabled for your account, you will be able to create sessions that simulate the customer flow so you can drive your UI through every state — created, paid, failed — without a real wallet or on-chain settlement. A sandbox session uses the same request and response shape as a live one, then emits lifecycle webhooks against an isolated sandbox ledger.

Planned sandbox session (test mode)
curl https://apa.app/v1/checkout/sessions \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "payout_wallet_id": "pp_test_123",
    "amount": "10.00",
    "currency": "USD",
    "order_id": "test-001"
  }'

# → marks paid against the sandbox ledger and
#   emits the same payment.paid webhook as live mode.

Current test-mode limits

Available now vs rolling out
  • Test-mode secret keys (sk_test_) and fully simulated sessions are still rolling out.
  • POST /v1/webhooks/test verifies your handler and signature checks, but does not create a real payment record.
  • To exercise a genuine routed payment end to end, use a small live amount on a supported pair and a wallet you control.
  • On-chain confirmation times depend on the network — set your test timeouts accordingly.