xPlantAPI
API referencePricing and sell-through

List order lines

Your store's sales, line by line, most recent first: which product sold, the culture line it is matched to, how many, at what unit price, and when. Filter with from and to for a period and product_link_id for one product.

GET/api/v1/commerce/order-lines
Scope read:commerce

Order lines carry no buyer details — no names, email or postal addresses — and leave out your store's order numbers. For totals, use the sell-through summary rather than adding these lines up: amounts are exact decimal text, and lines in different currencies must never be added together.

Needs culture line pricing, which includes sell-through, in the workspace's plan; without it the answer is FEATURE_NOT_INCLUDED.

Query parameters

NameTypeRequiredDescription
fromstring (date-time)NoOnly sales at or after this time, as an ISO 8601 timestamp.
tostring (date-time)NoOnly sales at or before this time, as an ISO 8601 timestamp.
product_link_idstring (uuid)NoOnly lines for this store product, by the product_link_id an order line carries.
limitintegerNoPage size. Values above 200 are capped at 200. Default 50. From 1 to 200.
offsetintegerNoNumber of records to skip. Prefer cursor where a list offers it: an offset shifts when records are added ahead of it. Default 0. At least 0.
cursorstringNoContinue from the previous page: pass its meta.next_cursor unchanged, with the same filters. Treat it as opaque. Not combinable with offset. Up to 2048 characters.

Example

curl "https://app.xplantpro.com/api/v1/commerce/order-lines?from=2026-09-01T00%3A00%3A00Z&to=2026-09-25T00%3A00%3A00Z" \
  -H "Authorization: Bearer $XPLANT_API_KEY"

Response

200 with { "ok": true, "data": … }. data is an array. To get the next page, pass meta.next_cursor back as cursor; it is null on the last page. See Pagination.

FieldTypeRequiredDescription
idstring (uuid)Yes—
product_link_idstring | null (uuid)YesThe store product this line sold, as xPlant tracks it; null when it is not tracked yet. Pass it as product_link_id to list that product's lines.
plant_idstring | null (uuid)YesThe culture line the product is matched to (a plant id). Null until someone in the lab matches the product.
store_product_idstring | nullYesYour store's own id for the product.
store_variant_idstring | nullYesYour store's own id for the variant, when the product has variants.
quantityintegerYes—
unit_priceobject | nullYesThe price per unit, with its currency. Null when your store reported none.
occurred_atstring | nullYesWhen the sale happened in your store, as an ISO 8601 timestamp in UTC.
Response
{
  "ok": true,
  "data": [
    {
      "id": "9b3d5f7a-1c2e-4a4b-8d6f-0e2a4c6e8b1d",
      "product_link_id": "f2a4c6e8-0b1d-4e3f-a5b7-c9d1e3f5a7b9",
      "plant_id": "6d1b3f8a-4c2e-4a97-b5d0-8e7f2a1c9b43",
      "store_product_id": "prod-5521",
      "store_variant_id": "var-5521-4in",
      "quantity": 3,
      "unit_price": {
        "amount": "18.50",
        "currency": "USD"
      },
      "occurred_at": "2026-09-21T15:02:44.000Z"
    }
  ]
}

The envelope can also carry meta:

FieldTypeRequiredDescription
next_cursorstring | nullYesPass as cursor to fetch the next page. null means this is the last page.
Response headerMeaning
X-Request-IdIdentifies this request. Include it when you contact support.

Errors

StatusCodeWhen
401UNAUTHORIZEDThe key is missing, malformed or revoked, or its owner is no longer a member of the workspace.
402PAID_PLAN_REQUIREDThe workspace's plan does not include the API. The full API is included with xPlant+ Teams and Enterprise; on Hobby and Pro Lab, keys can connect devices only.
402FEATURE_NOT_INCLUDEDCulture line pricing, which includes sell-through, is not included in your plan.
403FORBIDDENThe key lacks a scope this operation requires, or its owner's current role in the workspace cannot use it — a key never does more than its owner can in xPlant. error names the scope, and for a role, the role it needs.
403DEVICE_TOKEN_NOT_ACCEPTEDA device token was sent; this operation needs a workspace API key.
404NOT_FOUNDproduct_link_id names no store product in the key's workspace.
422VALIDATION_ERRORBoth cursor and offset were sent; use one.
422INVALID_CURSORThe cursor is malformed, or came from a different list or different filters. Start again without it.
422VALIDATION_ERRORA query parameter is malformed, or from is later than to. error names it.
429RATE_LIMIT_EXCEEDEDToo many requests for this key, device token or workspace. Wait Retry-After seconds.
500FEATURE_CHECK_FAILEDYour plan could not be checked. Retry later.
500SELL_THROUGH_EVENT_QUERY_FAILEDThe sales could not be read. Retry later.

Branch on code, never on the error text. See Errors.

On this page