For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Introduction to Clearpay
    • Getting Started with Clearpay Online
    • Business Hub
    • Marketing Resources
  • Platforms
    • Platforms Quickstart
    • Adobe Commerce (Magento 2)
    • Adyen
    • Ecwid
    • Shopify
    • Stripe
    • Wix
    • WooCommerce
  • API Development
    • API Quickstart
      • Create a Checkout
      • Immediate Capture
      • Deferred Capture
      • Create a Refund
    • Test Environments
    • Certification
  • Clearpay Messaging
    • Getting Started
    • Implementation
    • Migration
    • Launch Clearpay Info Modal Anywhere
LogoLogo
On this page
  • Prerequisites
  • Basic API calls
  • Get Configuration (/v2/configuration)
  • Create Checkout (/v2/checkouts)
  • Capture Full Payment (/v2/payments/capture)
  • Authorize Payment (/v2/payments/auth)
  • Capture Authorized Payment (/v2/payments/{orderId}/capture)
  • Create Refund (/v2/payments/{orderId}/refund)
  • Post-requisites
API Development

API Quickstart

Was this page helpful?
Previous

Create a Checkout

Next
Built with

Prerequisites

Before you get started, make sure that you have:

  • Signed up for a merchant account at clearpay.co.uk
  • Received sandbox credentials from Clearpay
  • Access to the UK Business Hub for testing

The Clearpay API is available to merchants with businesses in the United Kingdom. For other regions, see Afterpay (AU/NZ/CA) or Cash App Pay (US).

Basic API calls

Get Configuration (/v2/configuration)

The Get Configuration endpoint retrieves your Clearpay order limits. We recommend regularly calling this endpoint as part of a scheduled background process and storing the minimumAmount and maximumAmount values on your server.

Create Checkout (/v2/checkouts)

The Create Checkout endpoint creates a new checkout and returns an order token. When you call the Create Checkout endpoint, you give Clearpay order details, customer information, and the URL to direct customers to after checkout. Clearpay responds with a token used to identify the checkout. Use this token to direct the customer to the Clearpay checkout flow.

Capture Full Payment (/v2/payments/capture)

To capture the full order value immediately, call the Capture Full Payment endpoint. Calling this endpoint completes payment approval, starts the customer’s payment plan, and settles the full order to your bank account. When you call this endpoint, you provide the order token and receive a payment object.

Authorize Payment (/v2/payments/auth)

This is the first endpoint to call when you use the deferred payment flow. To authorize the full payment amount up front and collect funds later, start by calling the Authorize Payment endpoint. Calling this endpoint completes payment approval for a certain amount. When you call this endpoint, you provide the order token and receive a payment object.

Capture Authorized Payment (/v2/payments/{orderId}/capture)

This is the second endpoint to call when you use the deferred payment flow. After the payment is authorized, call the Capture Payment endpoint to capture a full or partial payment. When you call this endpoint, you provide a unique request ID and the amount you want to capture (up to the authorized amount) and you receive an updated payment object.

Create Refund (/v2/payments/{orderId}/refund)

Call the Create Refund endpoint to issue a full or partial refund. When you call this endpoint, you provide a unique request ID and the amount you want to refund (up to the captured amount) and you receive a refund object.

Post-requisites

While you set up and test your integration, you can view all sandbox orders in the UK Business Hub.

After you set up your API integration, contact Clearpay to complete certification testing and receive your live credentials. Once you’re given live credentials, you can launch Clearpay on your website.