Getting started Insights: Orderflow

By combining the different API resources, order flows are created. Each flow consists of different phases. Each phase is documented as a sequence diagram with contextual description. A phase may include one or more calls to different API resources.

Flow: Order Composed API Product

This flow - the three dark blue phases - describes how to order a Composed API product. A Composed API product is a webshop product configuration that is stored as an API product in the reseller’s webshop account. A typical preconfigured product could be a digital printed aluminum panel with a fixed size and a finishing such as mounting holes in each corner.

Preparation: Compose API Product

To be able to order a preconfigured webshop product an API product needs to be composed. The first step is to contact Probo and become a reseller. A webshop account will be created for you, which will be configured for API usage.

Login to the Probo webshop. Make sure to enable the API mode. Start composing a product as if a product is ordered through the webshop. While composing a product, the API codes to be used over the API will be shown in the webshop frontend. When you reach the ‘save to cart’ stage, you will be able to save the product composition as an API product and define your own `customer_code` for it. You will be able to copy the payload of the composed product, including the product code and selected options. The `customer_code` is used to reference the composed product over the API.

Compose a product on the Probo webshop:

API-codes are shown while composing a product:

Instead of placing the composed product in the shopping cart, save it as an API product

In the API menu, an overview of your API products with the assigned customer_code is shown:

Phase: Select API Product

Use the /apiproducts resource to receive all Composed API products.

This resource returns a customer_code list.

Use /apiproducts/product/{customer_code} to receive details about a specific Composed API product. This resource returns information about:

  • the product code and selected options such as coating, milling and drillholes which composed the API product,
  • amount and dimensions (which can be overridden),
  • price (purchase- and sales price) per product depending on desired production time
  • total price (purchase- and sales price) depending on desired production time

Phase: Calculate Product Prices

Use the /price resource to receive the calculated price of one or more Composed API products, each for a specific amount and dimension. Include an id for each product to be able to reference the returned prices with the correct products. The id’s provided should be unique, or not provided at all. When no id’s are provided, the API will assign id’s by the order in which the products where provided.

The payload should include either code and selected_options as returned by the /apiproducts/product resource, or customer_code with optional overrides for the amount, height and width options. The calculation takes into account the provided delivery address, delivery date and desired shipping method.

Phase: Order API Product(s)

Use the /order resource to place an order. Post information such as:

  • your own order id and reference,
  • contact email,
  • delivery address
  • product(s) with dimensions, amount, and uri(s) to the print files. The payload should include either code and selected_options as returned by the `/apiproducts/product` resource, or customer_code with optional overrides on the amount, height, and width options.
  • callback_url to receive order status
  • Motiflow pattern for the order. More information on Motiflow Pattern.

More information on File Uploading.

For testing purposes set the order_type key to value "test". Test orders will be cancelled automatically. Test orders will not be produced, but will remain vissibile as cancelled orders in the orders overview of the reseller's webshop account. The deault value of the order\_type _key is "production".

Flow: Configure and Order a standard Webshop Product

This flow describes how to configure and order a webshop product.

Phase: Select Product

Use the /products resource to receive all available products.

Phase: Configure Product

Use the /products/configure resource to calculate the next available options for the product and present those to your end user as if you were configuring a product using the Probo webshop. Product options are available depending on the selected option(s) for the product in the previous step.

Caution! Do not use this endpoint in the following way:

1) periodically import and store product options using /product/{code}

2) call products/configure with stored product options to calculate a price

Between step 1) and step 2) the products may have changed in the Probo backend. Calling /product/configure in an asynchronous way with unknown options which where stored previously will cause failure and no price will be returned.

The products/configure endpoint is intended to be used to walk through the product options synchrone with the live version of the product.

It is possible to configure multiple products.

The post payload should include the products and (selected) options for the product. It also may include a delivery for the product.

This resource returns (per product):

  • available_options (a list of available options depending on selected options in post payload)
  • code (product code)
  • can_order (null means the product or options cannot be ordered/selected, true or missing means the product/option can be ordered/selected)
  • selected_options (the options as selected in the post payload)
  • prices (when no more options are available)
  • calculation_id (when all available options have been selected)

See the "Configure endpoint example" page for details.

Phase: Calculate Product Prices

Use the /price resource to receive the calculates price of one or more products, each for a specific amount and dimension. The calculation takes into account the provided delivery address, delivery date and desired shipping method.

Phase: Order Product(s)

Use the /order resource to order the configured product(s)

It is possible to save the order as a draft. See the page Drafts for details.

See below for details on fetching the status of an order and canceling an order.