> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Order

> This endpoint retrieves an order.

### Body

<ParamField body="id" type="string">
  This is the id of the order.
</ParamField>

### Response

<ResponseField name="id" type="string">
  This is the id of the order.
</ResponseField>

<ResponseField name="name" type="string">
  This is the name of the order.
</ResponseField>

<ResponseField name="order_number" type="string">
  This is the order number.
</ResponseField>

<ResponseField name="created_date" type="string">
  This is the date the order was created.
</ResponseField>

<ResponseField name="updated_date" type="string">
  This is the date the order was last updated.
</ResponseField>

<ResponseField name="order_status" type="string">
  This is the status of the order.
</ResponseField>

<ResponseField name="imported_status" type="string">
  This is the imported status of the order.
</ResponseField>

<ResponseField name="delivery_date" type="string">
  This is the delivery date of the order.
</ResponseField>

<ResponseField name="ordered_by" type="string">
  This is the person who ordered.
</ResponseField>

<ResponseField name="delivery_address" type="string">
  This is the delivery address for the order.
</ResponseField>

<ResponseField name="notes" type="string">
  These are additional notes for the order.
</ResponseField>

<ResponseField name="imported_date" type="string">
  This is the date the order was imported.
</ResponseField>

<ResponseField name="customer_number" type="string">
  This is the customer number associated with the order.
</ResponseField>

<ResponseField name="customer_name" type="string">
  This is the name of the customer.
</ResponseField>

<ResponseField name="import" type="boolean">
  This indicates if the order was imported.
</ResponseField>

<ResponseField name="customer_email" type="string">
  This is the email of the customer.
</ResponseField>

<ResponseField name="source" type="string">
  This is the source of the order.
</ResponseField>

<ResponseField name="buyer_email" type="string">
  This is the email of the buyer.
</ResponseField>

<ResponseField name="buyer_message" type="string">
  This is a message from the buyer.
</ResponseField>

<ResponseField name="cancel_order_sla_time" type="string">
  This is the SLA time for cancelling the order.
</ResponseField>

<ResponseField name="cancel_reason" type="string">
  This is the reason for cancellation, if applicable.
</ResponseField>

<ResponseField name="cancellation_initiator" type="string">
  This is who initiated the cancellation, if applicable.
</ResponseField>

<ResponseField name="fulfillment_type" type="string">
  This is the type of fulfillment for the order.
</ResponseField>

<ResponseField name="delivery_type" type="string">
  This is the type of delivery for the order.
</ResponseField>

<ResponseField name="is_cod" type="boolean">
  This indicates if the order is cash on delivery.
</ResponseField>

<ResponseField name="is_replacement_order" type="boolean">
  This indicates if this is a replacement order.
</ResponseField>

<ResponseField name="seller_note" type="string">
  This is a note from the seller.
</ResponseField>

<ResponseField name="status" type="string">
  This is the current status of the order.
</ResponseField>

<ResponseField name="tracking_number" type="string">
  This is the tracking number for the order.
</ResponseField>

<ResponseField name="warehouse_id" type="string">
  This is the id of the warehouse handling the order.
</ResponseField>

