Skip to content

Update a line item

Open .md

PUT/v2/api/store/{team_slug}/v2/sales_order/order_item/{order_item_unique_key}

v2Operation ID v2_public_order_item_update

Changes one line and recalculates the order's totals. Send only what changes; everything you leave out keeps its value.

The line's kind can't change: if you send product.type or pricing.type, it must be the line's own. Each object you send (product, pricing, quantity, job, weight) must include its type.

What an update can change:

  • the quantity;
  • the price: pricing.product (your own price), pricing.service (decoration price), pricing.product_cost, and for catalog lines pricing.catalog;
  • the job (job), within the same order;
  • the position and the weight;
  • the line's description, and the name of a custom line or fee.

The product itself (its id, or the catalog item) and customer_supplied can't change: delete the line and add a new one.

Amounts and quantities are sent as { value, dp } pairs: value is the number without its decimal point and dp is how many of its digits come after the decimal point. 12.50 is { "value": 1250, "dp": 2 }; 24 is { "value": 24, "dp": 0 }. value is a whole number (a JSON integer or a string of digits); dp is 0 to 30.

{order_item_unique_key} is the line's id (a hash id) from the order's line items. Its orditm_ unique key is also accepted, but no API answer shows it, so use id.

The answer is data.item, the saved line, with action_performed UPDATED, or NONE and has_changes: false when nothing changed.

Permission

Needs permission to edit this sales order or quote:

  • The team owner
  • A role with update_all_order
  • A role with update_self_order, when the order was created by or is assigned to the API key's user
  • The person who created a draft, with create_order

Quotes use the same sales order permissions.

Business rules

  • product.type, when sent, must equal the line's own: 422 cart_item_validation_error "Cannot update the product type. It should be the same as the existing product type. …". pricing.type, when sent, must be the one for the line's kind: 422 validation_failed on pricing.type.
  • Every object you send needs its type, for example {"pricing": {"type": "fee", ...}}; otherwise 422 "The pricing.type field is required."
  • When pricing.product.override changes, a pricing.product.total you send is taken as the new amount (up to 6 decimal places); leave total out and the stored amount is kept.
  • Lines an integration brought in only accept job and position changes.
  • A simple-product line from the older editor has product.type db_simple, which an update can't send: leave product out when you change such a line.
  • Moving a line to another job, or changing its quantity, is refused while that job's decoration setup needs repair.

Side effects

  • Recalculates the line's price, every job's decoration pricing (quantity breaks count all lines on a job), the order totals, profit, margin and deposit.
  • Updates stock tracking for the line (inventory status and stock workflow), and, on a published sales order, reserves or releases stock as quantities change.
  • Updates this line on the order's invoices (new price, excess quantity removed); when the order keeps its invoice up to date automatically, rebuilds that invoice. Rebalances payments across the invoices.
  • On a published sales order with QuickBooks Online connected, queues the order's QuickBooks sync.
  • Refreshes the order for people who have it open in the web app. No email is sent.
  • Lowering the quantity releases stock reservations and removes the excess from the order's shipments and invoices; raising it on a published sales order reserves more.

Path parameters

  • team_slugstringrequired

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

    • Example your-team
  • order_item_unique_keystringrequired

    The line's id (a hash id), from the order's line items. Its orditm_… unique key is also accepted, but no API answer shows it, so use id.

    • Example Owr88lhAk28aqL

Request body

application/json, required.

What kind of line are you changing?

Send any of these 5 bodies. Picked by product.type.

db_catalog
Catalog product

Catalog product

