Skip to main content
This walkthrough creates a real test purchase against the CHIP Collect sandbox and returns a working checkout URL. By the end you’ll have a complete end-to-end payment flow you can copy into your own application.
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 a POST 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.
A successful response looks like:
The price field is in the smallest currency unit. 100 equals RM 1.00 (or MYR 1.00).

2. Open the checkout URL

Copy the checkout_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:
The 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