<ResponseField name="order_line_items" type="array">
  These are the line items associated with the order.

  <Expandable title="Show child attributes">
    <ResponseField name="id" type="string">
      This is the id of the order line item.
    </ResponseField>

    <ResponseField name="wholesale_order_id" type="string">
      This is the id of the associated wholesale order.
    </ResponseField>

    <ResponseField name="product_name" type="string">
      This is the name of the product.
    </ResponseField>

    <ResponseField name="quantity" type="string">
      This is the quantity of the product ordered.
    </ResponseField>

    <ResponseField name="created_date" type="string">
      This is the date the line item was created.
    </ResponseField>

    <ResponseField name="updated_date" type="string">
      This is the date the line item was last updated.
    </ResponseField>

    <ResponseField name="unit" type="string">
      This is the unit of measurement for the product.
    </ResponseField>

    <ResponseField name="product_id" type="string">
      This is the id of the product.
    </ResponseField>

    <ResponseField name="brand" type="string">
      This is the brand of the product.
    </ResponseField>

    <ResponseField name="stock_code" type="string">
      This is the stock code of the product.
    </ResponseField>

    <ResponseField name="size" type="string">
      This is the size of the product.
    </ResponseField>

    <ResponseField name="status" type="string">
      This is the status of the line item.
    </ResponseField>

    <ResponseField name="sale_price" type="integer">
      This is the sale price of the product.
    </ResponseField>

    <ResponseField name="seller_discount" type="integer">
      This is the discount offered by the seller.
    </ResponseField>

    <ResponseField name="seller_sku" type="string">
      This is the seller's SKU for the product.
    </ResponseField>

    <ResponseField name="sku_id" type="string">
      This is the SKU id of the product.
    </ResponseField>

    <ResponseField name="sku_image" type="string">
      This is the image URL for the product SKU.
    </ResponseField>

    <ResponseField name="sku_name" type="string">
      This is the name of the product SKU.
    </ResponseField>

    <ResponseField name="sku_type" type="string">
      This is the type of the product SKU.
    </ResponseField>

    <ResponseField name="original_price" type="integer">
      This is the original price of the product.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.stateset.com/v1/order/retrieve' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": "ord_1NXWPnCo6bFb1KQto6C8OWvE",
  }'
  ```

  ```graphQL GraphQL theme={null}
  query ($id: UUID!) {
    order(id: $id) {
      id
      name
      order_number
      created_date
      updated_date
      order_status
      imported_status
      delivery_date
      ordered_by
      delivery_address
      notes
      imported_date
      customer_number
      customer_name
      import
      customer_email
      source
      buyer_email
      buyer_message
      cancel_order_sla_time
      cancel_reason
      cancellation_initiator
      fulfillment_type
      delivery_type
      is_cod
      is_replacement_order
      seller_note
      status
      tracking_number
      warehouse_id
      order_line_items {
        id
        wholesale_order_id
        product_name
        quantity
        created_date
        updated_date
        unit
        product_id
        brand
        stock_code
        size
        status
        sale_price
        seller_discount
        seller_sku
        sku_id
        sku_image
        sku_name
        sku_type
        original_price
      }
    }
  }
  ```

  ```js Node.js theme={null}
  const order = await stateset.orders.retrieve('ord_1NXWPnCo6bFb1KQto6C8OWvE');
  ```

  ```py Python theme={null}
  order = stateset.orders.retrieve('ord_1NXWPnCo6bFb1KQto6C8OWvE')
  ```

  ```go Golang  theme={null}
  order, err := stateset.Orders.Retrieve("ord_1NXWPnCo6bFb1KQto6C8OWvE")
  ```

  ```ruby Ruby theme={null}
  order = Stateset::Order.retrieve('ord_1NXWPnCo6bFb1KQto6C8OWvE')
  ```

  ```java Java theme={null}
  Order order = Order.retrieve("ord_1NXWPnCo6bFb1KQto6C8OWvE");
  ```

  ```csharp C# theme={null}
  var order = Order.Retrieve("ord_1NXWPnCo6bFb1KQto6C8OWvE");
  ```

  ```php PHP theme={null}
  $order = $stateset->orders->retrieve('ord_1NXWPnCo6bFb1KQto6C8OWvE');
  ```

  ```http HTTP theme={null}
  GET /v1/order/ord_1NXWPnCo6bFb1KQto6C8OWvE HTTP/1.1
  Host: api.stateset.com
  Content-Type: application/json
  Authorization: Bearer <token>
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "order": {
      "id": "ord_1NXWPnCo6bFb1KQto6C8OWvE",
      "name": "Example Order",
      "order_number": "ORD-12345",
      "created_date": "2023-08-23T10:00:00Z",
      "updated_date": "2023-08-23T11:00:00Z",
      "order_status": "Processing",
      "imported_status": "Completed",
      "delivery_date": "2023-08-30T14:00:00Z",
      "ordered_by": "John Doe",
      "delivery_address": "123 Main St, Anytown, AN 12345",
      "notes": "Please handle with care",
      "imported_date": "2023-08-23T09:00:00Z",
      "customer_number": "CUST-6789",
      "customer_name": "John Doe",
      "import": true,
      "customer_email": "john.doe@example.com",
      "source": "Online Store",
      "buyer_email": "john.doe@example.com",
      "buyer_message": "Looking forward to receiving the order!",
      "cancel_order_sla_time": null,
      "cancel_reason": null,
      "cancellation_initiator": null,
      "fulfillment_type": "Standard",
      "delivery_type": "Home Delivery",
      "is_cod": false,
      "is_replacement_order": false,
      "seller_note": "Thank you for your order",
      "status": "Processing",
      "tracking_number": "TRACK-98765",
      "warehouse_id": "wh_2MXYQoDp7cGc2LRup7D9PXvF",
      "order_line_items": [
        {
          "id": "oli_3OYZRpEq8dHd3MSvq8E0QYwG",
          "wholesale_order_id": "ord_1NXWPnCo6bFb1KQto6C8OWvE",
          "product_name": "Example Product",
          "quantity": "2",
          "created_date": "2023-08-23T10:05:00Z",
          "updated_date": "2023-08-23T10:05:00Z",
          "unit": "piece",
          "product_id": "prod_4PZaSqFr9eIe4NTwr9F1RZxH",
          "brand": "Example Brand",
          "stock_code": "EX-1234",
          "size": "Medium",
          "status": "In Stock",
          "sale_price": 2999,
          "seller_discount": 500,
          "seller_sku": "SKU-5678",
          "sku_id": "sku_6QAbTrGs0fJf5OUxs0G2SZyI",
          "sku_image": "https://example.com/images/product.jpg",
          "sku_name": "Example Product - Medium",
          "sku_type": "Standard",
          "original_price": 3499
        }
      ]
    }
  }
  ```

  ```json Error Response (404 Not Found) theme={null}
  {
    "error": {
      "code": "RESOURCE_NOT_FOUND",
      "message": "Order not found",
      "details": {
        "resource": "order",
        "id": "ord_1a2b3c4d5e6f"
      },
      "request_id": "req_abc123def456"
    }
  }
  ```

  ```json Error Response (401 Unauthorized) theme={null}
  {
    "error": {
      "code": "INVALID_API_KEY",
      "message": "The API key provided is invalid or has been revoked",
      "request_id": "req_abc123def456"
    }
  }
  ```
</ResponseExample>
