Order Flow

After the sales representative or customer creates and submits Orders on the RepSpark web or mobile app, it is then time to retrieve and import the Orders into your ERP system for further processing and fulfillment.

Retrieve submitted Orders from the RepSpark API, successfully import them into the ERP, and then return an Order Confirmation to RepSpark, so that the Orders page on the RepSpark user interface can indicate that the Order is valid. Valid Orders ideally also display an ERP reference number that the sales representative or customer can also use to reference the Order.

A submitted Order that has been retrieved but does not successfully become valid after a day or so can be considered stuck and may require technical support.

After you have read and understood the process for fetching Orders from the RepSpark API, please refer to the Order Confirmation resource for more information.

Exporting Orders

Orders are exported using the GET HTTP verb only. Order exports require the usage of a case-insensitive query string parameter of either StatusId or OrderId. The most common operation is to fetch Orders for export using a StatusId of 1 (Submitted) as the query string parameter. When specifying StatusId, the API will fetch all Orders with the given status in the previous 6 months.

For instance, making a GET call using the URL https://api.repspark.net/api/order?statusId=1
returns a JSON array of Order objects that are submitted Orders within the last 6 months. This specific parameter will also automatically convert the Orders' StatusIds to Sent (2). We recommend retrieving newly submitted Orders several times per day, depending on customer Order submission frequency.

You may also retrieve a single specific Order using the OrderId parameter. For example, calling the API with GET on https://api.repspark.net/api?orderid=8086 will return the Order JSON for Order 8086, regardless of the Order's StatusId. Doing this will also not change the current StatusId, unlike using a StatusId of 1 as the parameter. This query string does not support the retrieval of multiple Orders at a time. Separate calls must be made to get multiple Orders.

Statuses

When you retrieve an Order from the API, the Order usually has one of four common statuses: Draft/Open (9999), Submitted (1), Sent (2), and Valid (4). The value returned by the StatusId attribute in the Order object is numerical.

StatusId flows in the following direction: 9999 > 1 > 2 > 4

Draft/Open (9999)

An Order has been created (e.g. products have been added to a cart, and the Order header has been set) on the RepSpark web or mobile app but not yet submitted by the customer or sales representative. Unless you specify the specific OrderId you are retrieving from the API, Orders returned from the API will generally not have this status as typically only Submitted Orders are retrieved.

Submitted (1)

An Order has been submitted on the RepSpark web or mobile app, but has not yet been imported into the brand's ERP yet.

Sent (2)

An Order has been submitted on the RepSpark web or mobile app and has been retrieved from the API via GET, but has not been validated and confirmed via an OrderConfirmation API call. At this point, it is presumably within the ERP, but may or may not have been processed on the ERP side.

Orders that have been retrieved while specifying a StatusId of 1 (Submitted), are automatically changed to Sent Orders, to differentiate between Orders that have been pulled from the brand/ERP side and those that have not. In other words, calls made with a StatusId of 1 are not idempotent.

Unless you specify the specific OrderId you are retrieving from the API, or specify that you want to pull Sent Orders with a StatusId of 2, Orders returned from the API do not generally have this status as it is typically only Submitted Orders that are retrieved in the normal flow. Under certain circumstances, for example, some failure on the ERP side causing the Order to not successfully register within the ERP, you may need to re-retrieve Orders that are marked as Sent on RepSpark.

Valid (4)

Order has been submitted on the RepSpark web or mobile app, and exists in the brand's ERP. The brand's ERP has returned a successful OrderConfirmation to RepSpark via the API. The Order should generally also have an associated reference number generated by the API.

In the normal flow of Order retrieval from the API, Orders usually do not have a valid status unless you explicitly specify an OrderId that is Valid or a StatusId of 4. Typically, only Submitted Orders are retrieved. There may be niche purposes for retrieving already Valid Orders from RepSpark.

🕑

Recommended sync cadence

As often as possible (e.g. every 15 mins) to allocate inventory to orders in the ERP.

Please refer to right side for example order payload

Please refer to right side for example order payload

📘

Please click the 200 OK Response below to view all payload field descriptions.

Language
Authorization
Basic
base64
:
URL