question

hammad avatar image
hammad asked hammad published

Updating an Order with LineItems

Hi,
I want to update an order automatically with the line Items of another order.
The situation is that we use cloverGo for payments.
What it does is, that after the payment, a new order is created, and the payment is associated with that particular order.

So i need to update the paid order with the actual order details such as customer, employee and the lineItems.
The rest of the values get updated in a single call, apart from the LineItems.

I have been following the references from https://docs.clover.com/clover-platform/reference#updateorder-1

I currently do something like this.

<a href="https://docs.clover.com/clover-platform/reference#updateorder-1">let customParams = {
      'lineItems': [
        {
          'item': {
            'id': 'XXXX'
          },
          'unitQty': 1000,
          'modifications': [
            {
              'modifier': {
                'id': 'XXXX',
                'name': 'Abc',
                'price': 1.00
              }
            },
            {
              'modifier': {
                'id': 'XXXX',
                'name': 'XYZ',
                'price': 1.00
              }
            },
            {
              'modifier': {
                'id': 'XXX',
                'name': 'GHI',
                'price': 1.00
              }
            }
          ]
        },
]</a>

and then pass this to the update endpoint.

Having read on multiple forums that this is not yet supported. But if it's not supported, why is it still listed under the API references?

The other method is creating a single line item for an order using the API, and then attaching modifiers to the Line Item created one by one.
This increases the amount of calls being sent to the clover API.

I have 10 line items, each with 4 modifications. it would easily mean 40+ calls to the API

Is there any other method to achieve this or is this the only way?
OrdersLineItems
10 |2000

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

0 Answers

·

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