Ordering via API for White-Label Resellers

On this page, you can find an introduction to all the Ordering Endpoints of the API V.3 that are available to White-Label Resellers (Free Edition & Standard Edition). You will also find flow examples, expected results, and extensive explanations for each Order Endpoint.

 

Order Endpoints for White-Label Resellers


In the following two tabs, you can find the available Order Endpoints for each Reseller based on their Edition, Free and Standard.

 

General Flow of Order Creation & Execution via API V3


The Standard Edition Reseller API user can proceed with the following main steps (as well as the optional ones) to create, checkout, and view one or more orders via the API V3:

  1. Create an Order.

  2. Create an Order Item inside the previously created Order.

  3. (Optional): Delete an Order Item from within a previously created Order.

  4. Execute the Order, containing Order Items.

  5. (Optional): View all the Orders or specific ones.

  6. (Optional): View all Order Items or specific ones.

  7. (Optional): Retrieve & Add Additional Information to a created Order.

The Free Edition Reseller API user can retrieve information via the numbers 5, 6, and partially from 7, mentioned above.
The Standard Edition Reseller API user can perform all the aforementioned actions (1-8).
Below, you can find a list of the aforementioned actions along with their expected results, in terms of creating an order, creating an order item, deleting an order item, executing an order, and viewing an order.

 

How to Create an Order Step 1

POST /api/orders : By invoking this call, the Reseller API user will generate an order which will be in Draft status.
The Reseller API user can create more than one draft order via the API as there will be no limitation. Draft orders created via the Reseller API have an expiration date of 7 days from the creation of the order (expirationDate = orderDate + 7 days). Once the expiration date passes, the draft order will be deleted. Moreover, the Reseller account is available for selection. Also, all end customers' accounts of the Reseller are available for selection. Lastly, the AccountID is the only mandatory field for creating the order. Please note that during the POST, the default date will be set to {today}.

How to Create an Order Item Step 2

POST /api/orders/{orderId}/items : By invoking this call, the Reseller API user will generate an order item for an existing order based on the given Order ID. The scope of this action involves creating an order item within an existing order, specified by the provided Order ID. Please note that the Reseller API user can ONLY add order items to orders that are in Draft status.

 

How to Delete an Order Item Step 3 (Optional)

DELETE /api/orders/{orderId}/items/{itemId} : By invoking this call, the Reseller API user will delete an existing order item of an existing order based on the given IDs (Order ID & Item ID). Please note that the API Reseller user can ONLY use this call to delete a particular order item from an order that is in Draft status.

 

How to Execute an Order Step 4

POST /api/orders/{orderId}/checkout : By invoking this call, the Reseller API user will send a request for a specific Draft order to be executed. Please note that the execution of an order can only be done when the order is in Draft status, as previously mentioned.

How to View the Orders Step 5 OPTIONAL

  • GET /api/orders : By invoking this call, the Reseller API user will retrieve all orders belonging to them as well as those for their end customers. Essentially the user can view both the confirmed orders as well as the draft orders. Specifically:

    • Confirmed orders: The confirmed orders term refers to ALL the orders EXCEPT the orders with statuses Draft and Reseller Pending Approval, Cancelled by Reseller. To retrieve only these orders, you need to add the staging "Confirmed" to the URL.” → GET/{{base-url}}/api/orders?stage=Confirmed

    • Draft orders: These are the orders that have the status of "Draft" and have been created either by the STR or by the API. To retrieve only these orders, you need to add the staging "Draft" to the URL.” → GET/{{base-url}}/api/orders?stage=Draft

    • All orders: These are all orders regardless of whether they are confirmed orders or draft orders. To retrieve all these orders, you need to add the staging "All" to the URL.” → GET/{{base-url}}/api/orders?stage=All
      By default, the confirmed orders are the result of the call.

  • GET /api/orders/{orderId} : By invoking this call, the Reseller API user will retrieve a specific order based on the given Order ID. The result of this call is to bring the order with the specified id, whether it is confirmed or draft.

  • GET /api/orders/{orderId}/execute/status : By invoking this call, the Reseller API user will retrieve the execution status of a specific order. This means that the API Reseller user has the ability, with this specific call, to see the status of a specific order that is confirmed ONLY.

 

How to View Created Order Items Step 6 OPTIONAL

  • GET /api/orders/{orderId}/items/{itemId} : By invoking this call, the Reseller API user will retrieve a specific order item of a specific order based on the given IDs. The result of this call is to bring a specific order item from a specific order, whether it is confirmed or draft.

  • GET /api/orders/{orderId}/items : By invoking this call, the Reseller API user will retrieve the items of a specific order based on the given ID.
    The result of the call is to bring the order items from specific order, whether they are confirmed or draft.

 

How to Retrieve/Add Additional Information to a Created Order Step 7 OPTIONAL

  • GET /api/orders/{orderId}/customfields : By invoking this call, the Reseller API user will retrieve the custom fields* of a specific order based on the given ID.

  • PUT /api/orders/{orderId}/customfields : By invoking this call, the Reseller API user will update the values of custom fields* of an existing order based on the given ID.

  • GET /api/orders/{orderId}/items/{itemId}/characteristics : By invoking this call, the Reseller API user will retrieve the order characteristics of a specific item of a specific order based on the given IDs.

  • GET /api/orders/{orderId}/items/{itemId}/characteristics : By invoking this call, the Reseller API user will update the characteristics of an existing item of an existing order based on the given IDs.

* The custom fields that the Reseller API user can retrieve are the order custom fields that are published to Storefront, as analyzed here on the Adding Extra Fields in Checkout Forms | AddingExtraFieldsinCheckoutForms AddingFieldsinCheckoutFirstPage page.

 

Table of Contents