Orders

Markdown

View as Markdown

A store's orders: find and read them, create them, move them through the store's workflow, and add notes to them.

All paths are relative to the base URL https://api.store.link/v1. Every request needs your API key; see Overview.

Endpoints

EndpointWhat it does
GET /stores/{storeId}/ordersList orders
POST /stores/{storeId}/ordersCreate an order
GET /stores/{storeId}/orders/{orderId}Get an order
PATCH /stores/{storeId}/orders/{orderId}Change an order's status
POST /stores/{storeId}/orders/{orderId}/notesAdd a note to an order

List orders

GET /stores/{storeId}/orders

Orders, newest first. Orders over the plan's monthly limit are left out and counted in hidden_by_plan.

Your role in the store needs to read orders.

Path parameters

NameTypeDescription
storeIdstring
required
A store id from GET /stores.

Query parameters

NameTypeDescription
statusstringOne of: pending, shipped, completed, cancelled.
searchstringCustomer name, email, phone or order number.
pageintegerDefault: 1. At least 1.
limitintegerDefault: 25. 1 to 100.

Example request

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/orders' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

FieldTypeDescription
dataarray of object
data[].idstring
data[].numberstring, nullableThe order number the customer sees, e.g. "1042". Test orders have test_ numbers.
data[].statusstringdelivered appears only on older orders. One of: pending, shipped, completed, cancelled, delivered.
data[].payment_statusstring, nullableOne of: pending, paid, failed.
data[].customerobject
data[].customer.namestring, nullable
data[].customer.emailstring, nullable
data[].customer.phonestring, nullable
data[].currencystring, nullableISO 4217 code.
data[].totalnumber, nullable
data[].item_countinteger
data[].testbooleanPlaced while the store was in test mode.
data[].created_atstring (date-time)
data[].updated_atstring (date-time)
pageintegerGreater than 0.
limitintegerGreater than 0.
totalinteger
has_moreboolean
hidden_by_planintegerOrders over the plan's monthly limit, left out of the list.

Example response

{
  "data": [
    {
      "id": "6661a0d3c2f1b80013cd56ef",
      "number": "1042",
      "status": "pending",
      "payment_status": "pending",
      "customer": {
        "name": "Jane Doe",
        "email": "[email protected]",
        "phone": "+14155550123"
      },
      "currency": "USD",
      "total": 50,
      "item_count": 2,
      "test": false,
      "created_at": "2026-11-20T10:15:00.000Z",
      "updated_at": "2026-11-20T10:15:00.000Z"
    }
  ],
  "page": 1,
  "limit": 25,
  "total": 50,
  "has_more": true,
  "hidden_by_plan": 0
}

Errors

The common errors: 400 invalid_request, 401 unauthorized, 403 insufficient_permission, 404 store_not_found, 429 rate_limited, 500 internal_error. See Errors in the Overview.

Create an order

POST /stores/{storeId}/orders

Creates an order for a customer, as the dashboard's Create order page does. Storelink prices it from the store's current products, the coupon and the shipping method, and records payment as cash with no payment status.

Creating it deducts stock, emails the receipt to the customer (when there is an email) and to the store, counts a use of the coupon, and adds the order to the Order Sheet.

Send an Idempotency-Key header: a request with a key the store already has an order for returns that order and does nothing else, so a retry can't create the order twice.

Your role in the store needs to write orders.

Path parameters

NameTypeDescription
storeIdstring
required
A store id from GET /stores.

Headers

NameTypeDescription
Idempotency-Keystring
required
Any unique string you choose, e.g. a UUID or your own order id. Up to 255 characters.

Request body

FieldTypeDescription
itemsarray of object
required
At least 1 item.
items[].slugstring
required
A product slug from GET /stores/{storeId}/products.
items[].variant_keystringA variant key from GET /stores/{storeId}/products/{slug}; leave out for a product with one variant.
items[].qtyinteger
required
Greater than 0.
customerobject
required
customer.namestring
required
customer.emailstring (email)Gets the receipt.
customer.phonestring
shipping_methodstringA shipping method label from GET /stores/{storeId}; leave out for none.
addressstringThe delivery address, or for pickup one of the method's pickup_locations.
zip_codestring
coupon_codestring

Example request

curl -X POST 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/orders' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: 3f1c9a7e-2b4d-4e8f-9a6b-1c2d3e4f5a6b' \
  -H 'Content-Type: application/json' \
  -d '{
  "items": [
    {
      "slug": "classic-tee",
      "variant_key": "M-Black",
      "qty": 2
    }
  ],
  "customer": {
    "name": "Jane Doe",
    "email": "[email protected]",
    "phone": "+14155550123"
  },
  "shipping_method": "Standard delivery",
  "address": "221 Market St, San Francisco, CA",
  "zip_code": "94105",
  "coupon_code": "WELCOME10"
}'

Response

FieldTypeDescription
idstring
numberstring, nullableThe order number the customer sees, e.g. "1042". Test orders have test_ numbers.
statusstringdelivered appears only on older orders. One of: pending, shipped, completed, cancelled, delivered.
payment_statusstring, nullableOne of: pending, paid, failed.
customerobject
customer.namestring, nullable
customer.emailstring, nullable
customer.phonestring, nullable
currencystring, nullableISO 4217 code.
totalnumber, nullable
item_countinteger
testbooleanPlaced while the store was in test mode.
created_atstring (date-time)
updated_atstring (date-time)
itemsarray of object
items[].namestring
items[].variantstring, nullable
items[].quantitynumber
items[].pricenumber, nullable
items[].totalnumber, nullable
subtotalnumber, nullable
shipping_feenumber, nullable
discountnumber, nullable
coupon_codestring, nullable
shipping_methodstring, nullable
addressstring, nullable
zip_codestring, nullable
payment_methodstring, nullable
checkout_fieldsobject (map)The customer's other answers at checkout, by checkout field id.
timelinearray of objectNewest first.
timeline[].statusstring, nullable
timeline[].titlestring, nullable
timeline[].notestring, nullable
timeline[].datestring (date-time), nullable

