Sites WayDevelopers
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 payment
  • GET /v1/payments — List payments
  • GET /v1/payments/{id} — Retrieve a payment
  • GET /v1/payments/{id}/events — A payment's history
  • POST /v1/payments/{id}/cancel — Cancel an unpaid payment
  • POST /v1/payments/{id}/checkout-link — A hosted payment page for the payment
  • POST /v1/payments/{id}/client-secret — A client secret for your own checkout page

Refunds

  • POST /v1/payments/{id}/refunds — Refund a payment
  • GET /v1/payments/{id}/refunds — A payment's refunds
  • GET /v1/refunds/{id} — Retrieve a refund
  • POST /v1/payments/{id}/void — Void an authorized payment

Webhook endpoints

  • POST /v1/webhook_endpoints — Add a webhook endpoint
  • GET /v1/webhook_endpoints — List webhook endpoints
  • GET /v1/webhook_endpoints/{id} — Retrieve a webhook endpoint
  • POST /v1/webhook_endpoints/{id}/disable — Stop deliveries to an endpoint
  • POST /v1/webhook_endpoints/{id}/enable — Resume deliveries to an endpoint
  • POST /v1/webhook_endpoints/{id}/rotate_secret — Rotate the signing secret
  • GET /v1/webhook_endpoints/{id}/deliveries — An endpoint's recent deliveries
  • POST /v1/webhook_deliveries/{id}/resend — Send a delivery again

Finance

  • GET /v1/balance — Your balance, per currency
  • GET /v1/statements — Monthly statements
  • GET /v1/statements/{id} — A statement with its entries
  • GET /v1/statements/{id}/export — A statement as CSV
  • GET /v1/payouts — Payouts to your bank account
  • GET /v1/fees — Fees charged to you
  • GET /v1/settlements — Settlements

On this page