question

coder12 avatar image
coder12 asked Lee Tickett answered

Create a line item from Item and attach to order

Hi, So I managed to follow along the api docs to get categories and items but one issue I am having is determining how to create a line item from an item. Do i have to do an api call or do I just simply create a new line item instance in code and copy the properties over from item to line item. Also how can I attach modifiers to line items.
OrdersREST APILineItemsModifiersCustom Modifiers
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Lee Tickett avatar image
Lee Tickett answered
All of our apps use custom line items BUT it looks to be pretty simple to to attach an inventory item. Just copy the properties (price, description etc) and add the item reference in the json body;
  "item": {
    "id": "[itemId]"
  }
It's probably worthwhile trying without copying the inventory item properties just in case the API automatically does it for you. Probably wishful thinking though!
Similarly with modifiers- simply at the reference;
  "modifier": {
    "id": "[modifierId]"
  }
From: https://docs.clover.com/clover-platform/docs/working-with-orders
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community