Change a product from a supplier catalog (one size and color).

  • productobject

    What the line is. type picks the kind of line and can't change later.

    Child fields (2)
    • typestringrequired
      • Always "db_catalog"
    • Child fields (1)
      • Extra text shown under the line, for example a note about the color.

  • jobobject

    Which job of this order the line belongs to. Decoration prices and quantity breaks count every line on a job, so put all sizes of a product on the same job.

    One of, picked by type:

    Linked to a joblinked

    The line belongs to one of this order's jobs and takes its decoration price.

    • typestringrequired
      • Always "linked"
    • idstringrequired

      The job's id, from the order's jobs. It must be a job of this same order.

    No jobstandalone

    The line has no job, so no decoration price.

    • typestringrequired
      • Always "standalone"
  • positioninteger

    Where the line sits on the order: lines are shown by ascending position. The web app spaces lines 100000 apart, which leaves room to insert between them. A value outside the allowed range is replaced by the next free position at the end.

  • pricingobject

    How the line is priced. YoPrint determines the product price in this order:

    1. Price override: if product.override is true, YoPrint uses product.total.
    2. Customer-supplied: if customer_supplied is true (product.properties.customer_supplied), the product price is 0.
    3. Marked-up cost: otherwise, YoPrint takes the supplier cost in catalog and applies the order's pricing group markup or a matching pricing rule.

    On an update, catalog is optional; send it to change the supplier cost.

    Child fields (4)
    • typestringrequired
      • Always "catalog_product_pricing"
    • catalogobject

      The supplier price the line starts from. When you send catalog, all four fields are required.

      Child fields (4)
      • datestring (date)required

        When the price was looked up, an ISO 8601 date such as 2026-11-03 (a date-time is accepted too).

      • providerstringrequired

        The supplier code, such as smr or ssa: the code the catalog item id starts with (smr for smr-10001), and the provider of that item in its product's attr_data. YoPrint stores it as sent and doesn't check it against your suppliers.

      • selectedstringrequired

        Which supplier price total represents:

        • piece: standard piece price
        • dozen: dozen price tier
        • case: case price tier
        • account: your account's negotiated price (your_price in catalog lookups)
        • sales: the supplier's sale price (sales_price in catalog lookups)
        • custom: a custom cost you entered manually
        • legacy: lines migrated from the old editor
        • One of: "piece", "dozen", "case", "account", "sales", "custom", "legacy"
      • totaldecimal pairrequired

        The supplier's cost for one unit.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
    • productobject

      Set your own product price for one unit with override: true and total. It replaces the marked-up catalog cost.

      Child fields (2)
      • overridebooleanrequired

        true to use total as given; false to let YoPrint work it out.

      • totaldecimal pair

        The amount for one unit, as a { value, dp } pair. Up to 6 decimal places are kept.

    • serviceobject

      The decoration price added to each unit. Leave it out, or send override: false, to use the job's decoration price per unit. Send override: true with total to set your own. Ignored when the line has no job (job.type standalone).

      Child fields (2)
      • overridebooleanrequired

        true to use total instead of the job's decoration price.

      • totaldecimal pair

        The decoration price for one unit. Required when override is true. Up to 6 decimal places.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
  • quantityobject

    How many units. type is always unit.

    Child fields (2)
    • typestringrequired
      • Always "unit"
    • totaldecimal pair

      The quantity as a { value, dp } pair: 24 is { "value": 24, "dp": 0 }. Up to 8 decimal places.

  • weightobject

    Optional, used for shipping. Leave it out to use the product's weight.

    One of, picked by type:

    Use the product's weightuse_system

    Take the weight from the product (in lb).

    • typestringrequired
      • Always "use_system"
    Set the weightmass

    Your own weight for one unit. unit is required; leave total out to keep the current weight.

    • typestringrequired
      • Always "mass"
    • unitstringrequired
      • One of: "lb", "kg"
    • totaldecimal pair

      The weight as a { value, dp } pair whose two parts are strings: 1.5 is { "value": "15", "dp": "1" }.

Example request

curl
curl -X PUT 'https://secure.yoprint.com/v2/api/store/your-team/v2/sales_order/order_item/Owr88lhAk28aqL' \  -H 'Authorization: Bearer YOUR_API_KEY' \  -H 'Accept: application/json' \  -H 'X-Yoprint-Decimal-Format: exact-v1' \  -H 'Content-Type: application/json' \  -d '{    "quantity": {      "total": {        "dp": 0,        "value": 36      },      "type": "unit"    }  }'

Custom simple product

