question

vyasnrao avatar image
vyasnrao asked vyasnrao commented

ISSUE: Unable to add a single line item with modifiers using Clover REST API

Hi,

I am trying to add a single line item with modifiers using the Rest API. I see answers that its not possible while adding bulk line items (The documentation for both suggests that this should be possible)

This is the request I am sending.

URL: https://sandbox.dev.clover.com/v3/merchants/MERCHANTID/orders/ORDERID/line_items
Request Type: POST

"item": {
    "id":"9S1MXGERPQ7ER"
    }
"modifications" : [{
   "modifier" : {
        "id" : "ZM8MV5X3M7R72",
        "modifierGroup": {
            "id" : "YC351CMAHF6AY"
        }
    },
    "modifier" : {
        "id" : "0X5A869PQT858",
        "modifierGroup": {
            "id" : "XZP32FHXQWKE6"
        }
    }
}]


The item gets created fine. but none of the modifiers are added.


I checked that creating a line item initially and then making an explicit call to the below URL to add modification works fine, but with this approach we can only add 1 modifier per call.

https://sandbox.dev.clover.com/v3/merchants/MERCHANTID/orders/ORDERID/line_items/LINEITEMID/modifications

Request: 
{
    "modifier" : {
        "id" : "ZM8MV5X3M7R72"
    }
}

With this approach we have to make multiple calls per line item based on number of modifiers selected.


Am i missing something here? Any help regarding how to add the line item with modifiers in a single call would be appreciated.



OrdersLineItemsModifiers
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

David Marginian avatar image
David Marginian Deactivated answered vyasnrao commented

No, you are not missing something. Unfortunately the current API has no mechanism to add modifications in bulk.

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.

vyasnrao avatar image vyasnrao commented ·

Hi David,

Thanks for confirming that. But i am trying to add the modifications while creating a single line item.

Is that not supported as well?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ vyasnrao commented ·

No it isn't and I do realize the API reference makes it look like it is. Here is a doc page for working with orders https://docs.clover.com/docs/working-with-orders

1 Like 1 ·
vyasnrao avatar image vyasnrao David Marginian ♦♦ commented ·

Thanks David. Yes i checked that link and currently that's how we are proceeding with creating an order and line item.

Are there any chances that we could see this feature shortly? Is there a feature request that we could Upvote maybe?


0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community