Unable to add a single line items with modifiers using Clover POS REST API

504 views Asked by At

I am trying to add a single line item with modifiers using the Rest API. I see answers that it's 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?

1

There are 1 answers

0
Mujeeb Ur Rehman On

I have the same problem. you are missing the name and amount property of the modifier. These are required fields e.g

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" }, }, "name": "yourModifierName", "amount": "amountOfModifier" }]