Change one of your own products that has no sizes or colors.

  • productobject

    What the line is. type picks the kind of line and can't change later.

    Child fields (2)
    • typestringrequired
      • Always "user_simple"
    • Child fields (1)
      • Extra text shown under the line, for example a note about the color.

  • jobobject

    Which job of this order the line belongs to. Decoration prices and quantity breaks count every line on a job, so put all sizes of a product on the same job.

    One of, picked by type:

    Linked to a joblinked

    The line belongs to one of this order's jobs and takes its decoration price.

    • typestringrequired
      • Always "linked"
    • idstringrequired

      The job's id, from the order's jobs. It must be a job of this same order.

    No jobstandalone

    The line has no job, so no decoration price.

    • typestringrequired
      • Always "standalone"
  • positioninteger

    Where the line sits on the order: lines are shown by ascending position. The web app spaces lines 100000 apart, which leaves room to insert between them. A value outside the allowed range is replaced by the next free position at the end.

  • pricingobject

    How the line is priced. YoPrint determines the product price in this order:

    1. Price override: if product.override is true, YoPrint uses product.total.
    2. Customer-supplied: if customer_supplied is true (product.properties.customer_supplied), the product price is 0.
    3. Product pricing: otherwise, YoPrint starts from product_cost.total (or the price from Products when omitted or 0) and applies any matching pricing rule.
    Child fields (4)
    • typestringrequired
      • Always "product_cost_service"
    • productobject

      Set your own product price for one unit with override: true and total.

      Child fields (2)
      • overridebooleanrequired

        true to use total as given; false to let YoPrint work it out.

      • totaldecimal pair

        The amount for one unit, as a { value, dp } pair. Up to 6 decimal places are kept.

    • Your cost for one unit. Optional: leave it out, or send a total of 0, to use the product's price from Products.

      Child fields (2)
      • overridebooleanrequired

        true when you set the cost yourself.

      • totaldecimal pairrequired

        The cost for one unit. 0 means "use the product's price".

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
    • serviceobject

      The decoration price added to each unit. Leave it out, or send override: false, to use the job's decoration price per unit. Send override: true with total to set your own. Ignored when the line has no job (job.type standalone).

      Child fields (2)
      • overridebooleanrequired

        true to use total instead of the job's decoration price.

      • totaldecimal pair

        The decoration price for one unit. Required when override is true. Up to 6 decimal places.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
  • quantityobject

    How many units. type is always unit.

    Child fields (2)
    • typestringrequired
      • Always "unit"
    • totaldecimal pair

      The quantity as a { value, dp } pair: 24 is { "value": 24, "dp": 0 }. Up to 8 decimal places.

  • weightobject

    Optional, used for shipping. Leave it out to use the product's weight.

    One of, picked by type:

    Use the product's weightuse_system

    Take the weight from the product (in lb).

    • typestringrequired
      • Always "use_system"
    Set the weightmass

    Your own weight for one unit. unit is required; leave total out to keep the current weight.

    • typestringrequired
      • Always "mass"
    • unitstringrequired
      • One of: "lb", "kg"
    • totaldecimal pair

      The weight as a { value, dp } pair whose two parts are strings: 1.5 is { "value": "15", "dp": "1" }.

Example request

curl
curl -X PUT 'https://secure.yoprint.com/v2/api/store/your-team/v2/sales_order/order_item/Owr88lhAk28aqL' \  -H 'Authorization: Bearer YOUR_API_KEY' \  -H 'Accept: application/json' \  -H 'X-Yoprint-Decimal-Format: exact-v1' \  -H 'Content-Type: application/json' \  -d '{    "pricing": {      "product": {        "override": true,        "total": {          "dp": 2,          "value": 1400        }      },      "type": "product_cost_service"    }  }'

Custom variant product

