Order Management

This section describes how to update an Afterpay order.


Update The Merchant Reference

If you do not have an order number (merchantReference), at the time of launching the Afterpay Button, you will use the below endpoint when the order is completed.

Using the authToken and token received from the onComplete function, make a PUT request containing the new merchantReference

This call can be made from the front-end or from a back-end service. If you are in the US or Canada, use the following URL:

1https://api-plus.us-sandbox.afterpay.com/v3/button
1https://api-plus.us.afterpay.com/v3/button

If you are in Australia use the following URL:

1https://api-plus.au-sandbox.afterpay.com/v3/button
1https://api-plus.au.afterpay.com/v3/button

If you are in the UK use the following URL:

1https://api-plus.eu-sandbox.afterpay.com/v3/button
1https://api-plus.eu.afterpay.com/v3/button

Response

1{
2 "authToken": "cbce234de1fbca534568904dd31..",
3 "token": "001.12321312312321",
4 "merchantReference": "newMerchantReference"
5}
authToken valid for 3 hours

This call must be made within 3 hours (180 minutes) of the customer completing the Afterpay, Clearpay (UK) or Cash App Afterpay (US) checkout flow.

Error Codes

errorCodehttpStatusCodeDescription
invalid_object422One or more required fields were missing or invalid
auth_token_malformed412The auth_token was invalid
too_many_requests429The customer has been rate limited
Unauthorized401The authToken has expired
Note

The information on this page also applies to Cash App Afterpay (US) and Clearpay (UK).