---
updatedAt: 2026-10-24T16:40:53.000Z
agentTools:
  projectIndex: https://docs.yotpo.com/llms.txt
---

# Sync an order and its fulfillment

```shell cURL
# 1. Create an order
curl -X POST "https://api.yotpo.com/core/v3/stores/YOUR_STORE_ID/orders" \
  -H "Content-Type: application/json" \
  -H "X-Yotpo-Token: YOUR_ACCESS_TOKEN" \
  -d '{
    "order": {
      "external_id": "000000002",
      "order_date": "2026-08-20T13:57:05Z",
      "customer": {
        "external_id": "ak123798684365sdfkj",
        "email": "name@example.com",
        "first_name": "Tom",
        "last_name": "Smith"
      },
      "line_items": [
        {
          "quantity": 1,
          "external_product_id": "23234"
        }
      ]
    }
  }'
# Response: { "order": { "yotpo_id": 1 } }

# 2. Fulfill the order (use the order yotpo_id from step 1)
curl -X POST "https://api.yotpo.com/core/v3/stores/YOUR_STORE_ID/orders/YOTPO_ORDER_ID/fulfillments" \
  -H "Content-Type: application/json" \
  -H "X-Yotpo-Token: YOUR_ACCESS_TOKEN" \
  -d '{
    "fulfillment": {
      "external_id": "4444444",
      "fulfillment_date": "2026-08-21T11:58:51Z",
      "status": "success",
      "fulfilled_items": [
        {
          "external_product_id": "23234",
          "quantity": 1
        }
      ]
    }
  }'
```

```json Response Example
{
  "order": { "yotpo_id": 1 }
}
```

# Create the order

<!-- shell@1-23 -->

Four fields are required: `external_id`, `order_date`, `customer`, and `line_items`. Line items reference products by `external_product_id` — the same `external_id` you used when creating products (see the Initial store sync recipe). The response returns the order's `yotpo_id`. A 409 means an order with this `external_id` already exists.

# Create the fulfillment

<!-- shell@24-41 -->

Fulfillments are created under the order — put the order's `yotpo_id` from step 1 in the URL path (replace `YOTPO_ORDER_ID`). Required: `external_id`, `fulfillment_date`, `status`, and `fulfilled_items`. Fulfillment is what typically triggers downstream flows like review request emails, so send it when the order actually ships.