question

et-taoussy avatar image
et-taoussy asked et-taoussy commented

There is a good way to get subtotal withount calcule 429 Too Many Requests

Hi,

I'm using REST API to calculate order subtotal from order lineItems but i get already 429 Too Many Requests.

what's the best way to get it without doing a lot of requests.

Thank you.

Discounts
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.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

What endpoint are you using?

0 Likes 0 ·

1 Answer

et-taoussy avatar image
et-taoussy answered et-taoussy commented

i'm using https://api.clover.com/v3/merchants/M...id/lineitems/item_id for every discounted item.;

3 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.

Mark Mullan avatar image Mark Mullan commented ·

Pseudocode, the subtotal can be calculated by Order.total - sum(Order.payments.tipAmount).

As such, the endpoint you'd likely find more helpful is https://sandbox.dev.clover.com/v3/merchants/{MID}/orders/{orderID}?expand=payments

0 Likes 0 ·
et-taoussy avatar image et-taoussy commented ·

Hi, but there is not tipAmount attribute in payment did you mean amount. but if the employee make just partial payment how can i check that.

0 Likes 0 ·
Mark Mullan avatar image Mark Mullan commented ·

A Payment has a tipAmount property that, if not present, will be null. Display all the properties with the return_null_fields=true query param.

The order.payType has possible values of ['SPLIT_GUEST' or 'SPLIT_ITEM' or 'SPLIT_CUSTOM' or 'FULL'], if you want to determine if an order has been paid for in full, or not. For additional logic at the Payment level, you'll need to check if the payment.amount == order.total.

Hope this helps-

Mark

0 Likes 0 ·

Welcome to the
Clover Developer Community