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
    • Request Headers
    • Dates
    • Pagination
    • Authentication
    • Idempotent Requests
    • Timeouts
    • API Simulator
      • POSTCreate Order
      • GETGet Order
    • JavaScript afterpay.js
    • Errors
LogoLogo
Online APIOrders

Get Order

GET
https://global-api-sandbox.afterpay.com/v1/orders/:token
GET
/v1/orders/:token
$curl https://global-api-sandbox.afterpay.com/v1/orders/token \
> -H "User-Agent: User-Agent" \
> -u "<username>:<password>"
This endpoint retrieves an incomplete individual order by token. <Note title="Note"> Order details are only retained in this temporary format for up to 60 minutes. If an order token expires or has a payment captured against it, it can no longer be retrieved from this endpoint. To retrieve a completed payment along with its associated order details, see [Get Payment By Token](/v-1/api-reference/online-api/payments/get-payment-by-token). </Note> ## Successful Response (200) If an order belonging to the authenticated merchant account is found, returns the order details in response. Fields that were not included in the original [Create Order](/v-1/api-reference/online-api/orders/create-order) request may not be included in any corresponding Get Order request. | Attribute | Type | Description | | :------------------------------ | :---------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | | `expires` | string | The UTC timestamp of when the order token will expire, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. | | `token` | string | Order token to be used to complete payment. | | `totalAmount` | [Money](/v-1/money-object) | Total amount for order to be charged to consumer. | | `consumer` | [Consumer](/v-1/consumer-object) | The consumer requesting the order. | | `billing` | [Contact](/v-1/contact-object) | Billing address. | | `shipping` | [Contact](/v-1/contact-object) | Shipping address. | | `courier` | [Shipping Courier](/v-1/shipping-courier-object) | Shipping courier details. | | `description` | string | A description of the order. | | `merchant`.`redirectConfirmUrl` | string | The consumer is redirected to this URL on confirmation. | | `merchant`.`redirectCancelUrl` | string | The consumer to redirected to this URL if the payment process is cancelled. | | `paymentType` | string | "PAY_BY_INSTALLMENT" | | `merchantReference` | string | The merchant's id/reference that this order corresponds to. | | `items` | [Item](/v-1/item-object)\[] | An array of order items. | | `discounts` | [Discount](/v-1/discount-object)\[] | An array of discounts. | | `shippingAmount` | [Money](/v-1/money-object) | The shipping amount. | | `taxAmount` | [Money](/v-1/money-object) | The included tax amount after applying all discounts. | ## Connection Timeouts | Timeout | Time (Seconds) | | :------ | :------------- | | Open | 10 | | Read | 20 | ## Errors In addition to the [GET Errors](/v-1/get-errors) applicable to all GET endpoints, the following errors are specific to Get Order: | HTTP Status Code | errorCode | Description | | :-- | :-- | :-- | | **404** <br />Not Found | `not_found` | The order token is invalid, expired, completed, or does not exist. |
Was this page helpful?
Previous

JavaScript afterpay.js

Next
Built with

This endpoint retrieves an incomplete individual order by token.

Note

Order details are only retained in this temporary format for up to 60 minutes. If an order token expires or has a payment captured against it, it can no longer be retrieved from this endpoint.

To retrieve a completed payment along with its associated order details, see Get Payment By Token.

Successful Response (200)

If an order belonging to the authenticated merchant account is found, returns the order details in response. Fields that were not included in the original Create Order request may not be included in any corresponding Get Order request.

AttributeTypeDescription
expiresstringThe UTC timestamp of when the order token will expire, in ISO 8601 format.
tokenstringOrder token to be used to complete payment.
totalAmountMoneyTotal amount for order to be charged to consumer.
consumerConsumerThe consumer requesting the order.
billingContactBilling address.
shippingContactShipping address.
courierShipping CourierShipping courier details.
descriptionstringA description of the order.
merchant.redirectConfirmUrlstringThe consumer is redirected to this URL on confirmation.
merchant.redirectCancelUrlstringThe consumer to redirected to this URL if the payment process is cancelled.
paymentTypestring”PAY_BY_INSTALLMENT”
merchantReferencestringThe merchant’s id/reference that this order corresponds to.
itemsItem[]An array of order items.
discountsDiscount[]An array of discounts.
shippingAmountMoneyThe shipping amount.
taxAmountMoneyThe included tax amount after applying all discounts.

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read20

Errors

In addition to the GET Errors applicable to all GET endpoints, the following errors are specific to Get Order:

HTTP Status CodeerrorCodeDescription
404
Not Found
not_foundThe order token is invalid, expired, completed, or does not exist.

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Path parameters

tokenstringRequired
The token of the order to be retrieved.

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json