JavaScript afterpay.js

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.