xPlantAPI
API referencePricing and sell-through

Get sell-through

Units sold and revenue per culture line over a period, highest units first. Filter with from and to for the period and plant_id for one culture line.

GET/api/v1/commerce/sell-through
Scope read:commerce

Each group is one culture line in one currency. There is no combined total across currencies: groups in different currencies are separate figures and must not be added together. Revenue is exact decimal text, totalled from the recorded sales without floating-point rounding.

Pages by offset. 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.
plant_idstring (uuid)NoOnly this culture line's sales. A culture line is identified by its plant id.
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.

Example

curl "https://app.xplantpro.com/api/v1/commerce/sell-through?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. Lists have no total: a page shorter than your limit is the last one. See Pagination.

FieldTypeRequiredDescription
plant_idstring | null (uuid)YesThe culture line (a plant id). Null groups the sales of store products not yet matched to one.
currencystring | nullYesThe currency of every amount in this group. Null for lines that carried none.
unitsintegerYesTotal quantity sold.
revenueobjectYes—
revenue.amountstringYesAn exact decimal, as text — for example "1250.00". Never a floating-point number; parse it with a decimal type.
revenue.currencystring | nullYesISO 4217 currency code, for example USD. Null only when the record carries no currency. Never add amounts in different currencies.
order_line_countintegerYes—
priced_line_countintegerYesOrder lines that carried a unit price. Lines without one count toward units but not revenue.
first_occurred_atstring | nullYesThe earliest sale in the group.
last_occurred_atstring | nullYesThe latest sale in the group.
Response
{
  "ok": true,
  "data": [
    {
      "plant_id": "6d1b3f8a-4c2e-4a97-b5d0-8e7f2a1c9b43",
      "currency": "USD",
      "units": 42,
      "revenue": {
        "amount": "777.00",
        "currency": "USD"
      },
      "order_line_count": 17,
      "priced_line_count": 17,
      "first_occurred_at": "2026-07-02T10:11:00.000Z",
      "last_occurred_at": "2026-09-21T15:02:44.000Z"
    },
    {
      "plant_id": "6d1b3f8a-4c2e-4a97-b5d0-8e7f2a1c9b43",
      "currency": "EUR",
      "units": 6,
      "revenue": {
        "amount": "96.00",
        "currency": "EUR"
      },
      "order_line_count": 2,
      "priced_line_count": 2,
      "first_occurred_at": "2026-08-14T08:30:00.000Z",
      "last_occurred_at": "2026-09-03T12:45:10.000Z"
    }
  ]
}
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_FOUNDplant_id names no culture line in the key's workspace.
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