Test environments
Sandbox
Afterpay provides a sandbox environment for development and testing. Your Afterpay account manager will provide you with sandbox credentials.
Accounts created within an Afterpay sandbox only exist within the sandbox. When you make a transaction in the sandbox, no money actually moves.
API calls in the sandbox use the base URL https://global-api-sandbox.afterpay.com.
Sandbox Business Hub
Contact your Afterpay account manager or delivery manager to request access to the sandbox Business Hub. The sandbox Business Hub provides the same functionality as the production Business Hub.
You can log into the sandbox Business Hub at https://portal.sandbox.afterpay.com/merchant/
You can view all sandbox orders and settlement files, but no settlements are made to your bank account.
Test customer accounts
You can create test customer accounts in the sandbox environment within your test checkout flow. Each customer account requires a unique email address and phone number.
Note
No SMS messages are sent in the sandbox. Use 111111 as the verification code.
Test credit cards
The sandbox capture response (approved/declined) is determined by the CVV value. Use 000 for approval and 051 for decline.
You can use any dummy Visa or Mastercard number and future expiry date, as long as it passes a mod 10 check and hasn’t already been used by a different sandbox customer account. You can also use these dummy cards:
Postman collection
You can test the Afterpay API using Postman, a free-to-download tool for making HTTP requests. To start using Postman, create an account on postman.com.
To test the Afterpay API using postman:
- Go to the Afterpay Online API V2 public workspace.
- Fork the collection.
- Choose a label, workspace, and environment for your fork.
- Regularly pull the latest changes to update your forked collection.
