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
  • Foundations
    • Introduction
    • Request Headers
    • User-Agent Header
    • Authentication
    • Errors
    • Data Requirements
  • Online API
    • Immediate Payment Flow
    • Deferred Payment Flow
    • JavaScript afterpay.js
  • Upgrading to the Clearpay Express Checkout
    • Express Checkout Overview
    • How to Integrate
    • Security
LogoLogo
On this page
  • Production
  • Sandbox
Online API

JavaScript afterpay.js

Was this page helpful?
Previous

Update Shipping Courier

Next
Built with

Production

All Regions
https://portal.clearpay.co.uk/afterpay.js

Sandbox

All Regions
https://portal.sandbox.clearpay.co.uk/afterpay.js

The afterpay.js is used to launch the Clearpay screenflow, where the consumer logs in (or registers) then confirms their payment schedule.

Note

Before this JavaScript can be used, the merchant must call Create Checkout from their server backend and retrieve a checkout token. The token is then used in conjunction with this JavaScript to launch the Clearpay screenflow.

Note

It is only after the consumer completes the Clearpay screenflow and returns to the merchant’s website that a subsequent Auth or Capture (Without Auth) call can be completed.