---
id: get
title: "Get order"
sidebar_label: Get order
hide_title: true
description: "Management API - Orders - Get Order"
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Ingress from "../../../src/components/ingress/ingress.react";
import OrderBase from "./models/orderBase.mdx";

<Ingress title="Get order">
  To retrieve details about a specific order using our management api, you need
  to perform a GET request to the orders endpoint while providing the order's
  id.
</Ingress>

:::note A recent change may not show up yet

Order updates are applied asynchronously, so a fetch straight after a write can return the old
version.

- If you have the action `correlationId` from a webhook, include it in the query. Walley returns the order only once that action has been applied.
- Otherwise, wait up to 1 minute before fetching, and keep the read off your customer's critical path.
- Retry `403` and `404` after at least 3 seconds. Right after a purchase, both usually mean the order is still syncing.

[Asynchronous operations](/docs/manage/concepts/asynchronous-operations) covers this in full.

:::

<Tabs defaultValue="req" values={[
{ label: 'Request', value: 'req', },
{ label: 'Response', value: 'res', }
]}>

<TabItem value="req">

```http
GET /manage/orders/{{orderId}}?correlationId={{correlationId}} HTTP/1.1
Host: api.uat.walleydev.com // Test environment. Production uses a different hostname.
Content-Type: application/json
Authorization: Bearer {{accessToken}}
```

</TabItem>

<TabItem value="res">

