Quickstart
Create a sandbox order, open hosted checkout, then verify the signed payment event before fulfilling it.
Key points
- Register a merchant account and request a kuko_test_ key. Send it in the X-Api-Key header.
- Configure a public HTTPS sandbox webhook endpoint for payment.succeeded, payment.failed, and payment.expired. You can start with order and event queries if you do not yet have an endpoint.
- POST /v1/orders with a unique out_trade_no, integer amount, and currency. Redirect the buyer to the returned checkout_url without exposing its token in logs.
- Verify the webhook signature against the raw request body; deduplicate by event ID. Query the order if the notification is delayed.
- For live payments, complete merchant approval, switch to a kuko_live_ key, and configure a live payment.succeeded endpoint or pass a public HTTPS notify_url.
Example
bash
curl -X POST "https://api.kukopay.com/v1/orders" \
-H "Content-Type: application/json" \
-H "X-Api-Key: $KUKOPAY_API_KEY" \
-d '{"out_trade_no":"ORD_20260921_0001","amount":2990,"currency":"USD","subject":"Test order"}'