question

mybmr avatar image
mybmr asked mybmr commented

How do I add existing modifier in Order using OrderConnector?

I tired below code to add modifiers after creating order.

Reference modifierGroup =new Reference();
modifierGroup.setId("RRDWBDC7RRHNM");

Modifier modifier= new Modifier();
modifier.setModifierGroup(modifierGroup);
orderConnector.addLineItemModification(orderID, order.getLineItems().get(0).getId(), modifier);


But I'm getting below error ->

status code 400 when adding modifier to line item clover


Can please provide snippet code for adding existing modifiers in order using clover OrderConnector ?

OrdersModifiers
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

·
bryanvargas avatar image
bryanvargas answered mybmr commented
1 comment
10 |2000

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

mybmr avatar image mybmr commented ·

Tried mention sdk documentation code, getting below error.


List<ModifierGroup> modifierGroups = inventoryConnector.getModifierGroupsForItem(itemID);

//Check if any modifier is available to the item
if (modifierGroups.size() > 0){
        List<Modifier> modifiers = modifierGroups.get(0).getModifiers();
        if (modifiers.size() > 0){
                orderConnector.addLineItemModification(order.getId(),item_id, modifiers.get(0));
            }
}

orderConnector.updateOrder(order);

result = {ClientException@8438} Method threw 'com.clover.sdk.v1.ClientException' exception.

resultStatus = {ResultStatus@8463} "ResultStatus{statusCode=UNKNOWN, statusMessage=null}"

backtrace = null

cause = {ClientException@8438} "com.clover.sdk.v1.ClientException: status code: -1"

detailMessage = "status code: -1"

0 Likes 0 ·

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