# QuataPay in curl (any other language) Plain HTTP, no QuataPay package; works with test and live keys. Secrets come from `QUATAPAY_API_KEY` and `QUATAPAY_WEBHOOK_SECRET`. ## Create a payment ```bash # Sandbox (test key). For a live key use /gateway/payments instead of /gateway/sandbox/payments. curl -sS -X POST "https://api.quatapay.com/api/v1/gateway/sandbox/payments" \ -H "Authorization: Bearer $QUATAPAY_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"amount":5000,"currency":"XAF","customer_reference":"order_1042","return_url":"https://your-site.example/pay/return?order=order_1042"}' # Finish a TEST payment without a browser (test keys only): curl -sS -X POST "https://api.quatapay.com/api/v1/gateway/sandbox/payments/SLUG/simulate" \ -H "Authorization: Bearer $QUATAPAY_API_KEY" -H "Content-Type: application/json" \ -d '{"outcome":"succeeded"}' ``` ## Verify a webhook ```bash # Check a signature by hand (timestamp, body and secret from a delivery you saved): printf '%s.%s' "$TIMESTAMP" "$RAW_BODY" | openssl dgst -sha256 -hmac "$QUATAPAY_WEBHOOK_SECRET" -hex # The header is "sha256=" followed by that hex digest. ```