Skip to content

List the line items of a sales order or quote

Open .md

GET/v2/api/store/{team_slug}/v2/sales_order/{order_unique_key}/order_item

v2Operation ID v2_public_order_item_index

Returns every line of a sales order or quote: products, custom lines and fees, with their quantities and prices.

{order_unique_key} is the sales order or quote id (for example V4keXwwxMQyXw7) or its unique_key (it starts with ord_). The order number people see, such as SO1001, is not accepted here.

The answer is the full list in data, not paginated, sorted by position ascending as the web app shows them. Each line has the same groups you send when adding one (product, pricing, quantity, job, weight, position), plus unit_price, subtotal, stock details and _meta. Prices and quantities are { value, dp } pairs (the amount is value ÷ 10^dp), and answers keep the stored scale: prices have 6 decimal places (12.50 is { "value": 12500000, "dp": 6 }), subtotals 4, weights 8; quantities drop trailing zeros (24 is { "value": 24, "dp": 0 }).

Permission

Any member of the team.

Path parameters

  • team_slugstringrequired

    Your team slug, shown as Team ID next to your API key in Profile.

    • Example your-team
  • order_unique_keystringrequired

    The sales order's or quote's id (a hash id), or its unique_key (ord_…). The order number (scoped_id) does not work.

    • Example V4keXwwxMQyXw7

Request body

This operation takes no request body.

Response

200Successful response.

  • dataarray of objectsrequired
    Fields of each item (16)
    • _metaobject

      The line's own values again (id, type, order_id, unit_price, subtotal and so on). Always an object.

    • idstring
    • inventory_statusstring | null

      Stock status of the line.

    • jobobject
    • lock_versioninteger | null

      The line's own lock version (a microsecond timestamp).

    • order_idstring
    • The order's unique_key. The line's own unique_key is not in the answer: use id.

    • positioninteger
    • pricingobject
    • The pricing rule that set the line's product price, or null when no rule did. List the line items, Get one line item and the bulk save answer with the full summary below. Other answers carry only type, the two ids and the two totals.

      Child fields (12)
      • afterstring

        Full summary only: the price after the rule, as a decimal string.

      • after_totaldecimal pair

        The product price per unit after the rule. 6 decimal places. A decimal pair: the amount is value ÷ 10^dp ({ "value": 1250, "dp": 2 } is 12.50). Read dp every time: it can differ between fields and records.

      • basestring

        Full summary only: that starting price, as a decimal string with at least 2 decimal places.

      • base_typestring

        Full summary only: what the rule started from: the supplier price for catalog lines, the product's own price for other lines.

        • One of: "supplier_price", "base_price"
      • normal_pricestring | null

        Full summary only: what the line would cost with no rule. For catalog lines the supplier price plus the group's catalog markup as it is now; otherwise the same as base.

      • original_totaldecimal pair

        The product price per unit before the rule. 6 decimal places. A decimal pair: the amount is value ÷ 10^dp ({ "value": 1250, "dp": 2 } is 12.50). Read dp every time: it can differ between fields and records.

      • pricing_group_idstring | null

        The pricing group whose rule applied.

      • pricing_group_namestring | null

        Full summary only: the group's name now.

      • pricing_group_removedboolean | null

        Full summary only: true when the group was removed since. The line keeps its price.

      • pricing_rule_idstring | null

        The rule that applied.

      • ruleobject | null

        Full summary only: the rule as the group holds it now, with its current name and position (1 is the first rule checked). Null when the rule no longer exists.

        Child fields (3)
      • typestring

        product on a line.

    • productobject
    • quantityobject

      The quantity, trailing zeros dropped: 10 is { "value": 10, "dp": 0 }.

    • subtotaldecimal pair

      unit_price times the quantity. 4 decimal places: 125.00 is { "value": 1250000, "dp": 4 }. A decimal pair: the amount is value ÷ 10^dp ({ "value": 1250, "dp": 2 } is 12.50). Read dp every time: it can differ between fields and records.

    • trashedboolean

      true when the line was deleted.

    • typestring

      The kind of line: db_catalog, user_simple, db_variant, custom or fee.

    • unit_pricedecimal pair

      The price of one unit: the product price plus the decoration price. 6 decimal places: 12.50 is { "value": 12500000, "dp": 6 }. A decimal pair: the amount is value ÷ 10^dp ({ "value": 1250, "dp": 2 } is 12.50). Read dp every time: it can differ between fields and records.

  • statusintegerrequired
  • successbooleanrequired

Errors

  • 401The API key is missing or wrong (unauthenticated).

  • 403You are not allowed to do this. api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only {"message": "Insufficient Permission"}. Other refusals use the error envelope, with unauthorized or user_is_not_authorized.

  • 404Not found. page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. code: null, with a message that starts "No query results for": there is no record with that id.

Notes

  • Deleted lines are not listed.
  • A simple-product line from the older editor reads db_simple in product.type; new lines read user_simple. Treat both as Custom simple product.
  • A line's pricing._meta.editable_fields_on_update and product._meta.editable_fields_on_update list the request paths an update accepts for that group. pricing.type is listed, but it must stay the line's own.