Payments API
Process payment
Section titled “Process payment”Payments are processed through the checkout flow. The payment gateway is selected based on configuration.
Get payment
Section titled “Get payment”GET /api/v1/payments/:idAuthorization: Bearer <token>Refund payment
Section titled “Refund payment”POST /api/v1/payments/:id/refundAuthorization: Bearer <admin_token>{ "amount": 50.00, "reason": "Customer request"}Partial refunds supported.
Payment gateways
Section titled “Payment gateways”Airwallex (primary)
Section titled “Airwallex (primary)”Airwallex authenticates with a client ID + API key pair (not account keys), plus a webhook secret:
[payment]default_gateway = "airwallex"
[payment.airwallex]enabled = trueclient_id = "…" # from the Airwallex dashboardapi_key = "…" # from the Airwallex dashboardwebhook_secret = "…" # for verifying webhook signaturesdemo = true # true = api.sandbox.airwallex.com, false = productiondemo = truetargetshttps://api.sandbox.airwallex.com/api/v1;demo = falsetargetshttps://api.airwallex.com/api/v1.- Supports cards, WeChat Pay, Alipay, 3D Secure.
- Checkout response includes
payment_intent_id/client_secretand anairwallex_envhint (demo/prod) so the client mounts the Drop-in against the matching environment. - Settlement records (fees, batch IDs) feed the
accounting export via
POST /api/v1/accounting/sync-settlements.
Stripe (legacy)
Section titled “Stripe (legacy)”Still available. Secret key: sk_test_... / sk_live_...; publishable
key: pk_test_... / pk_live_.... Supports cards, Apple Pay, Google Pay,
3D Secure.
Mock (testing)
Section titled “Mock (testing)”Always available for testing. Simulates successful payments. Set
default_gateway = "mock" to use it.
Webhooks
Section titled “Webhooks”Payment status changes trigger webhooks:
payment.succeededpayment.failedrefund.succeeded
Register webhook endpoints via API or admin.