> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.clearpay.co.uk/v-2/immediate-payment-flow/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.clearpay.co.uk/_mcp/server. # Immediate Payment Flow This flow completes the payment approval, starts the consumer's payment plan, and settles the full order value with the merchant - all as a combined action. 1. Merchant calls the [Get Configuration](/api-reference/online-api/configuration/get-configuration) endpoint to retrieve Clearpay order limits, possibly as part of an asynchronous scheduled background process. 2. Merchant stores these minimum and maximum order values server-side. 3. Separately, at the checkout, Merchant uses the stored Clearpay minimum and maximum order values to determine if Clearpay should be presented as an available payment method. 4. Merchant calls the [Create Checkout](/api-reference/online-api/checkouts/create-checkout) endpoint to retrieve a Clearpay order token. 5. Merchant uses the token in combination with the [JavaScript afterpay.js](/javascript-afterpayjs) to direct the Consumer through the Clearpay screenflow. 6. Consumer completes the Clearpay screenflow and is returned to the Merchant website. * If the Consumer clicks "confirm", they will be returned to the Merchant website with the `orderToken` and a `status` of "SUCCESS". * If the Consumer cancels, they will be returned to the Merchant website with the `orderToken` and a `status` of "CANCELLED". 7. If the merchant is able to fulfil the order, the merchant calls the [Capture Full Payment](/immediate-payment-flow/capture-full-payment) endpoint to capture the payment. * Payment status ("APPROVED" or "DECLINED") is only known once [Capture Full Payment](/immediate-payment-flow/capture-full-payment) has been completed. * If the payment was approved by Clearpay, the Merchant presents the Consumer with an order confirmation/receipt page. * If the payment was declined by Clearpay (e.g. the Consumer’s card details are entered incorrectly), the Merchant presents an appropriate message to the Consumer at the checkout. ## Docs - [Express Checkout Payload (Capture Full Payment)](https://developers.clearpay.co.uk/v-2/express-checkout-payload-capture-full-payment.md): ## API Docs - Immediate Payment Flow [Capture Full Payment](https://developers.clearpay.co.uk/v-2/immediate-payment-flow/capture-full-payment.md) ## OpenAPI Specification The raw OpenAPI 3.1 specification for this API is available at: - [OpenAPI JSON](https://developers.clearpay.co.uk/openapi.json) - [OpenAPI YAML](https://developers.clearpay.co.uk/openapi.yaml)