```json
{
  "data": {
    "id": "853f3f82-ab12-47c3-9d97-af17009852cd",
    "reference": "MX_220921_111434",
    "paymentMethod": "Invoice",
    "totalAmount": 2459.49,
    "currency": "SEK",
    "status": "Activated",
    "salesSegment": "B2C",
    "countryCode": "SE",
    "productCode": "DI_001",
    "placedAt": "2022-09-21T11:14:35.7900411+00:00",
    "expiresAt": null,
    "customer": {
      "type": "Person",
      "name": "Vilma Lundqvist",
      "firstName": "Vilma",
      "lastName": "Lundqvist",
      "registrationNumber": "490331***5",
      "countryCode": "SE",
      "coAddress": "c/o Vilma Lundqvist",
      "addressLine1": "Päronallén 30",
      "addressLine2": null,
      "city": "Åsarna",
      "postalCode": "429 67",
      "email": "test@walley.se",
      "mobilePhoneNumber": "+46731234567",
      "homePhoneNumber": "+46731234567"
    },
    "deliveryAddress": {
      "addressLine1": "Päronallén 30",
      "addressLine2": null,
      "city": "Åsarna",
      "coAddress": "c/o Vilma Lundqvist",
      "receiverName": "Vilma Lundqvist",
      "countryCode": "SE",
      "email": "test@walley.se",
      "mobilePhone": "+46731234567",
      "phoneNumber": "+46731234567",
      "postalCode": "429 67"
    },
    "invoiceAddress": {
      "addressLine1": "Päronallén 30",
      "addressLine2": null,
      "city": "Åsarna",
      "coAddress": "c/o Vilma Lundqvist",
      "receiverName": "Vilma Lundqvist",
      "countryCode": "SE",
      "email": "test@walley.se",
      "mobilePhone": "+46731234567",
      "phoneNumber": "+46731234567",
      "postalCode": "429 67"
    },
    "items": [
      {
        "articleNumber": "9364",
        "description": "3:Flyte Buckminster Bordslampa",
        "price": 237.22,
        "totalPrice": 474.44,
        "vatRate": 12.0,
        "currency": "SEK",
        "quantity": 2,
        "status": "Activated",
        "captureId": "117573228",
        "capturedAt": "2022-09-21T11:14:35.7900411+00:00",
        "refundedAt": null
      },
      {
        "articleNumber": "10000",
        "description": "Rabatt 10%",
        "price": -393.78,
        "totalPrice": -393.78,
        "vatRate": 25.0,
        "currency": "SEK",
        "quantity": 1,
        "status": "Activated",
        "captureId": "117573228",
        "capturedAt": "2022-09-21T11:14:35.7900411+00:00",
        "refundedAt": null
      },
      {
        "articleNumber": "3570",
        "description": "designletter mugg F",
        "price": 228.17,
        "totalPrice": 2281.7,
        "vatRate": 25.0,
        "currency": "SEK",
        "quantity": 10,
        "status": "Activated",
        "captureId": "117573228",
        "capturedAt": "2022-09-21T11:14:35.7900411+00:00",
        "refundedAt": null
      },
      {
        "articleNumber": "2552",
        "description": "1:Mumin Mugg 30 cl, Snorkfröken Lila",
        "price": 157.5,
        "totalPrice": 787.5,
        "vatRate": 6.0,
        "currency": "SEK",
        "quantity": 5,
        "status": "Returned",
        "captureId": "117573228",
        "capturedAt": null,
        "refundedAt": "2022-09-21T11:15:02.2884003+00:00"
      },
      {
        "articleNumber": "8484",
        "description": "papperspåse",
        "price": 144.46,
        "totalPrice": 288.92,
        "vatRate": 12.0,
        "currency": "SEK",
        "quantity": 2,
        "status": "Returned",
        "captureId": "117573228",
        "capturedAt": null,
        "refundedAt": "2022-09-21T11:16:27.8328129+00:00"
      },
      {
        "articleNumber": "3755",
        "description": "1:Cotton Matta 75x200 cm, Raincoat Yellow",
        "price": 105.21,
        "totalPrice": 105.21,
        "vatRate": 12.0,
        "currency": "SEK",
        "quantity": 1,
        "status": "Returned",
        "captureId": "117573228",
        "capturedAt": null,
        "refundedAt": "2022-09-21T11:16:27.8328129+00:00"
      },
      {
        "articleNumber": "1156",
        "description": "3:Nature Ostkupa",
        "price": 97.35,
        "totalPrice": 97.35,
        "vatRate": 12.0,
        "currency": "SEK",
        "quantity": 1,
        "status": "NotActivated",
        "captureId": null,
        "capturedAt": null,
        "refundedAt": null
      }
    ],
    "invoices": [
      {
        "invoiceNumber": "117573228",
        "paymentStatus": "NotPaid",
        "totalAmount": 2362.14,
        "createdAt": "2022-09-21T11:14:35.8582677+00:00",
        "dueDate": "2022-10-31T23:59:59+01:00"
      }
    ]
  },
  "links": {
    "self": {
      "method": "GET",
      "href": "/orders/853f3f82-ab12-47c3-9d97-af17009852cd",
      "query": ""
    },
    "refund": {
      "method": "POST",
      "href": "/orders/853f3f82-ab12-47c3-9d97-af17009852cd/refund",
      "query": ""
    }
  },
  "metaData": {}
}
```

</TabItem>

</Tabs>

## Data Model

### Request

#### Request path

| Path              | Required | Explanation                                                                                                                                                  |
| ----------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **orderId**       | Yes      | The id of the order that is requested                                                                                                                        |
| **correlationId** | No       | The correlation ID of an action. If specified, the order is only returned if it was affected by this action, otherwise a 404 Not Found response is returned. |

#### Request headers

| Header            | Required | Explanation                                                                                                             |
| ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| **Authorization** | Yes      | See [Authentication](/docs/manage/getting-started/authentication) for how to generate the Bearer token value |

### Response

#### Possible responses

| Http status code | Description                                                                             |
| ---------------- | ---------------------------------------------------------------------------------------- |
| 200              | The order is returned in `data`                                                         |
| 401              | Token missing, expired, or invalid                                                      |
| 403              | No permission for this store, or the order has not finished syncing                     |
| 404              | Order not found, the order has not finished syncing, or the `correlationId` has not been applied yet |

See [Errors](/docs/manage/errors) for what to do about each of these.

#### Response body from 200 OK

This is the main structure of the response object:

```json
{
  "data": {},
  "links": {},
  "metaData": {}
}
```

`response.data` object follows the structure:

<OrderBase />
