Working with DEAR’s API
Everything You Need To Know
This article is intended as a summary of some of the best practices and considerations for connecting to the DEAR API – in this case for sending sales into DEAR Inventory – although the logic applies to any connection.
Obviously, there’s a tonne of specific detail per client and per connection but the information below should give a great start for anyone wanting to work with the API.
Firstly, please note that DEAR has a completely open Restful API with JSON format calls, and in a general sense you should find pretty much everything you need for day-to-day operations is accessible. The API is used by Amazon, Shopify, Xero, QuickBooks Online and much more, so most database information is available.
Our general suggestion for the best way to start is to review the documentation at https://dearinventory.docs.apiary.io/. This contains information on accessing, query examples, response examples and property information. It’s highly likely that after this that you may well have queries on how to perform specific tasks and for this, it’s always worth engaging an expert.
Before looking at the API itself – let’s review what’s what's in the front end of the DEAR API.
The easiest way to test the API is to find a transaction which is in the state you want, or of the style that you want, and then perform a “GET” from the API to review the information, example.
https://inventory.dearsystems.com/ExternalApi/v2/sale?ID=[INSERTSALEIDHERE]
Note, this will give you a LOT of information. My example here has over 600 lines because you have an Order, Fulfilment, Invoice, Credit and more.
You don’t need all this information. For the latest field overview including restrictions (i.e. which fields need to be specific lengths or values) as well as which are required, see the DEAR API guide at https://dearinventory.docs.apiary.io/#
If you only want to send a Sales Order in (terminology is important here), then you don’t need all the fulfilment, invoice, credit etc. information. That would look something like the below.
As mentioned in the previous videos, you can send a sale, and then send various updates as you need to mark something PICKED, PACKED, INVOICED etc. Let’s start with the Order Lines, then Pick, and look at a practical example.
From that point, you can follow this call with various update calls using the same logic (i.e. making sure you have the Sales ID, and also making sure you replicate the ‘front end’ process. In other words, you cannot pack before pick, you can’t credit what you haven’t already got on an Invoice and so on.
Obviously, there are several hundred different API calls so therefore we suggest a 1-1 discussion with us if you have specific client needs, but hopefully this is a good overview of some of the common best practises and first steps with the DEAR Inventory API.