Here are some user questions we have received and which may be of help in solving your issue. If you don't find a solution to your problem, do not hesitate to get in touch with DEAR support for an answer.
Do I need to whitelist any DEAR IP Addresses to allow connection with my servers or receive emails?
If you need to configure the host server(s) for your eCommerce stores or allow API clients to receive requests from DEAR, or you are not receiving any emails from DEAR, we recommend whitelisting the following DEAR IP addresses:
- DEAR Inventory IP address: 22.214.171.124
- DEAR Inventory mail server IP address: 126.96.36.199
- DEAR integration workers servers IP address: 188.8.131.52
The whitelisting of the mail server IP address is particularly helpful in case you're not receiving any emails from DEAR, which may have been dumped to your mail server's Spam folder all the while.
If you don't know how to go about whitelisting IP addresses, seek your hosting provider's support.
How do we use the API to pull/push orders from DEAR to our system?
To get DEAR orders into your system, you will have to send a POST request to subscribe to an event type (click for more information). The available event types are:
Once an order reaches a specified event type you have subscribed to, a JSON payload will be sent to the endpoint you specified during the webhook subscription. Using the "SaleOrderNumber" in the JSON, make a GET request to retrieve any relevant information. Click here for more details.
Is there a way to query by date and get more recent purchase orders via the DEAR API?
We are developing a couple of internal systems that will be using the DEAR API and it seems that when I search using the UpdatedSince field and use today's date, it returns transaction with very old dates. Is there a way to query by date and get more recent purchase orders?
We recommend that you use webhooks, as these can return data when actions/events happen with your sales and purchases. You can find more information about webhooks here. Webhooks work through the Automation module in DEAR. If you're not subscribed to the Automation module yet, you can try it out for 30 days, which would be enough time for you to check if it helps meet your requirements. For more information on adding the Automation module to your DEAR subscription, click here.
How do we get the shipping address for the order using DEAR API?
- Sale (see https://dearinventory.docs.apiary.io/#reference/sale)
- Sale/Fulfilment (see https://dearinventory.docs.apiary.io/#reference/sale/sale-fulfilment)
- Sale/Fulfilment/Ship (see https://dearinventory.docs.apiary.io/#reference/sale/sale-fulfilment-ship)
Can DEAR API identify the different order lines, when there are multiple items in an order?
Yes, DEAR API can handle this scenario. The following sample code illustrates this (note the boxed lines):
We have a warehouse for fulfilling orders. When an order is placed in DEAR, we get the order information using a webhook. Once we get the order, what are the next steps for sending order status to DEAR, given we pick, pack and ship the order ourselves? Explain the steps in detail, together with the JSON and the API endpoints that will allow us to update the order status in DEAR.
You will need to create or update existing fulfilments in DEAR by supplying specific products picked, boxes and shipment details. Please find these three (3) API endpoints with sample requests in the documentation.
You can use the API explorer to test the payload and how it affects the sale.
If you would like to skip the details and just update the sales orders with shipped status, you can use the auto-pick parameter in the Pick endpoint.
How do we use the API to notify us when an order is cancelled? Can a buyer still cancel the order if it has been shipped already?
Order cancellation is known in DEAR as Void or Undo. Orders can be undone or voided at any point in the order.
You can use the Sale/Voided and Sale/Undo events in DEAR webhooks to be notified when an order is cancelled, and update your system using the SaleID in the payload. See https://dearinventory.docs.apiary.io/#reference/webhooks/webhooks for more information.
To be able to use webhooks, you should add the Automation module to your DEAR subscription. See Adding Trials of the POS, B2B, API and Automation Modules to Paid Plans for more information. You can also get more details from DEAR Customer Support.
How does DEAR handle buyer returns and communicate these using the API?
All returns in DEAR are processed as credit notes. For more information, see Customer Credit Notes and Refunds.
For more information on how the DEAR API handles Purchase credit notes, see the links in our DEAR API documentation below: