question

bohyeon avatar image
bohyeon asked bohyeon commented

Issue Adding Modifiers with Line Items Using (bulk line items)

I am trying to use the /v3/merchants/{mId}/orders/{orderId}/bulk_line_items API to add line item information to an existing order in my Clover POS system. The line items are successfully added and visible in the POS UI. However, I am encountering an issue when trying to add modifiers along with the line items.

Here is the body data I am including in my API request:

{
  "items": [
    {
      "price": 1999,
      "name": "Chimichangas Burrito",
      "item": {
        "id": "4R6SKZB2T8A50"
      },
      "priceWithModifiers": 1999,
      "modifications": [
        {
          "modifier": {
            "available": "true",
            "price": "0",
            "modifierGroup": {
              "id": "4T91S3WWFSH66"
            },
            "id": "M9J48PHVQ4PRW",
            "name": "Carnitas"
          },
          "name": "Carnitas",
          "amount": 0
        }
      ]
    }
  ]
}

Despite specifying modifiers in my request, they do not seem to be added to the order along with the line items. Could you please advise on how to correctly include modifiers using this API endpoint?

Thank you!

OrdersREST APILineItemsModifiers
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

parquet76 avatar image
parquet76 answered bohyeon commented

That's not the way that API works. You need to add the modifiers separately - https://docs.clover.com/docs/creating-custom-orders. If possible I would create the order in a single request using the atomic order endpoint which does allow you to add modifiers.

5 comments
10 |2000

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

bohyeon avatar image bohyeon commented ·

Thank you for your previous responses!

I have a follow-up question regarding the addition of multiple modifiers. Specifically, is there a transaction-related feature in place to handle this process? For instance, if I'm attempting to add three modifiers and only one of them succeeds, is there a way to roll back the request to ensure consistency?

0 Likes 0 ·
parquet76 avatar image parquet76 bohyeon commented ·

No, adding a modification is an atomic action. If you want to remove the other modifications if adding one fails you would need to handle this yourself (API, remove modification). As I mentioned, I would strongly advise you to use the atomic order endpoint to create the order and get it done in a single request.

1 Like 1 ·
bohyeon avatar image bohyeon parquet76 commented ·

I understand that the atomic order endpoint is intended to create a new order rather than adding a line item with a modification.

Is there no API available to add a line item with a modification to an existing order?

I have tried using the API to add a line item to an order, but it seems that modifications are not being included.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community