POST /cart/{cart_id}/checkout
Begin the checkout process.
The request body determines the behavior:
- An empty or omitted body preserves the legacy cart.php redirect response (no changes).
- A non-empty JSON body runs the gateway-agnostic checkout: it places the order, resolves or registers the client, screens for fraud, and dispatches to the payment strategy for the gateway.
The payment strategies are:
- Already paid.
- Fraud hold.
- Nothing payable, when the order created no invoice.
- Stored-token capture.
- Offline or pending.
- A headless payment session, when the request sets the payment.mode value to headless and the gateway supports it.
- A hand-off that requires the shopper to complete payment using the returned next_action.url value.
Request
- Base URLhttps://developers.whmcs.com/api/v2
- Authnone declared
Path parameters
cart_idstring required
Cart ID
Response
Success. An empty request body returns the legacy redirect url value. A non-empty body returns the full CheckoutResult object when the checkout is finished and needs nothing further from you: either it resolved as immediately paid, or it created no invoice and so has nothing payable.
Example response
{
"data": {
"url": "https://example.com/"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.