1
Get sandbox credentials
PayChoice sends your sandbox API username, password, merchant GUID and (for the Widget) public key through a one-time secure link. Store them in a secrets manager.
2
Decide how you'll take payments
- PayChoice Widget — hosted payment page in an iframe. No card data on your side.
- Banking API — you collect the details and call the charge endpoint.
3
Create a test charge
Send a card charge to the sandbox using one of the test cards. Any future expiry and a CVV of The response wraps a
123 will do.charge object:status_code "0" is approved. The full list is under Charge status.4
Try a decline
On the sandbox, the decimal part of the amount selects the outcome. Send
10.51 and the charge comes back declined, with HTTP 402 and error_code "51" (Insufficient Funds) in the charge object. See Testing for the mechanics.5
Register a webhook
Card charges are approved or declined immediately, but bank charges settle over several days, and every charge can change status later. Register an HTTPS endpoint so PayChoice can tell you:The response includes a
webhook_secret. Store it: it signs every notification and is only returned once. The Webhooks guide covers verification, retries and the bank-settlement flow.6
Keep a payment method on file (optional)
If you’ll charge the same customer again, tokenise their card or bank account and charge the token instead. For subscriptions and invoicing, continue to Recurring billing.
You’ve made a charge, seen a decline, and have a webhook registered. That’s the complete loop; everything else in these docs is a variation on it.

