question

wsadiq avatar image
wsadiq asked ·

Adding line items with modifiers using API

Hello,

I am trying to add line items to an order using the API. To be more specific, I am ordering bulklineitems api so that i can add multiple line items at once.

The problem I am having is with the modifiers. The line items get added fine but no modifiers are added and there are no errors. Here is the JSON that I am sending. Any help would be much appreciated.

{
  "items": [
    {
      "item": {
        "id": "361338"
      },
      "name": "Bread",
      "price": "245",
      "modifications": []
    },
    {
      "item": {
        "id": "361311"
      },
      "name": "Bagel",
      "price": "89",
      "modifications": [
        {
          "modifier": {
            "id": "4CYNQ0NVQ8DDM"
          },
          "name": "Egg",
          "amount": "80"
        },
        {
          "modifier": {
            "id": "FAY3KYGD1F4WW"
          },
          "name": "American Cheese",
          "amount": "50"
        }
      ]
    }
  ]
}
OrdersLineItemsModifiers
10 |2000 characters needed characters left characters exceeded

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

1 Answer

rachel avatar image
rachel answered ·

The bulklineitems endpoint does not add modifiers; that has to be done line item by line item via POST /v3/merchants/{mId}/orders/{orderId}/line_items/{lineItemId}/modifications. See https://docs.clover.com/build/working-with-orders/#add-item-modifiers for more detail about how modifiers are associated with line items. I appreciate why you would like to do everything in a single call, and have logged your feature request.

2 comments Share
10 |2000 characters needed characters left characters exceeded

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

@rachel
Is there any notification or hook clover gives after modifiers added to line item??

0 Likes 0 · ·

@Jai, there isn't a webhook for when a modifier is associated with a line item.

0 Likes 0 · ·

Welcome to the
Clover Developer Community