question

sseeger avatar image
sseeger asked Frank Faustino Deactivated commented

Completing an order via REST API

Hello!

I am writing a one-off app for a client that looks at current inventory stock numbers, and adjusts them based on user input. To adjust them, I am creating an order and adding the line items of the products I want to adjust, then applying a 100% discount to the order.

I have successfully created an order, added items to it, and applied a discount.

I need help with how to finish the order so that the stock of those items goes down according to the order and the order appears completed.

(I am currently working with an API token in the sandbox.)

Thanks,
Seth
REST APIInventory
2 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.

sseeger avatar image sseeger commented ·

I managed to apply a payment using /orders/orderID, {"order":{"id":"XXX"},"amount":0,"tender":{"id":"XX"}}. Now the order appears as "Paid". But the stock of the items has not been decremented.

0 Likes 0 ·
bruster999 avatar image bruster999 commented ·
@sseeger
if you are available to develop a one-off report that exports sales data, including customer name, please contact me. Thanks. 513-503-2505
0 Likes 0 ·

1 Answer

zgreathouse avatar image
zgreathouse Deactivated answered Frank Faustino Deactivated commented
Whether or not clover decrements the stock for the Merchant is actually a Merchant Setting which must be enabled. See docs on how to do this here:
https://www.clover.com/us/en/help/apply-inventory-setup-settings/
4 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.

sseeger avatar image sseeger commented ·

Thank you, @zgreathouse, but those two check boxes were already enabled.

0 Likes 0 ·
zgreathouse avatar image zgreathouse sseeger commented ·

When checking the stock of an item are you using the following endpoint to get the stockQuantity or are you checking the 'stockCount' field on an item?

GET v3/merchants/mId/items/itemId?expand=itemStock


(The 'stockCount' field is decremented. Please see our API reference docs)

2 Likes 2 ·
sseeger avatar image sseeger zgreathouse commented ·

I am checking the stock quantity through /items/itemID, looking at item->itemStock->quantity. I am also looking at it through the web interface. I have tried testing on items that have a fixed price, and those that have a per-unit price. The quantities never change. I am guessing that I am not closing out the order correctly.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community