1. Prepare a test key

Create a test key in your merchant portal. Store it on your server in CIRCUSPAY_SECRET_KEY. Never embed your secret key in a web page or mobile application.

2. Create the checkout

POST/checkout/create.php
Terminal
curl "https://circus-pay.com/api/checkout/create.php" \
  -H "Authorization: Bearer $CIRCUSPAY_SECRET_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "amount": 2499,
  "currency": "EUR",
  "productName": "Ma commande",
  "orderId": "ORDER-DEMO-001",
  "successUrl": "https://example.com/payment/return",
  "cancelUrl": "https://example.com/payment/cancel",
  "testMode": true
}'

3. Redirect the customer

Read url from the JSON response and redirect the browser to that exact URL. The domain may vary with your account configuration: do not reconstruct it.

Illustrative response excerpt
{
  "success": true,
  "token": "pay_EXAMPLE",
  "url": "https://circus-pay.com/sandbox/pay_EXAMPLE",
  "orderId": "ORDER-DEMO-001",
  "test": true,
  "mode": "test"
}

4. Confirm server-side

Configure a signed webhook and verify the order, amount, currency and status. A visit to your return URL is not proof of payment.

5. Go live

After testing, use a production key and remove testMode: true. Confirm that the required methods and currencies are enabled for your account.