Change one size and color of your own product.

  • productobject

    What the line is. type picks the kind of line and can't change later.

    Child fields (2)
    • typestringrequired
      • Always "db_variant"
    • Child fields (1)
      • Extra text shown under the line, for example a note about the color.

  • jobobject

    Which job of this order the line belongs to. Decoration prices and quantity breaks count every line on a job, so put all sizes of a product on the same job.

    One of, picked by type:

    Linked to a joblinked

    The line belongs to one of this order's jobs and takes its decoration price.

    • typestringrequired
      • Always "linked"
    • idstringrequired

      The job's id, from the order's jobs. It must be a job of this same order.

    No jobstandalone

    The line has no job, so no decoration price.

    • typestringrequired
      • Always "standalone"
  • positioninteger

    Where the line sits on the order: lines are shown by ascending position. The web app spaces lines 100000 apart, which leaves room to insert between them. A value outside the allowed range is replaced by the next free position at the end.

  • pricingobject

    How the line is priced. YoPrint determines the product price in this order:

    1. Price override: if product.override is true, YoPrint uses product.total.
    2. Customer-supplied: if customer_supplied is true (product.properties.customer_supplied), the product price is 0.
    3. Product pricing: otherwise, YoPrint starts from product_cost.total (or the price from Products when omitted or 0) and applies any matching pricing rule.
    Child fields (4)
    • typestringrequired
      • Always "product_cost_service"
    • productobject

      Set your own product price for one unit with override: true and total.

      Child fields (2)
      • overridebooleanrequired

        true to use total as given; false to let YoPrint work it out.

      • totaldecimal pair

        The amount for one unit, as a { value, dp } pair. Up to 6 decimal places are kept.

    • Your cost for one unit. Optional: leave it out, or send a total of 0, to use the product's price from Products.

      Child fields (2)
      • overridebooleanrequired

        true when you set the cost yourself.

      • totaldecimal pairrequired

        The cost for one unit. 0 means "use the product's price".

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
    • serviceobject

      The decoration price added to each unit. Leave it out, or send override: false, to use the job's decoration price per unit. Send override: true with total to set your own. Ignored when the line has no job (job.type standalone).

      Child fields (2)
      • overridebooleanrequired

        true to use total instead of the job's decoration price.

      • totaldecimal pair

        The decoration price for one unit. Required when override is true. Up to 6 decimal places.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
  • quantityobject

    How many units. type is always unit.

    Child fields (2)
    • typestringrequired
      • Always "unit"
    • totaldecimal pair

      The quantity as a { value, dp } pair: 24 is { "value": 24, "dp": 0 }. Up to 8 decimal places.

  • weightobject

    Optional, used for shipping. Leave it out to use the product's weight.

    One of, picked by type:

    Use the product's weightuse_system

    Take the weight from the product (in lb).

    • typestringrequired
      • Always "use_system"
    Set the weightmass

    Your own weight for one unit. unit is required; leave total out to keep the current weight.

    • typestringrequired
      • Always "mass"
    • unitstringrequired
      • One of: "lb", "kg"
    • totaldecimal pair

      The weight as a { value, dp } pair whose two parts are strings: 1.5 is { "value": "15", "dp": "1" }.

Example request

curl
curl -X PUT 'https://secure.yoprint.com/v2/api/store/your-team/v2/sales_order/order_item/Owr88lhAk28aqL' \  -H 'Authorization: Bearer YOUR_API_KEY' \  -H 'Accept: application/json' \  -H 'X-Yoprint-Decimal-Format: exact-v1' \  -H 'Content-Type: application/json' \  -d '{    "job": {      "id": "I3hKS5NY8hhW8u",      "type": "linked"    }  }'

Custom line item

