# Sales Orders Quickstart

This tutorial demonstrates a complete order fulfillment workflow: creating an order in Shopify, importing it into ShipEngine, creating a shipping label, and notifying Shopify of shipment.

Note
In-cart rates via Sales Order API require a Shopify Plus account.

## Workflow Steps

### 1. Create an Order in Shopify

Create a test order in Shopify. The generated order ID becomes the `external_order_id` when imported into ShipEngine.

### 2. Refresh the Order Source

Trigger ShipEngine to import the newly created order:


```http
PUT /v-beta/order_sources/__YOUR_ORDER_SOURCE_ID_HERE__/refresh HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
```

### 3. Query Sales Orders

Find your order by sorting descending by order date:


```http
GET /v-beta/sales_orders?order_source_id=__YOUR_ORDER_SOURCE_ID_HERE__&sort_dir=desc&sort_by=order_date&page=1&page_size=1 HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
```

Or query directly by `external_order_id`:


```http
GET /v-beta/sales_orders?external_order_id=1011295486011 HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
```

### 4. Create Label from Sales Order

Use the `sales_order_id` from the previous response:


```http
POST /v-beta/labels/sales_order/:sales_order_id HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
```


```json
{
  "label_format": "pdf",
  "shipment": {
    "carrier_id": "se-123890",
    "service_code": "usps_priority_mail",
    "ship_from": {
      "company_name": "Example Corp.",
      "name": "John Doe",
      "phone": "111-111-1111",
      "address_line1": "4009 Marathon Blvd",
      "city_locality": "Austin",
      "state_province": "TX",
      "postal_code": "78756",
      "country_code": "US"
    },
    "packages": [{
      "package_code": "package",
      "weight": {
        "value": 2,
        "unit": "pound"
      }
    }]
  }
}
```

### 5. Notify Order Source of Shipment

Inform Shopify the order has shipped:


```http
POST /v-beta/sales_orders/:sales_order_id/notify_shipped HTTP/1.1
Host: api.shipengine.com
API-Key: __YOUR_API_KEY_HERE__
Content-Type: application/json
```


```json
{
  "tracking_number": "9374869901600064074368",
  "carrier_code": "usps",
  "sales_order_items": [{
    "sales_order_item_id": ":sales_order_item_id",
    "quantity": 1
  }]
}
```

Successful submission returns **HTTP 204 No Content**. Refresh your order source to update the sales order status.