API v1

Card payments for your business, through one API.

Create a payment on your server, send your customer to the Sites Way payment page, and learn the result from a webhook. Keys that start with sw_test_ run on a simulator: no money moves.

Create a paymentPOST /v1/payments
curl -X POST https://api.sw-staging.dev/v1/payments \
  -H "Authorization: Bearer sw_test_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amount":1000,"currency":"SAR"}'

How a payment goes

Three calls from your server and one webhook — the customer never types a card on your site.

  1. 1Call 1 · your serverCreate a paymentYour server creates it with the amount and a description.
  2. 2Call 2 · your serverOpen the payment pageYour server asks for the hosted page and redirects the customer to it.
  3. 3The customerThe customer paysOn the Sites Way page, then comes back to your site.
  4. 4Call 3 · your server + webhookConfirm, then shipThe return is not proof: the webhook tells your server the result, or your server reads the payment.

Guides

From your first test payment to a production integration.

Reference

Every endpoint, field and error, generated from the code the API runs.