Change a one-off line with a name and a price, not linked to a product.

  • productobject

    What the line is. type picks the kind of line and can't change later.

    Child fields (2)
    • typestringrequired
      • Always "custom"
    • Child fields (2)
      • Extra text shown under the line, for example a note about the color.

      • namestring

        The line's name, as the customer sees it.

  • jobobject

    Which job of this order the line belongs to. Decoration prices and quantity breaks count every line on a job, so put all sizes of a product on the same job.

    One of, picked by type:

    Linked to a joblinked

    The line belongs to one of this order's jobs and takes its decoration price.

    • typestringrequired
      • Always "linked"
    • idstringrequired

      The job's id, from the order's jobs. It must be a job of this same order.

    No jobstandalone

    The line has no job, so no decoration price.

    • typestringrequired
      • Always "standalone"
  • positioninteger

    Where the line sits on the order: lines are shown by ascending position. The web app spaces lines 100000 apart, which leaves room to insert between them. A value outside the allowed range is replaced by the next free position at the end.

  • pricingobject

    How the line is priced. Send the unit price in product.total with override: true.

    Child fields (4)
    • typestringrequired
      • Always "custom_product"
    • productobject

      The product price for one unit. With override: true (what the web app sends) the line uses total. With override false or left out, YoPrint starts from product_cost.total (or total when no cost is set) and applies any matching pricing rule.

      Child fields (2)
      • totaldecimal pairrequired

        The price for one unit. Up to 6 decimal places are kept.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
      • overrideboolean

        true to use total as the price.

    • Optional: your cost for one unit, used for profit and margin.

      Child fields (1)
      • totaldecimal pairrequired

        Your cost for one unit.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
    • serviceobject

      The decoration price added to each unit. Leave it out, or send override: false, to use the job's decoration price per unit. Send override: true with total to set your own. Ignored when the line has no job (job.type standalone).

      Child fields (2)
      • overridebooleanrequired

        true to use total instead of the job's decoration price.

      • totaldecimal pair

        The decoration price for one unit. Required when override is true. Up to 6 decimal places.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
  • quantityobject

    How many units. type is always unit.

    Child fields (2)
    • typestringrequired
      • Always "unit"
    • totaldecimal pair

      The quantity as a { value, dp } pair: 24 is { "value": 24, "dp": 0 }. Up to 8 decimal places.

  • weightobject

    Optional, used for shipping.

    Child fields (3)
    • typestringrequired
      • Always "mass"
    • unitstringrequired
      • One of: "lb", "kg"
    • totaldecimal pair

      The weight as a { value, dp } pair whose two parts are strings: 1.5 is { "value": "15", "dp": "1" }.

Example request

curl
curl -X PUT 'https://secure.yoprint.com/v2/api/store/your-team/v2/sales_order/order_item/Owr88lhAk28aqL' \  -H 'Authorization: Bearer YOUR_API_KEY' \  -H 'Accept: application/json' \  -H 'X-Yoprint-Decimal-Format: exact-v1' \  -H 'Content-Type: application/json' \  -d '{    "pricing": {      "product": {        "override": true,        "total": {          "dp": 2,          "value": 350        }      },      "type": "custom_product"    },    "product": {      "properties": {        "name": "Woven patch"      },      "type": "custom"    }  }'

Fee line item

Change a fee, such as a rush or setup fee.

  • productobject

    What the line is. type picks the kind of line and can't change later.

    Child fields (2)
    • typestringrequired
      • Always "fee"
    • Child fields (2)
      • Extra text shown under the fee, for example what it covers.

      • namestring

        The fee's name, for example "Rush fee".

  • jobobject

    Which job of this order the line belongs to. Decoration prices and quantity breaks count every line on a job, so put all sizes of a product on the same job.

    One of, picked by type:

    Linked to a joblinked

    The line belongs to one of this order's jobs and takes its decoration price.

    • typestringrequired
      • Always "linked"
    • idstringrequired

      The job's id, from the order's jobs. It must be a job of this same order.

    No jobstandalone

    The line has no job, so no decoration price.

    • typestringrequired
      • Always "standalone"
  • positioninteger

    Where the line sits on the order: lines are shown by ascending position. The web app spaces lines 100000 apart, which leaves room to insert between them. A value outside the allowed range is replaced by the next free position at the end.

  • pricingobject

    The fee amount for one unit. Fees never take a decoration price.

    Child fields (2)
    • typestringrequired
      • Always "fee"
    • productobject
      Child fields (1)
      • totaldecimal pairrequired

        The fee for one unit, 0 or more.

        • { "value": 1250, "dp": 2 } is 12.50: value holds the digits, dp the decimal places. See Money and quantities.
  • quantityobject

    How many units. type is always unit.

    Child fields (2)
    • typestringrequired
      • Always "unit"
    • totaldecimal pair

      The quantity as a { value, dp } pair: 24 is { "value": 24, "dp": 0 }. Up to 8 decimal places.

  • weightobject

    Optional, used for shipping. Leave it out for no weight.

    Child fields (3)
    • typestringrequired
      • Always "mass"
    • unitstringrequired
      • One of: "lb", "kg"
    • totaldecimal pair

      The weight as a { value, dp } pair whose two parts are strings: 1.5 is { "value": "15", "dp": "1" }.

Example request

curl
curl -X PUT 'https://secure.yoprint.com/v2/api/store/your-team/v2/sales_order/order_item/Owr88lhAk28aqL' \  -H 'Authorization: Bearer YOUR_API_KEY' \  -H 'Accept: application/json' \  -H 'X-Yoprint-Decimal-Format: exact-v1' \  -H 'Content-Type: application/json' \  -d '{    "pricing": {      "product": {        "total": {          "dp": 2,          "value": 3000        }      },      "type": "fee"    }  }'

Response

200Successful response.

  • dataobjectrequired
    Child fields (5)
      • Always "order_item"
    • NONE when nothing changed.

      • One of: "CREATED", "UPDATED", "DELETED", "NONE"
    • itemobject

      One line. It has the request's groups (product, pricing, quantity, job, weight, position) as saved, with the prices YoPrint worked out, and the same values again in _meta. A few groups differ from the request: the catalog cost comes back as pricing.catalog.cost with its date as a date-time, and a linked job also has its unique_key and scoped_id (JOB-1001). Each group's _meta.editable_fields_on_update lists the request paths an update accepts for that group (pricing.type is listed, but it must stay the line's own).

      Child fields (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.

    • The order's lock versions after this call. Each is a whole number (a microsecond timestamp) that changes on every save, or null.

      Child fields (1)
  • 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.

    When
    The API key's role can't edit this order (user_is_not_authorized).
    Fix
    Ask the team owner for sales order edit permission, or assign the user to the order.
  • 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.

    When
    The order or line does not exist in this team: error.code is null and error.message says "No query results for …".
    Fix
    Check the id.
  • 422The request was refused and changed nothing. validation_failed lists what to fix in error.fields; other codes name a business rule, explained in error.message. A few checks answer with only {"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answer connect_timeout ("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.

    When
    A required field is missing, a type value is unknown, or a { value, dp } pair is malformed (for example sending {"value": 12.5, "dp": 1} instead of {"value": 125, "dp": 1}: value must be an integer).
    Fix
    Read error.fields; send whole numbers in value and the decimal places in dp (for example {"value": 1250, "dp": 2} for 12.50).
    When
    The product, variant or catalog item id is not found. This error has no envelope: the body is {"message": "user_simple: Simple Product not found:48213"}, where the number is YoPrint's internal number for the id you sent (db_variant: Variant Product not found:… the same way; db_catalog: Catalog Product not found:smr-10001 repeats the catalog id).
    Fix
    Use an id from Products, or a catalog item id.
    When
    job.id is not a job of this order: "This job is no longer available. Choose a job from this order and save again."
    Fix
    Use a job id from this order's jobs.
    When
    The job's decoration setup needs repair: "Review this job’s services before changing quantities or adding, removing or moving items." (validation_error, with error.fields.job.id, and error.context.reason job_service_repair_required with error.context.job_id and job_label).
    Fix
    Fix the job's services in the web app, then retry.
    When
    The product, or its size or color, is phased out or deleted (product_phased_out, product_deleted, variant_phased_out, variant_deleted).
    Fix
    Resume it in Products, or choose another product.
    When
    A price, quantity or calculated total is out of range (amount_out_of_range).
    Fix
    Check the amount and its decimal places.
    When
    You sent a different product.type (cart_item_validation_error), or a pricing.type that is not the one for the line's kind (validation_failed, error.fields names pricing.type).
    Fix
    Keep the types, or delete the line and add a new one.

Notes

  • Sending the line's current values changes nothing and answers NONE with has_changes: false, except on an order that keeps its invoice up to date automatically: there a body with quantity, pricing or job is recalculated and answers UPDATED.
  • Use the bulk operation to change several lines in one save.