question

lalitindoria avatar image
lalitindoria asked zgreathouse Deactivated edited

Bulk line items API not working

I am sending the following JSON to https://api.clover.com:443/v3/merchants/{mid}/orde...
{"items":[{"item":{"id":"3DFXQ6NS2QKDY"}}]}
I am using the API tool here https://www.clover.com/api_docs/ to test it out and it responds with a status code 0.
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.

1 Answer

zgreathouse avatar image
zgreathouse Deactivated answered zgreathouse Deactivated edited
If you are testing a sandbox account, go to this api reference instead. The api docs you are currently on is for Prod, so sandbox requests won't work.

Please note:
As of right now the Bulk Line Items endpoint has a bug where it is not building the line item with the inventory item info based on the id passed in. I recommend passing in the "name" so it displays properly on the screen and the price of the inventory item. Note that a price is a required field for this endpoint. Passing the item, with "id" is good because that way (upon closing the order) the item's stock is updated. If you are making a custom line item, you do not need to pass in the item id.
//Request body example
{
	"items": [
		{
			"item": { "id": "VDR2QYCABGV9Y"}, 
			"price": 350,
			"name": "Pizza Slice"
			
		},
		{
			"item": { "id": "DQ22K8Z8RQGGC"}, 
			"price": 200,
			"name": "Fountain Drink"
		}
	]
}
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