> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/chord-oms/api-reference/line-items.md).

# Line Items

## Delete checkout line item

> Deletes a checkout's line item.

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"responses":{"no-content":{"description":"Successful operation with no content returned"},"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"delete-restriction":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"paths":{"/checkouts/{checkout_id}/line_items/{id}":{"delete":{"summary":"Delete checkout line item","description":"Deletes a checkout's line item.","operationId":"delete-checkout-line-item","tags":["Line items"],"responses":{"204":{"$ref":"#/components/responses/no-content"},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"422":{"$ref":"#/components/responses/delete-restriction"}}}}}}
```

## Update checkout line item

> Updates a checkout's line item.

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"schemas":{"line-item":{"type":"object","title":"Line item","required":["adjustments"],"properties":{"id":{"type":"integer"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/adjustment"}},"is_bundle":{"type":"boolean"},"subscription_type":{"type":"string"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}},"total":{"type":"string"},"display_amount":{"type":"string"},"price":{"type":"string","format":"float"},"single_display_amount":{"type":"string"},"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"},"variant_id":{"type":"integer"},"metadata":{"$ref":"#/components/schemas/metadata"},"cross_sold":{"type":"integer"},"dynamic_promotions":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/gift_card"}},"pre_paid_subscription":{"$ref":"#/components/schemas/PrepaidSubscriptionResponse"},"digital_purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"redeemed":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/metadata"}}}}}},"adjustment":{"type":"object","properties":{"adjustable_id":{"type":"integer"},"adjustable_type":{"type":"string"},"amount":{"type":"string"},"created_at":{"type":"string"},"display_amount":{"type":"string"},"eligible":{"type":"boolean"},"finalized":{"type":"boolean"},"id":{"type":"integer"},"label":{"type":"string"},"promotion_code_id":{"type":"integer"},"source_id":{"type":"integer"},"source_type":{"type":"string"},"updated_at":{"type":"string"},"promotion_code":{"properties":{"id":{"type":"integer"},"value":{"type":"string"}}}},"title":"Adjustment"},"part":{"type":"object","title":"Part within a parts array","properties":{"sku":{"type":"string","description":"SKU of the variant in the bundle"},"quantity":{"type":"integer","description":"The quantity of variant in this bundle"},"price":{"type":"number","format":"float","description":"The price of the variant in this bundle"}}},"variant":{"type":"object","title":"Variant","properties":{"cost_price":{"type":"string"},"depth":{"type":"string"},"description":{"type":"string"},"display_price":{"type":"string"},"height":{"type":"string"},"id":{"type":"integer"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"in_stock":{"type":"boolean"},"is_backorderable":{"type":"boolean"},"is_destroyed":{"type":"boolean"},"is_master":{"type":"boolean"},"name":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/option-value"}},"options_text":{"type":"string"},"price":{"type":"string"},"sku":{"type":"string"},"slug":{"type":"string"},"total_on_hand":{"type":"integer"},"track_inventory":{"type":"boolean"},"weight":{"type":"string"},"width":{"type":"string"},"metadata":{"$ref":"#/components/schemas/metadata"}}},"image":{"type":"object","properties":{"alt":{"type":"string"},"attachment_content_type":{"type":"string"},"attachment_file_name":{"type":"string"},"attachment_height":{"type":"integer"},"attachment_updated_at":{"type":"string"},"attachment_width":{"type":"integer"},"id":{"type":"integer"},"large_url":{"type":"string"},"mini_url":{"type":"string"},"position":{"type":"integer"},"product_url":{"type":"string"},"small_url":{"type":"string"},"type":{"type":"string"},"viewable_id":{"type":"integer"},"viewable_type":{"type":"string"}},"title":"Image"},"option-value":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"option_type_id":{"type":"integer"},"option_type_name":{"type":"string"},"option_type_presentation":{"type":"string"},"presentation":{"type":"string"}},"title":"Option value"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"properties":{},"title":"Metadata","description":"A key-value store of additional information. A key can be removed by\nsetting its value to null.\n"},"dynamic_promotion":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"gift_card":{"type":"object","properties":{"id":{"type":"integer"},"filled":{"type":"boolean"},"amount":{"type":"string"},"recipient_email":{"type":"string"},"recipient_name":{"type":"string"},"gift_message":{"type":"string"},"send_email_at":{"type":"string"},"purchaser_name":{"type":"string"},"auto_redeem":{"type":"boolean"},"redemption_code":{"type":"string"}}},"PrepaidSubscriptionResponse":{"type":"object","required":["id","subscription_id","virtual_gift_card_id","actionable_date","auto_redeem","gift","recurring","amount","single_installment_price","state","quantity","installment_count","interval_length","interval_units","line_items","recipient","virtual_gift_card"],"properties":{"id":{"type":"integer"},"subscription_id":{"type":"integer","nullable":true},"virtual_gift_card_id":{"type":"integer","nullable":true},"actionable_date":{"type":"string","format":"date-time"},"auto_redeem":{"type":"boolean"},"gift":{"type":"boolean"},"recurring":{"type":"boolean"},"amount":{"type":"string","format":"float","description":"Total amount that the customer paid upfront for this subsciption.\n"},"single_installment_price":{"type":"string","format":"float","description":"The amount of money the customer paid for a single installment upfront.\n"},"state":{"type":"string","enum":["pending","active","completed"]},"quantity":{"type":"integer","minimum":1,"description":"The number of items that will be in the shipment.\n"},"installment_count":{"type":"number","description":"The number of times that the subsciption should be fulfilled.\n"},"fulfilled_installment_count":{"type":"number","description":"The number of times that the subsciption has been fulfilled within\na billing period.\n"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"line_items":{"type":"array","items":{"type":"object","required":["quantity","variant"],"properties":{"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"}}}},"recipient":{"type":"object","required":["name","email","address"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"address":{"$ref":"#/components/schemas/address"}}},"virtual_gift_card":{"$ref":"#/components/schemas/gift_card"}}},"IntervalLength":{"type":"number","minimum":1,"description":"How many times a subscription should be fulfilled for a given\ninterval unit. Here are some examples.\n\n- Length = 1 and unit = `month` == once a month\n- Length = 2 and unit = `week` == every two weeks\n- Length = 1 and unit = `year` == once a year\n"},"IntervalUnit":{"type":"string","enum":["day","week","month","year"],"description":"The measurement of time applied to the interval unit of how often a\nsubscription is fulfilled.\n"},"address":{"type":"object","title":"Address","properties":{"id":{"type":"integer"},"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string","nullable":true},"city":{"type":"string"},"zipcode":{"type":"string"},"country":{"$ref":"#/components/schemas/country"},"alternative_phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_id":{"type":"integer"},"country_iso":{"type":"string"},"phone":{"type":"string","nullable":true},"state":{"$ref":"#/components/schemas/state"},"state_id":{"type":"integer"},"state_name":{"type":"string"},"state_text":{"type":"string"}}},"country":{"type":"object","properties":{"id":{"type":"integer"},"iso":{"type":"string"},"iso3":{"type":"string"},"iso_name":{"type":"string"},"name":{"type":"string"},"numcode":{"type":"integer"}},"title":"Country"},"state":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"abbr":{"type":"string"},"country_id":{"type":"integer"}},"title":"State"}},"responses":{"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"unprocessable-entity":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object"}}}}}}}},"paths":{"/checkouts/{checkout_id}/line_items/{id}":{"patch":{"summary":"Update checkout line item","description":"Updates a checkout's line item.","operationId":"update-checkout-line-item","tags":["Line items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"line_items_attributes":{"allOf":[{"properties":{"id":{"type":"integer"}}}],"type":"object"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/line-item"}}}},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"422":{"$ref":"#/components/responses/unprocessable-entity"}}}}}}
```

## Delete order line item

> Deletes an order's line item.

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"responses":{"no-content":{"description":"Successful operation with no content returned"},"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"delete-restriction":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"paths":{"/orders/{order_number}/line_items/{id}":{"delete":{"summary":"Delete order line item","description":"Deletes an order's line item.","operationId":"delete-order-line-item","tags":["Line items"],"responses":{"204":{"$ref":"#/components/responses/no-content"},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"422":{"$ref":"#/components/responses/delete-restriction"}}}}}}
```

## Update order line item

> Updates an order's line item.

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"schemas":{"LineItemInput":{"type":"object","title":"Line item input","allOf":[{"$ref":"#/components/schemas/LineItemIdentifier"},{"type":"object","properties":{"quantity":{"type":"integer","description":"The quantity of the item to be added to the cart. If `0` is passed or `quantity`\nis omitted from the payload, the item is removed from the cart.\n"},"options":{"type":"object","description":"This field can be used to pass custom line item attributes. When used, it will force a new price calculation, unless `price` is one of the options.","properties":{"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}}}},"subscription_line_items_attributes":{"type":"array","items":{"$ref":"#/components/schemas/subscription-line-item"}},"dynamic_promotions_attributes":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"digital_purchases_attributes":{"type":"array","items":{"type":"object","properties":{"metadata":{"type":"object","properties":{"auto_redeem":{"type":"boolean"}}}}}}}}]},"LineItemIdentifier":{"type":"object","oneOf":[{"title":"sku","type":"object","required":["sku"],"properties":{"sku":{"type":"string"}}},{"title":"variant_id","type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"integer"}}},{"title":"id","type":"object","description":"The existing line item ID of the item in the order","required":["id"],"properties":{"id":{"type":"integer"},"variant_id":{"type":"integer"},"sku":{"type":"string"}}}]},"part":{"type":"object","title":"Part within a parts array","properties":{"sku":{"type":"string","description":"SKU of the variant in the bundle"},"quantity":{"type":"integer","description":"The quantity of variant in this bundle"},"price":{"type":"number","format":"float","description":"The price of the variant in this bundle"}}},"subscription-line-item":{"description":"","title":"Subscription line item","type":"object","properties":{"id":{"type":"number"},"_destroy":{"type":"boolean"},"quantity":{"type":"number"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"end_date":{"type":"string"},"interval":{"type":"string","minLength":1},"sku":{"type":"string","minLength":1},"product_slug":{"type":"string","minLength":1},"subscription_type":{"type":"string"},"variant_id":{"type":"number"},"product_id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"options_text":{"type":"string"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"one_time":{"type":"boolean","description":"Indicates this is a one-time addition to the next installment"},"one_time_replace":{"type":"boolean","description":"Indicates this item replaces an existing subscription item for one installment"},"replaces_subscribable_id":{"type":"number","description":"When one_time_replace is true, the variant_id of the item being replaced"}}},"IntervalLength":{"type":"number","minimum":1,"description":"How many times a subscription should be fulfilled for a given\ninterval unit. Here are some examples.\n\n- Length = 1 and unit = `month` == once a month\n- Length = 2 and unit = `week` == every two weeks\n- Length = 1 and unit = `year` == once a year\n"},"IntervalUnit":{"type":"string","enum":["day","week","month","year"],"description":"The measurement of time applied to the interval unit of how often a\nsubscription is fulfilled.\n"},"image":{"type":"object","properties":{"alt":{"type":"string"},"attachment_content_type":{"type":"string"},"attachment_file_name":{"type":"string"},"attachment_height":{"type":"integer"},"attachment_updated_at":{"type":"string"},"attachment_width":{"type":"integer"},"id":{"type":"integer"},"large_url":{"type":"string"},"mini_url":{"type":"string"},"position":{"type":"integer"},"product_url":{"type":"string"},"small_url":{"type":"string"},"type":{"type":"string"},"viewable_id":{"type":"integer"},"viewable_type":{"type":"string"}},"title":"Image"},"dynamic_promotion":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"line-item":{"type":"object","title":"Line item","required":["adjustments"],"properties":{"id":{"type":"integer"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/adjustment"}},"is_bundle":{"type":"boolean"},"subscription_type":{"type":"string"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}},"total":{"type":"string"},"display_amount":{"type":"string"},"price":{"type":"string","format":"float"},"single_display_amount":{"type":"string"},"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"},"variant_id":{"type":"integer"},"metadata":{"$ref":"#/components/schemas/metadata"},"cross_sold":{"type":"integer"},"dynamic_promotions":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/gift_card"}},"pre_paid_subscription":{"$ref":"#/components/schemas/PrepaidSubscriptionResponse"},"digital_purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"redeemed":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/metadata"}}}}}},"adjustment":{"type":"object","properties":{"adjustable_id":{"type":"integer"},"adjustable_type":{"type":"string"},"amount":{"type":"string"},"created_at":{"type":"string"},"display_amount":{"type":"string"},"eligible":{"type":"boolean"},"finalized":{"type":"boolean"},"id":{"type":"integer"},"label":{"type":"string"},"promotion_code_id":{"type":"integer"},"source_id":{"type":"integer"},"source_type":{"type":"string"},"updated_at":{"type":"string"},"promotion_code":{"properties":{"id":{"type":"integer"},"value":{"type":"string"}}}},"title":"Adjustment"},"variant":{"type":"object","title":"Variant","properties":{"cost_price":{"type":"string"},"depth":{"type":"string"},"description":{"type":"string"},"display_price":{"type":"string"},"height":{"type":"string"},"id":{"type":"integer"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"in_stock":{"type":"boolean"},"is_backorderable":{"type":"boolean"},"is_destroyed":{"type":"boolean"},"is_master":{"type":"boolean"},"name":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/option-value"}},"options_text":{"type":"string"},"price":{"type":"string"},"sku":{"type":"string"},"slug":{"type":"string"},"total_on_hand":{"type":"integer"},"track_inventory":{"type":"boolean"},"weight":{"type":"string"},"width":{"type":"string"},"metadata":{"$ref":"#/components/schemas/metadata"}}},"option-value":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"option_type_id":{"type":"integer"},"option_type_name":{"type":"string"},"option_type_presentation":{"type":"string"},"presentation":{"type":"string"}},"title":"Option value"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"properties":{},"title":"Metadata","description":"A key-value store of additional information. A key can be removed by\nsetting its value to null.\n"},"gift_card":{"type":"object","properties":{"id":{"type":"integer"},"filled":{"type":"boolean"},"amount":{"type":"string"},"recipient_email":{"type":"string"},"recipient_name":{"type":"string"},"gift_message":{"type":"string"},"send_email_at":{"type":"string"},"purchaser_name":{"type":"string"},"auto_redeem":{"type":"boolean"},"redemption_code":{"type":"string"}}},"PrepaidSubscriptionResponse":{"type":"object","required":["id","subscription_id","virtual_gift_card_id","actionable_date","auto_redeem","gift","recurring","amount","single_installment_price","state","quantity","installment_count","interval_length","interval_units","line_items","recipient","virtual_gift_card"],"properties":{"id":{"type":"integer"},"subscription_id":{"type":"integer","nullable":true},"virtual_gift_card_id":{"type":"integer","nullable":true},"actionable_date":{"type":"string","format":"date-time"},"auto_redeem":{"type":"boolean"},"gift":{"type":"boolean"},"recurring":{"type":"boolean"},"amount":{"type":"string","format":"float","description":"Total amount that the customer paid upfront for this subsciption.\n"},"single_installment_price":{"type":"string","format":"float","description":"The amount of money the customer paid for a single installment upfront.\n"},"state":{"type":"string","enum":["pending","active","completed"]},"quantity":{"type":"integer","minimum":1,"description":"The number of items that will be in the shipment.\n"},"installment_count":{"type":"number","description":"The number of times that the subsciption should be fulfilled.\n"},"fulfilled_installment_count":{"type":"number","description":"The number of times that the subsciption has been fulfilled within\na billing period.\n"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"line_items":{"type":"array","items":{"type":"object","required":["quantity","variant"],"properties":{"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"}}}},"recipient":{"type":"object","required":["name","email","address"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"address":{"$ref":"#/components/schemas/address"}}},"virtual_gift_card":{"$ref":"#/components/schemas/gift_card"}}},"address":{"type":"object","title":"Address","properties":{"id":{"type":"integer"},"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string","nullable":true},"city":{"type":"string"},"zipcode":{"type":"string"},"country":{"$ref":"#/components/schemas/country"},"alternative_phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_id":{"type":"integer"},"country_iso":{"type":"string"},"phone":{"type":"string","nullable":true},"state":{"$ref":"#/components/schemas/state"},"state_id":{"type":"integer"},"state_name":{"type":"string"},"state_text":{"type":"string"}}},"country":{"type":"object","properties":{"id":{"type":"integer"},"iso":{"type":"string"},"iso3":{"type":"string"},"iso_name":{"type":"string"},"name":{"type":"string"},"numcode":{"type":"integer"}},"title":"Country"},"state":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"abbr":{"type":"string"},"country_id":{"type":"integer"}},"title":"State"}},"responses":{"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"unprocessable-entity":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object"}}}}}}}},"paths":{"/orders/{order_number}/line_items/{id}":{"patch":{"summary":"Update order line item","description":"Updates an order's line item.","operationId":"update-order-line-item","tags":["Line items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineItemInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/line-item"}}}},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"422":{"$ref":"#/components/responses/unprocessable-entity"}}}}}}
```

## Create checkout line item

> Creates a new line item for a checkout.

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"schemas":{"LineItemInput":{"type":"object","title":"Line item input","allOf":[{"$ref":"#/components/schemas/LineItemIdentifier"},{"type":"object","properties":{"quantity":{"type":"integer","description":"The quantity of the item to be added to the cart. If `0` is passed or `quantity`\nis omitted from the payload, the item is removed from the cart.\n"},"options":{"type":"object","description":"This field can be used to pass custom line item attributes. When used, it will force a new price calculation, unless `price` is one of the options.","properties":{"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}}}},"subscription_line_items_attributes":{"type":"array","items":{"$ref":"#/components/schemas/subscription-line-item"}},"dynamic_promotions_attributes":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"digital_purchases_attributes":{"type":"array","items":{"type":"object","properties":{"metadata":{"type":"object","properties":{"auto_redeem":{"type":"boolean"}}}}}}}}]},"LineItemIdentifier":{"type":"object","oneOf":[{"title":"sku","type":"object","required":["sku"],"properties":{"sku":{"type":"string"}}},{"title":"variant_id","type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"integer"}}},{"title":"id","type":"object","description":"The existing line item ID of the item in the order","required":["id"],"properties":{"id":{"type":"integer"},"variant_id":{"type":"integer"},"sku":{"type":"string"}}}]},"part":{"type":"object","title":"Part within a parts array","properties":{"sku":{"type":"string","description":"SKU of the variant in the bundle"},"quantity":{"type":"integer","description":"The quantity of variant in this bundle"},"price":{"type":"number","format":"float","description":"The price of the variant in this bundle"}}},"subscription-line-item":{"description":"","title":"Subscription line item","type":"object","properties":{"id":{"type":"number"},"_destroy":{"type":"boolean"},"quantity":{"type":"number"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"end_date":{"type":"string"},"interval":{"type":"string","minLength":1},"sku":{"type":"string","minLength":1},"product_slug":{"type":"string","minLength":1},"subscription_type":{"type":"string"},"variant_id":{"type":"number"},"product_id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"options_text":{"type":"string"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"one_time":{"type":"boolean","description":"Indicates this is a one-time addition to the next installment"},"one_time_replace":{"type":"boolean","description":"Indicates this item replaces an existing subscription item for one installment"},"replaces_subscribable_id":{"type":"number","description":"When one_time_replace is true, the variant_id of the item being replaced"}}},"IntervalLength":{"type":"number","minimum":1,"description":"How many times a subscription should be fulfilled for a given\ninterval unit. Here are some examples.\n\n- Length = 1 and unit = `month` == once a month\n- Length = 2 and unit = `week` == every two weeks\n- Length = 1 and unit = `year` == once a year\n"},"IntervalUnit":{"type":"string","enum":["day","week","month","year"],"description":"The measurement of time applied to the interval unit of how often a\nsubscription is fulfilled.\n"},"image":{"type":"object","properties":{"alt":{"type":"string"},"attachment_content_type":{"type":"string"},"attachment_file_name":{"type":"string"},"attachment_height":{"type":"integer"},"attachment_updated_at":{"type":"string"},"attachment_width":{"type":"integer"},"id":{"type":"integer"},"large_url":{"type":"string"},"mini_url":{"type":"string"},"position":{"type":"integer"},"product_url":{"type":"string"},"small_url":{"type":"string"},"type":{"type":"string"},"viewable_id":{"type":"integer"},"viewable_type":{"type":"string"}},"title":"Image"},"dynamic_promotion":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"line-item":{"type":"object","title":"Line item","required":["adjustments"],"properties":{"id":{"type":"integer"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/adjustment"}},"is_bundle":{"type":"boolean"},"subscription_type":{"type":"string"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}},"total":{"type":"string"},"display_amount":{"type":"string"},"price":{"type":"string","format":"float"},"single_display_amount":{"type":"string"},"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"},"variant_id":{"type":"integer"},"metadata":{"$ref":"#/components/schemas/metadata"},"cross_sold":{"type":"integer"},"dynamic_promotions":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/gift_card"}},"pre_paid_subscription":{"$ref":"#/components/schemas/PrepaidSubscriptionResponse"},"digital_purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"redeemed":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/metadata"}}}}}},"adjustment":{"type":"object","properties":{"adjustable_id":{"type":"integer"},"adjustable_type":{"type":"string"},"amount":{"type":"string"},"created_at":{"type":"string"},"display_amount":{"type":"string"},"eligible":{"type":"boolean"},"finalized":{"type":"boolean"},"id":{"type":"integer"},"label":{"type":"string"},"promotion_code_id":{"type":"integer"},"source_id":{"type":"integer"},"source_type":{"type":"string"},"updated_at":{"type":"string"},"promotion_code":{"properties":{"id":{"type":"integer"},"value":{"type":"string"}}}},"title":"Adjustment"},"variant":{"type":"object","title":"Variant","properties":{"cost_price":{"type":"string"},"depth":{"type":"string"},"description":{"type":"string"},"display_price":{"type":"string"},"height":{"type":"string"},"id":{"type":"integer"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"in_stock":{"type":"boolean"},"is_backorderable":{"type":"boolean"},"is_destroyed":{"type":"boolean"},"is_master":{"type":"boolean"},"name":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/option-value"}},"options_text":{"type":"string"},"price":{"type":"string"},"sku":{"type":"string"},"slug":{"type":"string"},"total_on_hand":{"type":"integer"},"track_inventory":{"type":"boolean"},"weight":{"type":"string"},"width":{"type":"string"},"metadata":{"$ref":"#/components/schemas/metadata"}}},"option-value":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"option_type_id":{"type":"integer"},"option_type_name":{"type":"string"},"option_type_presentation":{"type":"string"},"presentation":{"type":"string"}},"title":"Option value"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"properties":{},"title":"Metadata","description":"A key-value store of additional information. A key can be removed by\nsetting its value to null.\n"},"gift_card":{"type":"object","properties":{"id":{"type":"integer"},"filled":{"type":"boolean"},"amount":{"type":"string"},"recipient_email":{"type":"string"},"recipient_name":{"type":"string"},"gift_message":{"type":"string"},"send_email_at":{"type":"string"},"purchaser_name":{"type":"string"},"auto_redeem":{"type":"boolean"},"redemption_code":{"type":"string"}}},"PrepaidSubscriptionResponse":{"type":"object","required":["id","subscription_id","virtual_gift_card_id","actionable_date","auto_redeem","gift","recurring","amount","single_installment_price","state","quantity","installment_count","interval_length","interval_units","line_items","recipient","virtual_gift_card"],"properties":{"id":{"type":"integer"},"subscription_id":{"type":"integer","nullable":true},"virtual_gift_card_id":{"type":"integer","nullable":true},"actionable_date":{"type":"string","format":"date-time"},"auto_redeem":{"type":"boolean"},"gift":{"type":"boolean"},"recurring":{"type":"boolean"},"amount":{"type":"string","format":"float","description":"Total amount that the customer paid upfront for this subsciption.\n"},"single_installment_price":{"type":"string","format":"float","description":"The amount of money the customer paid for a single installment upfront.\n"},"state":{"type":"string","enum":["pending","active","completed"]},"quantity":{"type":"integer","minimum":1,"description":"The number of items that will be in the shipment.\n"},"installment_count":{"type":"number","description":"The number of times that the subsciption should be fulfilled.\n"},"fulfilled_installment_count":{"type":"number","description":"The number of times that the subsciption has been fulfilled within\na billing period.\n"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"line_items":{"type":"array","items":{"type":"object","required":["quantity","variant"],"properties":{"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"}}}},"recipient":{"type":"object","required":["name","email","address"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"address":{"$ref":"#/components/schemas/address"}}},"virtual_gift_card":{"$ref":"#/components/schemas/gift_card"}}},"address":{"type":"object","title":"Address","properties":{"id":{"type":"integer"},"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string","nullable":true},"city":{"type":"string"},"zipcode":{"type":"string"},"country":{"$ref":"#/components/schemas/country"},"alternative_phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_id":{"type":"integer"},"country_iso":{"type":"string"},"phone":{"type":"string","nullable":true},"state":{"$ref":"#/components/schemas/state"},"state_id":{"type":"integer"},"state_name":{"type":"string"},"state_text":{"type":"string"}}},"country":{"type":"object","properties":{"id":{"type":"integer"},"iso":{"type":"string"},"iso3":{"type":"string"},"iso_name":{"type":"string"},"name":{"type":"string"},"numcode":{"type":"integer"}},"title":"Country"},"state":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"abbr":{"type":"string"},"country_id":{"type":"integer"}},"title":"State"}},"responses":{"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"unprocessable-entity":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object"}}}}}}}},"paths":{"/checkouts/{checkout_id}/line_items":{"post":{"summary":"Create checkout line item","description":"Creates a new line item for a checkout.","operationId":"create-checkout-line-item","tags":["Line items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineItemInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/line-item"}}}},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"422":{"$ref":"#/components/responses/unprocessable-entity"}}}}}}
```

## Create order line item

> Creates a line item for an order.\
> \
> \### Prepaid Subscriptions\
> \
> If you want to offer your customers the ability to gift others subscriptions\
> to item(s) (or simply pre-pay for a subscription for themselves), this is\
> the only endpoint in which you are able to do so. In order to do this, you\
> must do the following.\
> \
> 1\. The subscription can be either a single item or a collection of items.\
> &#x20;  If the subscription is a combination of several items, you should create\
> &#x20;  an overarching product that encapsulates the parts of the subscription.\
> &#x20;  (Ex: The product image and name for this product will be the one used\
> &#x20;  during checkout). \*\*This product must have a price of 0.\*\*\
> 2\. Before adding to the cart, you must capture the recipient's address and information\
> &#x20;  before calling this endpoint.\
> 3\. When the user adds this to the cart, you must add the overarching product\
> &#x20;  to the cart and fill in the \`prepaid\_subscription\` object in \`options\`\
> &#x20;  with the captured information along with the product information of the items\
> &#x20;  in the box. All this is required is \`sku\` and \`quantity\`.\
> \
> \*\*You are not able to edit a prepaid subscription once it is in the cart.\*\*\
> \
> Checkout the examples on the right to see how to use this feature.<br>

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"storefrontLogin":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"storefrontLogin":{"type":"apiKey","name":"Authorization","in":"header","description":"This is a user level API token this is issued by whatever authentication\nprovider you have configured for your storefront. It only allows the\ncaller to perform operations on records belonging to them.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"schemas":{"AddLineItemInput":{"allOf":[{"$ref":"#/components/schemas/LineItemInput"},{"type":"object","properties":{"options":{"type":"object","properties":{"prepaid_subscription":{"$ref":"#/components/schemas/PrepaidSubscriptionInput"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}}}}}}]},"LineItemInput":{"type":"object","title":"Line item input","allOf":[{"$ref":"#/components/schemas/LineItemIdentifier"},{"type":"object","properties":{"quantity":{"type":"integer","description":"The quantity of the item to be added to the cart. If `0` is passed or `quantity`\nis omitted from the payload, the item is removed from the cart.\n"},"options":{"type":"object","description":"This field can be used to pass custom line item attributes. When used, it will force a new price calculation, unless `price` is one of the options.","properties":{"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}}}},"subscription_line_items_attributes":{"type":"array","items":{"$ref":"#/components/schemas/subscription-line-item"}},"dynamic_promotions_attributes":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"digital_purchases_attributes":{"type":"array","items":{"type":"object","properties":{"metadata":{"type":"object","properties":{"auto_redeem":{"type":"boolean"}}}}}}}}]},"LineItemIdentifier":{"type":"object","oneOf":[{"title":"sku","type":"object","required":["sku"],"properties":{"sku":{"type":"string"}}},{"title":"variant_id","type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"integer"}}},{"title":"id","type":"object","description":"The existing line item ID of the item in the order","required":["id"],"properties":{"id":{"type":"integer"},"variant_id":{"type":"integer"},"sku":{"type":"string"}}}]},"part":{"type":"object","title":"Part within a parts array","properties":{"sku":{"type":"string","description":"SKU of the variant in the bundle"},"quantity":{"type":"integer","description":"The quantity of variant in this bundle"},"price":{"type":"number","format":"float","description":"The price of the variant in this bundle"}}},"subscription-line-item":{"description":"","title":"Subscription line item","type":"object","properties":{"id":{"type":"number"},"_destroy":{"type":"boolean"},"quantity":{"type":"number"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"end_date":{"type":"string"},"interval":{"type":"string","minLength":1},"sku":{"type":"string","minLength":1},"product_slug":{"type":"string","minLength":1},"subscription_type":{"type":"string"},"variant_id":{"type":"number"},"product_id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"options_text":{"type":"string"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"one_time":{"type":"boolean","description":"Indicates this is a one-time addition to the next installment"},"one_time_replace":{"type":"boolean","description":"Indicates this item replaces an existing subscription item for one installment"},"replaces_subscribable_id":{"type":"number","description":"When one_time_replace is true, the variant_id of the item being replaced"}}},"IntervalLength":{"type":"number","minimum":1,"description":"How many times a subscription should be fulfilled for a given\ninterval unit. Here are some examples.\n\n- Length = 1 and unit = `month` == once a month\n- Length = 2 and unit = `week` == every two weeks\n- Length = 1 and unit = `year` == once a year\n"},"IntervalUnit":{"type":"string","enum":["day","week","month","year"],"description":"The measurement of time applied to the interval unit of how often a\nsubscription is fulfilled.\n"},"image":{"type":"object","properties":{"alt":{"type":"string"},"attachment_content_type":{"type":"string"},"attachment_file_name":{"type":"string"},"attachment_height":{"type":"integer"},"attachment_updated_at":{"type":"string"},"attachment_width":{"type":"integer"},"id":{"type":"integer"},"large_url":{"type":"string"},"mini_url":{"type":"string"},"position":{"type":"integer"},"product_url":{"type":"string"},"small_url":{"type":"string"},"type":{"type":"string"},"viewable_id":{"type":"integer"},"viewable_type":{"type":"string"}},"title":"Image"},"dynamic_promotion":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"PrepaidSubscriptionInput":{"type":"object","description":"The input to add a prepaid subscription to an order.\n\n### Notes\n\n- If `gift: false`, then you do not need to provide `recipient` or\n  `ship_address` input. The subscription will be shipped to the address\n  entered during checkout implying that the purchaser is buying the prepaid\n  subscription for themselves. The subscription will complete once all prepaid installments are fulfilled.\n- If `gift: true`, you must provide the aforementioned fields before\n  as a part of the request as they cannot be added or updated later. As this implies the purchaser\n  is buying the prepaid subscription as a gift for someone else. The subscription will complete once all prepaid installments are fulfilled.\n- If `recurring: true && gift: false` This will imply that the customer is purchasing\n  a recurring prepaid subscription for themselves. This type of prepaid subscription\n  will renew after each billing period. You do not need to provide `recipient` or\n  `ship_address` input. The subscription will be shipped to the customer address\n  entered during checkout.\n","allOf":[{"oneOf":[{"type":"object","title":"Gift Prepaid Subscription For Another","description":"A prepaid subsciption that is a gift and will require a recipient\nand shipping address as part of adding it to the cart. This prepaid\nsubscription type will complete once all prepaid installments are fulfilled.\n","required":["gift","recipient","ship_address"],"properties":{"gift":{"type":"boolean","enum":[true]},"gift_note":{"type":"string","nullable":true,"description":"A note that will be included in the gift email and might be\npackaged into a note in the package that is shipped to the\nuser (depending on fulfillment service).\n"},"ship_address":{"$ref":"#/components/schemas/address-input"},"recipient":{"type":"object","required":["name","email"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"}}}}},{"type":"object","title":"Gift Prepaid Subscription For Yourself","description":"A prepaid subscription that is a gift to yourself and will be sent to\nthe customer purchasing. This prepaid subscription type will complete once\nall prepaid installments are fulfilled.\n","required":["gift"],"properties":{"gift":{"type":"boolean","enum":[true]}}},{"type":"object","title":"Recurring Prepaid Subscription For Yourself","description":"A prepaid subscription type that a customer purchases for themseleves. This\ntype of prepaid subscription will renew after each billing period.\n","required":["recurring","gift"],"properties":{"recurring":{"type":"boolean","enum":[true]},"gift":{"type":"boolean","enum":[false]}}}]},{"type":"object","required":["installment_count","interval","line_items","auto_redeem"],"properties":{"installment_count":{"type":"number","description":"The number of times that the subsciption should be fulfilled.\n"},"interval":{"type":"object","required":["length","unit"],"properties":{"length":{"$ref":"#/components/schemas/IntervalLength"},"unit":{"$ref":"#/components/schemas/IntervalUnit"}}},"actionable_date":{"description":"The date that the subscription will activate. If this is\nnot provided, the subscription will be activated immediately after checkout.\n","type":"string","format":"date-time","nullable":true},"auto_redeem":{"type":"boolean"},"line_items":{"type":"array","minLength":1,"items":{"type":"object","required":["sku","quantity"],"properties":{"sku":{"type":"string"},"quantity":{"type":"number","minimum":1}}}}}}]},"address-input":{"type":"object","title":"Address Input","required":["address1","city"],"properties":{"name":{"type":"string","description":"The full name of the user. You must provide this field OR one of OR both of `firstname` and `lastname` for\nthe payload to be valid.\n\nThis field will override `firstname` and `lastname` if both are provided.\n"},"firstname":{"type":"string","description":"The first name of the user. This field will be ignored if `name` is provided.\n"},"lastname":{"type":"string","description":"The last name of the user. This field will be ignored if `name` is provided.\n"},"address1":{"type":"string"},"address2":{"type":"string","nullable":true},"city":{"type":"string"},"state_name":{"type":"string","description":"Either the name of the state (\"New York\") or it's abbreviation (\"NY\").\n\nThis field (or `state_id`) is required if [`/api/countries/{country_id}/states`](#/paths/list-country-states)\nreturns `\"states_required\": true` in it's body.\n"},"state_id":{"type":"integer","description":"This ID can be found by calling [`/api/countries/{country_id}/states`](#/paths/list-country-states).\n\nThis field (or `state_name`) is required if the above endpoint returns `\"states_required\": true`.\n"},"country_id":{"type":"integer","description":"This ID can be found by calling [`/api/countries`](#/paths/list-countries). Either `country_id` OR `country_iso`\nmust be provided for this payload to be valid.\n"},"country_iso":{"type":"string","description":"The [ISO 3166-1 Alpha-2 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) that the\nuser resides in. This list can be fetched from [`/api/countries`](#/paths/list-countries), where the key is\n`iso`.\n\nThis field OR `country_id` must be provided for this payload to be valid.\n"},"zipcode":{"type":"string","nullable":true,"description":"This field is required if the country requires a ZIP code, like the United States (`233`).\n"},"phone":{"type":"string","nullable":true},"alternative_phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true}}},"line-item":{"type":"object","title":"Line item","required":["adjustments"],"properties":{"id":{"type":"integer"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/adjustment"}},"is_bundle":{"type":"boolean"},"subscription_type":{"type":"string"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}},"total":{"type":"string"},"display_amount":{"type":"string"},"price":{"type":"string","format":"float"},"single_display_amount":{"type":"string"},"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"},"variant_id":{"type":"integer"},"metadata":{"$ref":"#/components/schemas/metadata"},"cross_sold":{"type":"integer"},"dynamic_promotions":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/gift_card"}},"pre_paid_subscription":{"$ref":"#/components/schemas/PrepaidSubscriptionResponse"},"digital_purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"redeemed":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/metadata"}}}}}},"adjustment":{"type":"object","properties":{"adjustable_id":{"type":"integer"},"adjustable_type":{"type":"string"},"amount":{"type":"string"},"created_at":{"type":"string"},"display_amount":{"type":"string"},"eligible":{"type":"boolean"},"finalized":{"type":"boolean"},"id":{"type":"integer"},"label":{"type":"string"},"promotion_code_id":{"type":"integer"},"source_id":{"type":"integer"},"source_type":{"type":"string"},"updated_at":{"type":"string"},"promotion_code":{"properties":{"id":{"type":"integer"},"value":{"type":"string"}}}},"title":"Adjustment"},"variant":{"type":"object","title":"Variant","properties":{"cost_price":{"type":"string"},"depth":{"type":"string"},"description":{"type":"string"},"display_price":{"type":"string"},"height":{"type":"string"},"id":{"type":"integer"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"in_stock":{"type":"boolean"},"is_backorderable":{"type":"boolean"},"is_destroyed":{"type":"boolean"},"is_master":{"type":"boolean"},"name":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/option-value"}},"options_text":{"type":"string"},"price":{"type":"string"},"sku":{"type":"string"},"slug":{"type":"string"},"total_on_hand":{"type":"integer"},"track_inventory":{"type":"boolean"},"weight":{"type":"string"},"width":{"type":"string"},"metadata":{"$ref":"#/components/schemas/metadata"}}},"option-value":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"option_type_id":{"type":"integer"},"option_type_name":{"type":"string"},"option_type_presentation":{"type":"string"},"presentation":{"type":"string"}},"title":"Option value"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"properties":{},"title":"Metadata","description":"A key-value store of additional information. A key can be removed by\nsetting its value to null.\n"},"gift_card":{"type":"object","properties":{"id":{"type":"integer"},"filled":{"type":"boolean"},"amount":{"type":"string"},"recipient_email":{"type":"string"},"recipient_name":{"type":"string"},"gift_message":{"type":"string"},"send_email_at":{"type":"string"},"purchaser_name":{"type":"string"},"auto_redeem":{"type":"boolean"},"redemption_code":{"type":"string"}}},"PrepaidSubscriptionResponse":{"type":"object","required":["id","subscription_id","virtual_gift_card_id","actionable_date","auto_redeem","gift","recurring","amount","single_installment_price","state","quantity","installment_count","interval_length","interval_units","line_items","recipient","virtual_gift_card"],"properties":{"id":{"type":"integer"},"subscription_id":{"type":"integer","nullable":true},"virtual_gift_card_id":{"type":"integer","nullable":true},"actionable_date":{"type":"string","format":"date-time"},"auto_redeem":{"type":"boolean"},"gift":{"type":"boolean"},"recurring":{"type":"boolean"},"amount":{"type":"string","format":"float","description":"Total amount that the customer paid upfront for this subsciption.\n"},"single_installment_price":{"type":"string","format":"float","description":"The amount of money the customer paid for a single installment upfront.\n"},"state":{"type":"string","enum":["pending","active","completed"]},"quantity":{"type":"integer","minimum":1,"description":"The number of items that will be in the shipment.\n"},"installment_count":{"type":"number","description":"The number of times that the subsciption should be fulfilled.\n"},"fulfilled_installment_count":{"type":"number","description":"The number of times that the subsciption has been fulfilled within\na billing period.\n"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"line_items":{"type":"array","items":{"type":"object","required":["quantity","variant"],"properties":{"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"}}}},"recipient":{"type":"object","required":["name","email","address"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"address":{"$ref":"#/components/schemas/address"}}},"virtual_gift_card":{"$ref":"#/components/schemas/gift_card"}}},"address":{"type":"object","title":"Address","properties":{"id":{"type":"integer"},"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string","nullable":true},"city":{"type":"string"},"zipcode":{"type":"string"},"country":{"$ref":"#/components/schemas/country"},"alternative_phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_id":{"type":"integer"},"country_iso":{"type":"string"},"phone":{"type":"string","nullable":true},"state":{"$ref":"#/components/schemas/state"},"state_id":{"type":"integer"},"state_name":{"type":"string"},"state_text":{"type":"string"}}},"country":{"type":"object","properties":{"id":{"type":"integer"},"iso":{"type":"string"},"iso3":{"type":"string"},"iso_name":{"type":"string"},"name":{"type":"string"},"numcode":{"type":"integer"}},"title":"Country"},"state":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"abbr":{"type":"string"},"country_id":{"type":"integer"}},"title":"State"}},"responses":{"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"unprocessable-entity":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object"}}}}}}}},"paths":{"/orders/{order_number}/line_items":{"post":{"summary":"Create order line item","description":"Creates a line item for an order.\n\n### Prepaid Subscriptions\n\nIf you want to offer your customers the ability to gift others subscriptions\nto item(s) (or simply pre-pay for a subscription for themselves), this is\nthe only endpoint in which you are able to do so. In order to do this, you\nmust do the following.\n\n1. The subscription can be either a single item or a collection of items.\n   If the subscription is a combination of several items, you should create\n   an overarching product that encapsulates the parts of the subscription.\n   (Ex: The product image and name for this product will be the one used\n   during checkout). **This product must have a price of 0.**\n2. Before adding to the cart, you must capture the recipient's address and information\n   before calling this endpoint.\n3. When the user adds this to the cart, you must add the overarching product\n   to the cart and fill in the `prepaid_subscription` object in `options`\n   with the captured information along with the product information of the items\n   in the box. All this is required is `sku` and `quantity`.\n\n**You are not able to edit a prepaid subscription once it is in the cart.**\n\nCheckout the examples on the right to see how to use this feature.\n","operationId":"create-order-line-item","tags":["Line items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddLineItemInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/line-item"}}}},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"422":{"$ref":"#/components/responses/unprocessable-entity"}}}}}}
```

## Cross-sell order line items

> Cross-sells order line items.

```json
{"openapi":"3.0.0","info":{"title":"OMS API","version":"1.1"},"tags":[{"name":"Line items"}],"servers":[{"url":"https://{host}/api","description":"Chord OMS instance","variables":{"host":{"default":"plant-staging.assembly-api.com","description":"Your tenant host, as configured in Chord OMS. The default is a Chord staging sandbox: replace it with your own host before making real requests."}}}],"security":[{"api-key":[]},{"order-token":[]}],"components":{"securitySchemes":{"api-key":{"type":"http","scheme":"bearer","description":"This is an admin level API token used for priviliged storefront\noperations. This should never be used in public contexts.\n"},"order-token":{"type":"apiKey","name":"X-Spree-Order-Token","in":"header","description":"This is a token that is assoicated with an order that allows operations\non that order. It is to be used as a means of authentication for guest\ncheckout sessions.\n"}},"schemas":{"LineItemInput":{"type":"object","title":"Line item input","allOf":[{"$ref":"#/components/schemas/LineItemIdentifier"},{"type":"object","properties":{"quantity":{"type":"integer","description":"The quantity of the item to be added to the cart. If `0` is passed or `quantity`\nis omitted from the payload, the item is removed from the cart.\n"},"options":{"type":"object","description":"This field can be used to pass custom line item attributes. When used, it will force a new price calculation, unless `price` is one of the options.","properties":{"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}}}},"subscription_line_items_attributes":{"type":"array","items":{"$ref":"#/components/schemas/subscription-line-item"}},"dynamic_promotions_attributes":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"digital_purchases_attributes":{"type":"array","items":{"type":"object","properties":{"metadata":{"type":"object","properties":{"auto_redeem":{"type":"boolean"}}}}}}}}]},"LineItemIdentifier":{"type":"object","oneOf":[{"title":"sku","type":"object","required":["sku"],"properties":{"sku":{"type":"string"}}},{"title":"variant_id","type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"integer"}}},{"title":"id","type":"object","description":"The existing line item ID of the item in the order","required":["id"],"properties":{"id":{"type":"integer"},"variant_id":{"type":"integer"},"sku":{"type":"string"}}}]},"part":{"type":"object","title":"Part within a parts array","properties":{"sku":{"type":"string","description":"SKU of the variant in the bundle"},"quantity":{"type":"integer","description":"The quantity of variant in this bundle"},"price":{"type":"number","format":"float","description":"The price of the variant in this bundle"}}},"subscription-line-item":{"description":"","title":"Subscription line item","type":"object","properties":{"id":{"type":"number"},"_destroy":{"type":"boolean"},"quantity":{"type":"number"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"end_date":{"type":"string"},"interval":{"type":"string","minLength":1},"sku":{"type":"string","minLength":1},"product_slug":{"type":"string","minLength":1},"subscription_type":{"type":"string"},"variant_id":{"type":"number"},"product_id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"options_text":{"type":"string"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"one_time":{"type":"boolean","description":"Indicates this is a one-time addition to the next installment"},"one_time_replace":{"type":"boolean","description":"Indicates this item replaces an existing subscription item for one installment"},"replaces_subscribable_id":{"type":"number","description":"When one_time_replace is true, the variant_id of the item being replaced"}}},"IntervalLength":{"type":"number","minimum":1,"description":"How many times a subscription should be fulfilled for a given\ninterval unit. Here are some examples.\n\n- Length = 1 and unit = `month` == once a month\n- Length = 2 and unit = `week` == every two weeks\n- Length = 1 and unit = `year` == once a year\n"},"IntervalUnit":{"type":"string","enum":["day","week","month","year"],"description":"The measurement of time applied to the interval unit of how often a\nsubscription is fulfilled.\n"},"image":{"type":"object","properties":{"alt":{"type":"string"},"attachment_content_type":{"type":"string"},"attachment_file_name":{"type":"string"},"attachment_height":{"type":"integer"},"attachment_updated_at":{"type":"string"},"attachment_width":{"type":"integer"},"id":{"type":"integer"},"large_url":{"type":"string"},"mini_url":{"type":"string"},"position":{"type":"integer"},"product_url":{"type":"string"},"small_url":{"type":"string"},"type":{"type":"string"},"viewable_id":{"type":"integer"},"viewable_type":{"type":"string"}},"title":"Image"},"dynamic_promotion":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"line-item":{"type":"object","title":"Line item","required":["adjustments"],"properties":{"id":{"type":"integer"},"adjustments":{"type":"array","items":{"$ref":"#/components/schemas/adjustment"}},"is_bundle":{"type":"boolean"},"subscription_type":{"type":"string"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/part"}},"total":{"type":"string"},"display_amount":{"type":"string"},"price":{"type":"string","format":"float"},"single_display_amount":{"type":"string"},"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"},"variant_id":{"type":"integer"},"metadata":{"$ref":"#/components/schemas/metadata"},"cross_sold":{"type":"integer"},"dynamic_promotions":{"type":"array","items":{"$ref":"#/components/schemas/dynamic_promotion"}},"gift_cards":{"type":"array","items":{"$ref":"#/components/schemas/gift_card"}},"pre_paid_subscription":{"$ref":"#/components/schemas/PrepaidSubscriptionResponse"},"digital_purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"redeemed":{"type":"boolean"},"metadata":{"$ref":"#/components/schemas/metadata"}}}}}},"adjustment":{"type":"object","properties":{"adjustable_id":{"type":"integer"},"adjustable_type":{"type":"string"},"amount":{"type":"string"},"created_at":{"type":"string"},"display_amount":{"type":"string"},"eligible":{"type":"boolean"},"finalized":{"type":"boolean"},"id":{"type":"integer"},"label":{"type":"string"},"promotion_code_id":{"type":"integer"},"source_id":{"type":"integer"},"source_type":{"type":"string"},"updated_at":{"type":"string"},"promotion_code":{"properties":{"id":{"type":"integer"},"value":{"type":"string"}}}},"title":"Adjustment"},"variant":{"type":"object","title":"Variant","properties":{"cost_price":{"type":"string"},"depth":{"type":"string"},"description":{"type":"string"},"display_price":{"type":"string"},"height":{"type":"string"},"id":{"type":"integer"},"images":{"type":"array","items":{"$ref":"#/components/schemas/image"}},"in_stock":{"type":"boolean"},"is_backorderable":{"type":"boolean"},"is_destroyed":{"type":"boolean"},"is_master":{"type":"boolean"},"name":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/option-value"}},"options_text":{"type":"string"},"price":{"type":"string"},"sku":{"type":"string"},"slug":{"type":"string"},"total_on_hand":{"type":"integer"},"track_inventory":{"type":"boolean"},"weight":{"type":"string"},"width":{"type":"string"},"metadata":{"$ref":"#/components/schemas/metadata"}}},"option-value":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"option_type_id":{"type":"integer"},"option_type_name":{"type":"string"},"option_type_presentation":{"type":"string"},"presentation":{"type":"string"}},"title":"Option value"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"properties":{},"title":"Metadata","description":"A key-value store of additional information. A key can be removed by\nsetting its value to null.\n"},"gift_card":{"type":"object","properties":{"id":{"type":"integer"},"filled":{"type":"boolean"},"amount":{"type":"string"},"recipient_email":{"type":"string"},"recipient_name":{"type":"string"},"gift_message":{"type":"string"},"send_email_at":{"type":"string"},"purchaser_name":{"type":"string"},"auto_redeem":{"type":"boolean"},"redemption_code":{"type":"string"}}},"PrepaidSubscriptionResponse":{"type":"object","required":["id","subscription_id","virtual_gift_card_id","actionable_date","auto_redeem","gift","recurring","amount","single_installment_price","state","quantity","installment_count","interval_length","interval_units","line_items","recipient","virtual_gift_card"],"properties":{"id":{"type":"integer"},"subscription_id":{"type":"integer","nullable":true},"virtual_gift_card_id":{"type":"integer","nullable":true},"actionable_date":{"type":"string","format":"date-time"},"auto_redeem":{"type":"boolean"},"gift":{"type":"boolean"},"recurring":{"type":"boolean"},"amount":{"type":"string","format":"float","description":"Total amount that the customer paid upfront for this subsciption.\n"},"single_installment_price":{"type":"string","format":"float","description":"The amount of money the customer paid for a single installment upfront.\n"},"state":{"type":"string","enum":["pending","active","completed"]},"quantity":{"type":"integer","minimum":1,"description":"The number of items that will be in the shipment.\n"},"installment_count":{"type":"number","description":"The number of times that the subsciption should be fulfilled.\n"},"fulfilled_installment_count":{"type":"number","description":"The number of times that the subsciption has been fulfilled within\na billing period.\n"},"interval_length":{"$ref":"#/components/schemas/IntervalLength"},"interval_units":{"$ref":"#/components/schemas/IntervalUnit"},"line_items":{"type":"array","items":{"type":"object","required":["quantity","variant"],"properties":{"quantity":{"type":"integer"},"variant":{"$ref":"#/components/schemas/variant"}}}},"recipient":{"type":"object","required":["name","email","address"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"address":{"$ref":"#/components/schemas/address"}}},"virtual_gift_card":{"$ref":"#/components/schemas/gift_card"}}},"address":{"type":"object","title":"Address","properties":{"id":{"type":"integer"},"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string","nullable":true},"city":{"type":"string"},"zipcode":{"type":"string"},"country":{"$ref":"#/components/schemas/country"},"alternative_phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_id":{"type":"integer"},"country_iso":{"type":"string"},"phone":{"type":"string","nullable":true},"state":{"$ref":"#/components/schemas/state"},"state_id":{"type":"integer"},"state_name":{"type":"string"},"state_text":{"type":"string"}}},"country":{"type":"object","properties":{"id":{"type":"integer"},"iso":{"type":"string"},"iso3":{"type":"string"},"iso_name":{"type":"string"},"name":{"type":"string"},"numcode":{"type":"integer"}},"title":"Country"},"state":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"abbr":{"type":"string"},"country_id":{"type":"integer"}},"title":"State"}},"responses":{"invalid-api-key":{"description":"Invalid API Key provided","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"not-found":{"description":"Resource is not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"unprocessable-entity":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object"}}}}}}}},"paths":{"/orders/{order_number}/cross_sell":{"post":{"summary":"Cross-sell order line items","description":"Cross-sells order line items.","operationId":"cross-sell-order-line-item","tags":["Line items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LineItemInput"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/line-item"}}}},"401":{"$ref":"#/components/responses/invalid-api-key"},"404":{"$ref":"#/components/responses/not-found"},"405":{"description":"The order is not in a state that allows cross-sells","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object"}}}}}},"422":{"$ref":"#/components/responses/unprocessable-entity"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/chord-oms/api-reference/line-items.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
