Order Updates
Summary
Order Updates are how you will keep Compare and Recycle up-to date with the status of ongoing orders; via a merchants system making calls to our endpoint at each stage of the order flow.
You can view the API reference here! (opens in a new tab)
At present these status updates are used internally, and are not provided to customers.
Order Statuses explained
A bold status, such as: this_status
, indicates a required order update. These required statuses are an absolute minimum requirement for onboarding.
Our Order Update statuses
pack_sent
when packaging has been sent out to the customer for them to ship their device inawaiting_device
when the customer has chosen to use their own packaging, and you're awaiting its arrivaldevice_received
when you have received a device from a customer, and it is pending inspectiondevice_inspected
when you have successfully carried out an inspection on the devicenew_offer
when you have made an amendment to your offer, based on the findings of the device inspectionamendment_rejected
if the customer rejects the revised offerdevice_shipped
when the device has been shipped back to the customerpayment_pending
when the customer has accepted the offer for their device, and you have yet to make the paymentorder_paid
when the customer has been successfully paid for their device
Making a request
We recommend running requests in a background queue as soon as an event has updated. However these could also be ran as an action.
Endpoint URL
https://orders.atomjuice.io/update/{status}?merchant_order_id=MERCHANT_ORDER_ID&reason=REASON
Headers
Authorization tokens will be provided during set-up; and is unique to each listing.
Authorization: Token {YOUR_TOKEN}
Parameters
Parameter | Type | Required | Notes |
---|---|---|---|
status | URL | Yes | One of: pack_sent , awaiting_device , device_received , device_inspected , new_offer , payment_pending , amendment_rejected , order_paid or device_shipped |
merchant_order_id | QUERY | Yes | This should be the appropriate internal order id; and can be any string value. |
reason | QUERY | Yes | A string providing the reason for the status change e.g. Packing sent 01 01 2020 . Special characters such as spaces will need to be encoded. |
price | QUERY | No | If a new_offer has been sent to the customer this should be the amended price. |
tracking | QUERY | No | A tracking number for when a device is shipped back to the customer. |
Sample request
GET /update/device_inspected?merchant_order_id=1&reason=Device%20Inspected%2001%2001%202020 HTTP/1.1
Host: orders.atomjuice.io
Authorization: Token 371406578e0dc4863ceddc1da832e519fd70593b
Response
Parameters
Parameter | Notes |
---|---|
success | true or false |
detail | A string description of why the request may have failed |
Sample response
This is an example of a successful response.
HTTP/1.1 200 OK
{"success": True, "detail": null}
This is an example of an unsuccessful response.
HTTP/1.1 200 OK
{"success": True, "detail": "Status not updated"}
Error responses
Error responses will not include success but will have a invalid status code and a detail field.
When the order being updated doesn't exist.
HTTP/1.1 400 Bad Request
{"detail":"The order you are trying to update doesnt exist"}
When we are unable to verify the provided token in the auth header.
HTTP/1.1 401 Unauthorized
{"detail":"Unable to verify token"}
When a required parameter is missing.
HTTP/1.1 422 Unprocessable Entity
{"detail":"You are missing a required parameter"}