Use a test mode API key for the entire quickstart. Live keys are not
required and should not be used here. You can generate a test key from the
CHIP merchant portal.
Prerequisites
- A CHIP merchant account
- A test mode Secret Key and Brand ID from the merchant portal
curl(or any HTTP client)
1. Create a test purchase
Send aPOST request to the CHIP Collect API to create a purchase. The
response includes a checkout_url that you can open in a browser to complete
a fake payment.
The
price field is in the smallest currency unit. 100 equals RM 1.00
(or MYR 1.00).2. Open the checkout URL
Copy thecheckout_url from the response and open it in your browser. In
test mode, the hosted payment page lets you simulate a successful payment
without redirecting to a real bank.
3. Check the purchase status
After the test payment completes, query the purchase to confirm its status:status field will move from created to paid once the test
payment succeeds.
4. Receive a server-side notification with success_callback
success_redirect only fires when the buyer reaches your site in a
browser. To know about payments that succeed without a redirect — for
example, when the buyer closes the tab, pays through an e-wallet, or
completes the payment asynchronously — pass a success_callback URL
when creating the purchase. CHIP will POST the full purchase object to
that URL the moment the payment is captured.
success_callback payloads are signed with an RSA signature in the
X-Signature header — see Verifying webhook signatures
for the verification algorithm and code samples.
Use Webhooks when you
need a single endpoint that listens for multiple event types
across many purchases (e.g.
purchase.paid, purchase.payment_failure,
purchase.refunded). For a single purchase that just needs a
“payment is done” notification, success_callback is the simpler
choice.Next steps
- Authentication — Bearer token and webhook signature verification
- Online Purchases — payment links, subscriptions, and pre-auth
- Direct Post & Skip payment page — embed the checkout on your own site
- Integrate with AI agents — use the CHIP skill with Cursor, Codex, or any AI-powered IDE
- Errors — common error codes and what to do about them