Get started
Quickstart
Take your first test payment. You need a merchant account, an API key and a server that can make HTTPS requests.
1. Get a merchant account and API key
ClearGateway staff create your merchant account, approve it and issue your API key. Ask them for a test key (it starts with sk_test_) and a dashboard invite for your team. The key is shown once, so store it in your server's secret manager or environment, for example as CLEARGATEWAY_API_KEY.
Keep the key secret
Anyone with your secret key can create payments and read your data as you. Never put it in a web page, mobile app or public repository. If it leaks, ask us to revoke it and issue a new one.2. Create a payment
Send the amount in USDC base units (6 decimals) and an Idempotency-Key. Use something stable per order, such as your order ID, so a retry returns the same payment.
curl https://cleargateway-api.onrender.com/v1/payment_intents \
-H "Authorization: Bearer $CLEARGATEWAY_API_KEY" \
-H "Idempotency-Key: order-1042" \
-H "Content-Type: application/json" \
-d '{
"amount": "25500000",
"merchant_order_id": "order-1042",
"success_url": "https://shop.example.com/thanks",
"cancel_url": "https://shop.example.com/cart"
}'The response includes the payment's id, its status (created), the fee split, and a checkout_url.
3. Send your customer to checkout
Redirect the customer to checkout_url or show it as a link or button. It opens our hosted checkout page, where they pay. See Hosted checkout.
4. Listen for the result
Add a webhook endpoint (in the dashboard under Webhooks, or with POST /v1/webhook_endpoints). When the payment is confirmed on-chain we send payment_intent.succeeded. Verify its signature, then fulfil the order. See Webhooks.
5. Go through it end to end
- Create a payment (step 2).
- Open the checkout link and pay with a wallet that has test USDC (see Testing).
- Watch the status change:
awaiting_payment,confirming,succeeded. You can also pollGET /v1/payment_intents/{id}. - Check your webhook receiver got
payment_intent.succeeded, and the payment shows in your dashboard.