question

Jean Holland avatar image
Jean Holland asked nancychaput sent

REST API returns zero for all order lines

I am trying to calculate the total cost of goods sold for an order. It was suggested to me to use the line item quantity sold times the unit cost of the item. The quantity sold is always zero from the response to the API request for Order Line items. Does this mean there was 1 item sold? If so, then I still am coming up short between my application and the Clover report. Your assistance would be greatly appreciated.

REST API
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

·
parquet76 avatar image
parquet76 answered parquet76 edited

I am not sure what fields you are talking about, I was talking about unitQty, per the REST API reference:

unitQty
integer


This is applicable only if the item is priced by quantity of a unit. The item must have a priceType of PER_UNIT. The value is a fixed-point integer with scaling factor of 1000 (e.g. if charging per ounce, the value should be set to 2500 for 2.5 ounces). To compute the complete price perform the following calculation: PRICE * (UNIT QTY / 1000). If the item doesn’t have a priceType of PER_UNIT, then unitQty is ignored.


If you don't have any items priced by quantity, then you don't have to worry about this. I was just trying to guess at something that could be off. The bottom-line, we don't have access to your data and have no information, are you fetching all of the orders, are your date ranges correct, etc. etc. etc. You have the data, you are going to have to figure this out. We can't just take a guess with the limited information you have provided.

10 |2000

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

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