Example response

{
  "id": "6661a0d3c2f1b80013cd56ef",
  "number": "1042",
  "status": "pending",
  "payment_status": "pending",
  "customer": {
    "name": "Jane Doe",
    "email": "[email protected]",
    "phone": "+14155550123"
  },
  "currency": "USD",
  "total": 50,
  "item_count": 2,
  "test": false,
  "created_at": "2026-11-20T10:15:00.000Z",
  "updated_at": "2026-11-20T10:15:00.000Z",
  "items": [
    {
      "name": "Classic Tee",
      "variant": "M / Black",
      "quantity": 2,
      "price": 25,
      "total": 50
    }
  ],
  "subtotal": 45,
  "shipping_fee": 5,
  "discount": 0,
  "coupon_code": "WELCOME10",
  "shipping_method": "Standard delivery",
  "address": "221 Market St, San Francisco, CA",
  "zip_code": "94105",
  "payment_method": "Cash on delivery",
  "checkout_fields": {
    "gift_note": "Please gift wrap it"
  },
  "timeline": [
    {
      "status": "pending",
      "title": "Order placed",
      "note": null,
      "date": "2026-11-20T10:15:00.000Z"
    }
  ]
}

Errors

  • 404 not_found: Nothing with this id in this store, or something the body names, such as a product or coupon, is not there.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403 insufficient_permission, 404 store_not_found, 429 rate_limited, 500 internal_error. See Errors in the Overview.

Get an order

GET /stores/{storeId}/orders/{orderId}

One order with its items, totals, customer details and timeline.

Your role in the store needs to read orders.

Path parameters

NameTypeDescription
storeIdstring
required
A store id from GET /stores.
orderIdstring
required
An order id from GET /stores/{storeId}/orders. A 24-character id.

Example request

curl 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/orders/6661a0d3c2f1b80013cd56ef' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

The order, with the fields listed under Create an order above.

Errors

  • 404 not_found: Nothing with this id in this store, or something the body names, such as a product or coupon, is not there.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403 insufficient_permission, 404 store_not_found, 429 rate_limited, 500 internal_error. See Errors in the Overview.

Change an order's status

PATCH /stores/{storeId}/orders/{orderId}

Changes the status, adds it to the order's timeline and emails the customer, as the dashboard does. Sending the order's current status changes nothing and emails nobody, so a retry is safe.

Your role in the store needs to write orders.

Path parameters

NameTypeDescription
storeIdstring
required
A store id from GET /stores.
orderIdstring
required
An order id from GET /stores/{storeId}/orders. A 24-character id.

Request body

FieldTypeDescription
statusstring
required
Digital and service stores complete orders; every other store ships them. One of: pending, shipped, completed, cancelled.
notestringA tracking number or message for the customer, shown in the email and timeline.

Example request

curl -X PATCH 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/orders/6661a0d3c2f1b80013cd56ef' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "status": "shipped",
  "note": "Tracking number 1Z999AA10123456784"
}'

Response

The order, with the fields listed under Create an order above.

Errors

  • 400 invalid_status: The status isn't one this store's orders move through.
  • 404 not_found: Nothing with this id in this store, or something the body names, such as a product or coupon, is not there.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403 insufficient_permission, 404 store_not_found, 429 rate_limited, 500 internal_error. See Errors in the Overview.

Add a note to an order

POST /stores/{storeId}/orders/{orderId}/notes

Adds a note to the order's timeline under its current status, and emails it to the customer when notify_customer is true and the order has an email. With an Idempotency-Key header, a repeat of a note already added with that key adds and emails nothing.

Your role in the store needs to write orders.

Path parameters

NameTypeDescription
storeIdstring
required
A store id from GET /stores.
orderIdstring
required
An order id from GET /stores/{storeId}/orders. A 24-character id.

Headers

NameTypeDescription
Idempotency-KeystringAny unique string you choose, e.g. a UUID or your own order id. Up to 255 characters.

Request body

FieldTypeDescription
notestring
required
titlestringDefault: "Order update".
notify_customerbooleanEmail the note to the customer. Default: false.

Example request

curl -X POST 'https://api.store.link/v1/stores/665f1c2ab4e8a90012ab34cd/orders/6661a0d3c2f1b80013cd56ef/notes' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: 3f1c9a7e-2b4d-4e8f-9a6b-1c2d3e4f5a6b' \
  -H 'Content-Type: application/json' \
  -d '{
  "note": "Your order is packed and ships tomorrow.",
  "title": "Order update",
  "notify_customer": true
}'

Response

The order, with the fields listed under Create an order above.

Errors

  • 404 not_found: Nothing with this id in this store, or something the body names, such as a product or coupon, is not there.

Plus the common errors: 400 invalid_request, 401 unauthorized, 403 insufficient_permission, 404 store_not_found, 429 rate_limited, 500 internal_error. See Errors in the Overview.

Related Articles

Was this article helpful?