Skip to content

Payments API

Payments are processed through the checkout flow. The payment gateway is selected based on configuration.

GET /api/v1/payments/:id
Authorization: Bearer <token>
POST /api/v1/payments/:id/refund
Authorization: Bearer <admin_token>
{
"amount": 50.00,
"reason": "Customer request"
}

Partial refunds supported.

Airwallex authenticates with a client ID + API key pair (not account keys), plus a webhook secret:

[payment]
default_gateway = "airwallex"
[payment.airwallex]
enabled = true
client_id = "…" # from the Airwallex dashboard
api_key = "…" # from the Airwallex dashboard
webhook_secret = "…" # for verifying webhook signatures
demo = true # true = api.sandbox.airwallex.com, false = production
  • demo = true targets https://api.sandbox.airwallex.com/api/v1; demo = false targets https://api.airwallex.com/api/v1.
  • Supports cards, WeChat Pay, Alipay, 3D Secure.
  • Checkout response includes payment_intent_id / client_secret and an airwallex_env hint (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.

Still available. Secret key: sk_test_... / sk_live_...; publishable key: pk_test_... / pk_live_.... Supports cards, Apple Pay, Google Pay, 3D Secure.

Always available for testing. Simulates successful payments. Set default_gateway = "mock" to use it.

Payment status changes trigger webhooks:

  • payment.succeeded
  • payment.failed
  • refund.succeeded

Register webhook endpoints via API or admin.