question

nirmal avatar image
nirmal Suspended asked nirmal Suspended commented

status code 400 when adding modifier to line item clover

I am adding some custom line item to order . I need to add some custom modifier to recognize item later. When i m adding modifier with line item id and order id i am getting status code 400 error.

Custom Modifiers
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.

nirmal avatar image nirmal commented ·

Hii I am using android SDK and using following code snippet :-

LineItem lineItem= mOrderConnector.addCustomLineItem(orderId, mItem, false); Modifier modifier= new Modifier(); modifier.setName("Demo"); mOrderConnector.addLineItemModification(orderId, lineitem.getId(), modifier);

0 Likes 0 ·

1 Answer

Dan avatar image
Dan answered Mark Mullan Deactivated commented

I believe that the modification that you add to a line item has to be a proper modifier in the merchant's inventor (can't make a one-off custom modification). Try adding a modifier with the uuid provided by InventoryConnector#getModifierGroups(...) and InventoryConnector.getModifiers(...).

Alternatively, could use InventoryConnector#createModifierGroup(...) and InventoryConnector#createModifier(...), and once it is persisted to the database you can get the proper modifier uuid and then should be able to add it to the order (don't actually do this for each order though).

10 |2000

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