DOCS

Retrieve an order

/

Retrieve an order

Retrieve a list of order numbers or detailed information about an order.

This “Retrieve an Order” API endpoint is used to retrieve data for a completed order inside the Zonos System. The response will contain a JSON object, representing all the available information for the order including billing and shipping addresses, shipping method, order totals, and status.

Endpoints 

Order numbers

Retrieves a list of order numbers.

Order details

Retrieves detailed information for an order.

Retrieve an order API endpoint usage

There are two common ways to use these endpoints.

  1. (Part 1 + Part 2) – Use a custom order confirmation / success page on your domain to trigger your system to call the orderDetail endpoint and import a completed order. In addition, regularly call the orderNumbers endpoint to reconcile any orders in the Zonos System not imported into your system.
  2. (Part 2 Only) – Use the Zonos basic order confirmation / success page or a static page on your domain to indicate order completion to the customer. Schedule your system to regularly call the orderNumbers endpoint to determine when a new order is ready to be imported in your system. When an outstanding order is found, call the orderDetail endpoint for the data on those orders.

Part 1: Success page on your domain

Every time a buyer completes an order in the Zonos Checkout, they are immediately redirected to an order success page URL. The completed order ID will be appended to the redirect URL as a query string. The URL of the order success page should be provided to Zonos. The URL can also be passed as a parameter in the createTempCart endpoint when creating the temporary cart in the Zonos System.

Example: http://www.examplestore.com/internationalThankYou?orderId=999-99999

When a customer is redirected to this page, your system will need to parse the value for orderId from the URL. You will then use the orderId to call the orderDetail endpoint to retrieve the order data.

Part 2: Use a scheduled job

In addition to calling for order details when the success page is triggered, we recommend you set up a scheduled call for all orders and their details as a catch-all. This way, you can retrieve any completed orders in the Zonos System that have not yet been imported into your system.

This process should be a scheduled job/script, such as a Cron job, ran once an hour/shift/day/etc. (schedule as often as your business processes deem necessary). The script should call for all orders and their details that have occurred since the last call for orders. The orderNumbers endpoint allows you to retrieve orders sinceOrderId or sinceDate as demonstrated on the API test GUI located here. All the orders retrieved through this scheduled call should then be reconciled against the orders inserted into your system each time the success page was triggered. Any orders not already in your system should be inserted into your system and treated as legitimate orders.

Initial order status

IGLOBAL_ORDER_IN_PROCESS or IGLOBAL_FRAUD_REVIEW

When calling the orderDetail endpoint, we recommend that your system first checks the orderStatus property of the order data.

Orders that do not require fraud review will initialize with orderStatus : IGLOBAL_ORDER_IN_PROCESS. An order in this status is ready to be processed and shipped.

Orders that do require fraud review will initialize in orderStatus : IGLOBAL_FRAUD_REVIEW. An order in this status is currently being screened and reviewed for suspected fraud. We recommend you place this order on a review or hold status in your system and continue to call the orderDetail endpoint until the order progresses past Zonos’ fraud review process.

Once the Zonos fraud screening process is completed, the order will move to one of the following states:

  • Order passes fraud screening

    • The order will move to orderStatus : IGLOBAL_ORDER_IN_PROCESS and can continue toward shipment.
  • Order fails fraud screening

    • The order will move to orderStatus : IGLOBAL_ORDER_CANCELLED and should be cancelled in your system.

API test GUI

Please contact support for your account credentials.

Was this page helpful?