> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: "Retrieving order details"
description: "Access complete details of an order post-purchase"
---

Once a purchase is completed, you can retrieve details of the order using [`orderByID`](/api-reference/orderbyid). The costs related to the order as well as the [`Cart`](/api-reference/cart) that the order was checked out from are all available to you. This is especially helpful when you need to build dashboards or populate order history pages.

## Example

<Tabs items={["Request", "Response"]}>
  <Tab title="Request">
    ```GraphQL
    query OrderById($id: ID!) {
      orderByID(id: $id) {
        id
        status
        tax {
          displayValue
        }
        shipping {
          displayValue
        }
        subtotal {
          displayValue
        }
        total {
          value
          currency
          displayValue
        }
        cart {
          id
          attributes {
             key
            value
          }
          buyerIdentity {
            firstName
            lastName
            email
            phone
            address1
            address2
            city
            provinceCode
            countryCode
            postalCode
          }
          stores {
            ... on AmazonStore {
              store
              cartLines {
                product {
                  title
                  images {
                    url
                  }
                }
              }
            }
            ... on ShopifyStore {
              store
              cartLines {
                variant {
                  name
                  title
                  SKU
                  image {
                    url
                  }
                }
                product {
                  title
                  productType
                  description
                  descriptionHTML
                  images {
                    url
                  }
                }
              }
            }
          }
        }
        events {
          __typename
          id
          createdAt
        }
      }
    }
    ```
  </Tab>

  <Tab title="Response">
    ```json
    {
      "data": {
        "orderByID": {
          "id": "67efa898-21f7-4d19-8d8f-98738b09b8c6",
          "status": "SUCCEEDED",
          "tax": {
            "displayValue": "$172.50"
          },
          "shipping": {
            "displayValue": "$0.00"
          },
          "subtotal": {
            "displayValue": "$2,000.00"
          },
          "total": {
            "value": 233250,
            "currency": "USD",
            "displayValue": "$2,332.50"
          },
          "cart": {
            "id": "dSWKMnrdKNomIQcQzKOe",
            "attributes": [],
            "buyerIdentity": {
              "firstName": "John",
              "lastName": "Doe",
              "email": "dev@rye.com",
              "phone": "+14254493139",
              "address1": "90 Ruland Road",
              "address2": "",
              "city": "Melville",
              "provinceCode": "NY",
              "countryCode": "US",
              "postalCode": "11747"
            },
            "stores": [
              {
                "store": "amazon",
                "cartLines": [
                  {
                    "product": {
                      "title": " Macbook Pro",
                      "images": []
                    }
                  }
                ]
              }
            ]
          },
          "events": [
            {
              "__typename": "OrderSubmissionStartedOrderEvent",
              "id": "00c527c7-9fbf-4681-ade4-7c5915ca656d",
              "createdAt": "2024-08-28T13:54:08.694Z"
            },
            {
              "__typename": "OrderSubmissionSucceededOrderEvent",
              "id": "adbc3889-b5d1-44dd-9d6c-71e5c79eaaa5",
              "createdAt": "2024-08-28T13:54:09.185Z"
            },
            {
              "__typename": "OrderPlacedOrderEvent",
              "id": "ee668d1b-0b36-4cfe-929c-79fce9a503df",
              "createdAt": "2024-08-28T13:54:09.323Z"
            }
          ]
        }
      }
    }
    ```
  </Tab>
</Tabs>


---

*Powered by [holocron.so](https://holocron.so)*
