API reference
API reference
Every endpoint of the merchant API, generated from the API itself.
Base URL: https://api.sw-staging.dev/v1. Authenticate with an API key as a bearer token (sw_test_… in test, sw_live_… in live). Amounts are integers in the minor unit of the currency (halalas for SAR).
The full OpenAPI 3.1 document is published as well.
Merchant
GET /v1/merchant— Your merchant account
Payments
POST /v1/payments— Create a paymentGET /v1/payments— List paymentsGET /v1/payments/{id}— Retrieve a paymentGET /v1/payments/{id}/events— A payment's historyPOST /v1/payments/{id}/cancel— Cancel an unpaid paymentPOST /v1/payments/{id}/checkout-link— A hosted payment page for the paymentPOST /v1/payments/{id}/client-secret— A client secret for your own checkout page
Refunds
POST /v1/payments/{id}/refunds— Refund a paymentGET /v1/payments/{id}/refunds— A payment's refundsGET /v1/refunds/{id}— Retrieve a refundPOST /v1/payments/{id}/void— Void an authorized payment
Webhook endpoints
POST /v1/webhook_endpoints— Add a webhook endpointGET /v1/webhook_endpoints— List webhook endpointsGET /v1/webhook_endpoints/{id}— Retrieve a webhook endpointPOST /v1/webhook_endpoints/{id}/disable— Stop deliveries to an endpointPOST /v1/webhook_endpoints/{id}/enable— Resume deliveries to an endpointPOST /v1/webhook_endpoints/{id}/rotate_secret— Rotate the signing secretGET /v1/webhook_endpoints/{id}/deliveries— An endpoint's recent deliveriesPOST /v1/webhook_deliveries/{id}/resend— Send a delivery again
Finance
GET /v1/balance— Your balance, per currencyGET /v1/statements— Monthly statementsGET /v1/statements/{id}— A statement with its entriesGET /v1/statements/{id}/export— A statement as CSVGET /v1/payouts— Payouts to your bank accountGET /v1/fees— Fees charged to youGET /v1/settlements— Settlements