Click-and-Collect Orders

Orders are one of the most commonly used entities in the fulfillmenttools platform. Orders are typically used to trigger the DOMS and furthermore to start the overall fulfillment process.

Click-and-Collect (C&C) orders are picked up by the customer in the store. They are not delivered/shipped by a carrier. When placing an order with the fulfillmenttools platform, the deliveryPreferences are used to mark the order for collection.

The other type of orders are Ship-from-Store (SfS) orders which are handled by a (logistics) carrier and delivered to the customer's address. When utilizing a carrier like DHL, FedEx, etc. a shipping label is needed for the parcels to be sent. These orders are described in another use case document.

Click-and-Collect Orders

Here's an example on how to create a Click-and-Collect order:

curl -sSL -X POST 'https://your.api.fulfillmenttools.com/api/orders' \
  --header 'Authorization: Bearer <TOKEN>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "consumer": {
    "addresses": [
      {
        "salutation": "Mr.",
        "firstName": "Test",
        "lastName": "Customer",
        "street": "Domstr.",
        "houseNumber": "20",
        "postalCode": "50668",
        "city": "Köln",
        "country": "DE"
      }
    ],
    "email": "customer@mail.com"
  },
  "orderDate": "2023-03-06T17:30:00Z",
  "status": "OPEN",
  "tenantOrderId": "order-111",
  "customAttributes": {
    "someInternalId": "xyz-123"
  },
  "deliveryPreferences": {
    "targetTime": "2023-03-08T14:00:00Z",
    "collect": [
      {
        "paid": true,
        "provisioningTime": "2024-05-05T15:00:00.000Z"
        "facilityRef": "<facility-id>"
      }
    ],
    "reservationPreferences": {
      "mode": ASAP (default),"CUSTOM", 
      "reservationTime": "2024-05-04T13:00:00.000Z" // only for CUSTOM
    }
  },
  "orderLineItems": [
    {
      "quantity": 2,
      "article": {
        "tenantArticleId": "111222333",
        "title": "T-Shirt",
        "imageUrl": "https://loremflickr.com/320/240/shirt",
        "attributes": [
          {
            "key": "%%subtitle%%",
            "value": "Super Brand",
            "category": "descriptive",
            "priority": 100
          },
          {
            "key": "Color",
            "value": "white",
            "category": "descriptive",
            "priority": 101
          },
          {
            "key": "Size",
            "value": "M",
            "category": "descriptive",
            "priority": 102
          }
        ]
      },
      "scannableCodes": [
        "5714500878421"
      ],
      "customAttributes": {
        "someInternalId": "0815"
      }
    }
  ]
}'

Some details on the example:

  • The tenantOrderId is used to identify the order within the eCommerce system (e.g. online shop).

  • The deliveryPreferences mark this order as a collect order:

    • The paid flag is used as a signal that the order has already been paid by the customer.

    • The provisioningTime is the appointment time when the customer wants to pick up the order at the location (for example when a pickup time slot is presented in the eCommerce shop during checkout). It is also to change this appointment time during the fulfillment process (i.e. when the customer changed plans). Based on the provisioningTime it is possible to configure a timeframe after which the order gets canceled automatically in case the customer does not show up (See expiry).

    • The facilityRef is used to select the facility where the order will be picked up by the customer. This must be a valid facility id. See the Add and Manage Facilities example for details on facilities.

  • The "reservationPreferences" are used in case the order should not be fulfilled and the respective stock should not be reserved directly after the routing was performed. This is the case if the consumer places an order where the delivery date is further in the future and the stock should not be reserved instantly (e.g. if the items do have a best before date).

  • The orderLineItems section contains the ordered goods, each product has to be identified with a tenantArticleId.

  • The scannableCodes contain the values of the product's barcode. This information is used by the picking app to verify that the correct product has been scanned and picked.

  • In addition, the order line items can have more attributes that are displayed in the fulfillmenttools picking app to help the staff find the right product.

  • Both the order and the order line items can have optional customAttributes. These could be used to carry information that are useful to any services on client side to aid with their task.

Click-and-Reserve Orders

A Click-and-Reserve order has the same structure, the only difference is the paid flag being false. This information is displayed in the picking app so that store personnel is made aware the customer still needs to pay for the order when picking it up.

Order Events

If you have subscribed to ORDER_CREATED webhook events as described in the Eventing tutorial, your service will be notified when a new order has been created. You can evaluate the information from this event, e.g. to start other business processes.

The OrderCreatedWebHookEvent has all the details about the order:

{
  "event": "ORDER_CREATED",
  "eventId": "4395488122884786"
  "payload": {
    "id": "287ce844-fb3d-43f1-bc52-d667db8cbbb5",
    "status": "OPEN",
    "tenantOrderId": "abc-111",
    "processId": "2c4a43f2-7f69-40df-9cef-e8665012ec73",

  }
}

Here, esp. the order id and the processId are of interest because they can be used for subsequent API calls.

Reference

Last updated