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
  • Online API
    • API Environments
    • Direct Payment Flow
    • REST
    • HTTPS
    • Dates
    • Pagination
    • Authentication
    • Idempotent Requests
    • Timeouts
    • API Simulator
  • Models
    • Introduction
    • Contact Object
    • Consumer Object
    • Discount Object
    • Item Object
    • Money Object
    • Order Details Object
    • Payment Object
    • Refund Object
    • Shipping Courier Object
  • Service Status
    • GETPing
  • Configuration
    • GETGet Configuration
  • Orders
    • Introduction
    • GETGet Order
    • POSTCreate Order
  • Javascript afterpay.js
    • Information
    • Redirect Method
  • Payments
    • Introduction
    • POSTCapture Payment
    • PUTUpdate Shipping Courier
    • GETGet Payment By Order ID
    • GETGet Payment By Token
    • GETList Payment(s)
    • POSTCreate Refund
    • PUTUpdate Payment by Order ID
    • POSTReverse Payment By Token
  • Errors
    • Introduction
    • Get Errors
    • Put/Post Errors
  • Reference
LogoLogo
On this page
  • Production- All Regions
  • Sandbox - All Regions
Javascript afterpay.js

JavaScript afterpay.js

Was this page helpful?
Previous

Redirect Method

Next
Built with

Production- All Regions

https://portal.afterpay.com/afterpay.js

Sandbox - All Regions

https://portal.sandbox.afterpay.com/afterpay.js

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

Before this JavaScript can be used, the merchant must call Create Order from their server backend and retrieve an order token. The token is then used in conjunction with this JavaScript to launch the Afterpay screenflow.

It is only after the consumer completes the Afterpay screenflow and returns to the merchant’s website that a subsequent Capture Payment call can be completed.