Last updated

Confirm purchase


This page details how to confirm a purchase made with Kustom Checkout (KCO). Confirmation is necessary in response to a push notification from Kustom signaling a completed purchase.

Use Case

A customer has completed a purchase, and you need to create the corresponding order in your system.

Prerequisites

A customer has completed a purchase using KCO.

1. Handle the push POST Request

Kustom Checkout will notify you with a POST request to the push notification URL you provided when creating the checkout order.

There is approximately a 2-minute delay before the order confirmation push to merchants is attempted.

The request will likely contain the order ID as a query parameter:

"merchant_urls": {
    "terms": "https://merchant.com/tac.php",
    "checkout": "https://merchant.com/checkout.php?kustom_order_id={checkout.order.id}",
    "confirmation": "https://merchant.com/thankyou.php?kustom_order_id={checkout.order.id}",
    "push": "https://merchant.com/kco/push.php?kustom_order_id={checkout.order.id}"
}

Example: /push.php?kustom_order_id=12345

2. Request the Order from Kustom

Use the kustom_order_id from the POST request to retrieve the order details from Kustom's Order Management API.

GET /ordermanagement/v1/orders/order_id
Authorization: Basic pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/json

3. Backup Order Creation

Even if the confirmation page fails, create the order in your system once you receive the push notification. If the order does not exist, create it. If you don't intend to ship the order, cancel it.

4. Acknowledge the Order

Acknowledge the order to signal successful receipt to Kustom Checkout, stopping further push notifications.

KCO will continue sending push notifications for 5, 15, 30, and 60 minutes, then every 4 hours, for a total of 48 hours or until you acknowledge the order. After 48 hours, no further notifications will be sent.

POST /ordermanagement/v1/orders/order_id/acknowledge
Authorization: Basic pwhcueUff0MmwLShJiBE9JHA==
Content-Type: application/json

Order Creation and Confirmation Push

  • Attempt to acknowledge the order on the confirmation page.
  • Use the push notification as a backup for order creation.
  • If the order doesn't exist when the push is received, create it.
  • Cancel orders you don't intend to ship.

Ship and Capture the Order

Once the order is confirmed, ship the product and capture the order to finalize the payment. You can perform this in Kustom's Portal or via the Kustom Order Management APIs.

What's Next?

To finalize payment and initiate payout, capture the order after shipping via the Kustom APIs or the Merchant Portal.