Demand-Driven Replenishment

Summary

This page describes use cases where replenishments for items are made in specific time intervals based on demand or where products can be produced on demand. In that case, systems should often allow customer orders to be accepted without being limited by current stock levels until the point in time when the purchase order is placed or production schedules are defined.

Use Case Examples

Short replenishment cycles

A company offers lots of seasonal products which, naturally, are subject to high fluctuations in demand. In addition, these products can be replenished in a short time and the user knows already when orders will arrive. Thus, purchasing agents monitor already accepted customer orders and place purchase orders based on demand to avoid over-stock. As a result, there is no stock limit on the number of customer orders that can be accepted until the purchase order is placed.

Internal production facility

A company produces some goods internally. To prevent overproduction, the production schedule is made based on current demand levels. As a result, there is no stock limit on the number of customer orders that can be accepted until the production schedule is defined.

Implementation in fulfillmenttools

The described use case is mapped by creating purchase orders with a very high amount of products and allowing shop systems to access the thereby created expected stock.

1. Create listings for products that should be available in large quantities

In most set-ups, listings should already be created for all products that are managed via fulfillmenttools' systems. Still, make sure that a listing exists for each relevant product. If goods are perishable and/or should only be available for a certain time frame, stockProperties and/or stockAvailableUntil must be configured. See here for more details.

Example call for creating listing
{
  "listings": [
    {
      "tenantArticleId": "4711",
      "title": "Chocolate Santa",
      "titleLocalized": {
        "de_DE": "Schoko Weihnachtsmann",
        "en_US": "Chocolate Santa"
      },
      "stockProperties": {
        "expiry": {
          "inputType": "DATE",
          "required": true
        }
      },
      "stockAvailableUntil": {
        "calculationBase": "EXPIRY",
        "modifier": "-P30D"
      }
      "version": 1
    }
  ]
}

2. Create a purchaseOrder

Create a purchaseOrder including all items that have not been ordered yet but should be already available for sale and not be limited by current stock levels.

  • Choose a high number for the quantity.value of requestedItems

  • Define the date when the delivery is expected to arrive in requestedDate.value and set requestedDate.type to "TIMEPOINT"

  • Include as many items as possible in one purchaseOrder rather than creating one purchaseOrder for each item for that a very high stock should be assumed. However, please consider the limit of 200 tenantArticleIds per purchaseOrder.

Create a new Purchase Order

POST/api/purchaseorders
Body
orderDate*string (date-time)
requestedDate*InputRequestedDate (object)
requestedItems*array of InboundLineItem (object)
statusenum
OPEN
cancelledboolean
supplierInboundProcessPurchaseOrderSupplier (object)
customAttributesnullable object

Attributes that can be added to this entity. These attributes cannot be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.

facilityRef*string
Response

Created Purchase Order entity

Body
id*string
created*string (date-time)
lastModified*string (date-time)
orderDate*string (date-time)
requestedDate*RequestedDate (object)
requestedItems*array of InboundLineItem (object)
status*enum
OPEN
cancelled*boolean
supplierInboundProcessPurchaseOrderSupplier (object)
transferInboundProcessPurchaseOrderTransfer (object)
customAttributesnullable object

Attributes that can be added to this entity. These attributes cannot be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.

version*number
facilityRef*string
inboundProcessRef*string
Request
const response = await fetch('/api/purchaseorders', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "orderDate": "2024-09-17T19:28:13.216Z",
      "requestedDate": {
        "type": "ASAP"
      },
      "requestedItems": [
        {
          "tenantArticleId": "text",
          "quantity": {}
        }
      ],
      "facilityRef": "text"
    }),
});
const data = await response.json();
Response
{
  "id": "text",
  "created": "2024-09-17T19:28:13.216Z",
  "lastModified": "2024-09-17T19:28:13.216Z",
  "orderDate": "2024-09-17T19:28:13.216Z",
  "requestedDate": {
    "type": "ASAP",
    "value": "2024-09-17T19:28:13.216Z"
  },
  "requestedItems": [
    {
      "tenantArticleId": "text",
      "quantity": {
        "unit": "text"
      },
      "stockProperties": {
        "expiry": "text",
        "batch": "text"
      }
    }
  ],
  "status": "OPEN",
  "cancelled": false,
  "supplier": {
    "name": "text"
  },
  "transfer": {
    "id": "text"
  },
  "version": 0,
  "facilityRef": "text",
  "inboundProcessRef": "text"
}
Example query for creating purchaseOrder
{
  "orderDate": "2024-08-12T12:59:37.192Z",
  "requestedDate": {
    "type": "TIME_POINT",
    "value": "2024-08-19T12:59:37.192Z"
  },
  "requestedItems": [
    {
      "tenantArticleId": "4711",
      "quantity": {
        "value": 10000
      },
      "stockProperties": {
        "expiry": "2025-02-19T12:59:37.192Z"
      }
    }
  ],
  "facilityRef": "warehouse-cgn"
}

3. Enable shop systems to communicate expected stock in sales availability

Use one of the below endpoints to query stock availability in your shop's detail pages and in the checkout journey. By that, it is ensured that expected stock is considered in the shop availability. Go here to get more information on the checkout options endpoints.

Before using the delivery/earliest and delivery/timeperiod endpoints, the transit time in the carrier country service mapping for the requested carrier(s) must be configured.

delivery/earliest

POST/api/promises/checkoutoptions/delivery/earliest
Body
earliestDeliveryDatestring (date-time)

The date from which to search for the earliest potential delivery date. Defaults to "now" (timestamp of the request)

Example: "2024-06-01T00:00:00.000Z"
tenantArticleIds*array of string
consumerAddress*CheckoutOptionsConsumerAddress (object)
Response

The request could be evaluated.

Body
checkoutOptions*array of CheckoutOptionsDeliveryEarliestResponseItem (object)

The results of the corresponding request containing information, if present, on when the items can supposingly be delivered earliest. Please note: When it was not possible to calculate the delivery information for a requested tenantArticleId there is no entry here.

Request
const response = await fetch('/api/promises/checkoutoptions/delivery/earliest', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "tenantArticleIds": [
        "DE-ZGT-4711"
      ],
      "consumerAddress": {
        "country": "DE"
      }
    }),
});
const data = await response.json();
Response
{
  "checkoutOptions": [
    {
      "tenantArticleId": "DE-ZGT-4711",
      "earliestPredictedDeliveryDate": "2020-02-03T08:45:50.525Z",
      "availableCarriers": [
        {
          "name": "DHL",
          "carrierRef": "text",
          "nonDeliveryDays": [
            "DE-NW"
          ]
        }
      ]
    }
  ]
}

delivery/timeperiod

POST/api/promises/checkoutoptions/delivery/timeperiod
Body
startDatestring (date-time)

The start of the evaluated time period. Defaults to "now" (timestamp of the request)

Example: "2024-06-03T00:00:00.000Z"
endDatestring (date-time)

The end of the evaluated time period. Default is the start date + 30 days. Please note that the maximum time period can not exceed 45 days.

Example: "2024-07-13T00:00:00.000Z"
basket*array of BasketItem (object)

Items, that are considered to be delivered together.

consumerAddress*CheckoutOptionsConsumerAddress (object)
deliveryPreferencesDeliveryPreferencesShipping (object)
Response

The request could be evaluated.

Body
checkoutOptions*array of CheckoutOptionsDeliveryTimePeriodResponseItem (object)
Request
const response = await fetch('/api/promises/checkoutoptions/delivery/timeperiod', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "basket": [
        {
          "tenantArticleId": "DE-ZGT-4711",
          "quantity": 4
        }
      ],
      "consumerAddress": {
        "country": "DE"
      }
    }),
});
const data = await response.json();
Response
{
  "checkoutOptions": [
    {
      "overallStatus": "ALL",
      "date": "2020-02-03T00:00:00.000Z",
      "availableCarriers": [
        {
          "name": "DHL",
          "carrierRef": "text",
          "nonDeliveryDays": [
            "DE-NW"
          ]
        }
      ]
    }
  ]
}

This endpoint is to be used to get information about the possible delivery of items

POST/api/promises/checkoutoptions/delivery/timepoint
Body
desiredDeliveryDate*string (date-time)

The desired delivery date. (timestamp of the request)

Example: "2024-06-03T00:00:00.000Z"
tenantArticleIds*array of string
facilities*array of FacilityRefLatestPickingStartPair (object)

Pair of facilityRef and latestPickingStart values

Response

The request could be evaluated.

Body
items*array of CheckoutOptionsDeliveryTimePointResponseItem (object)
Request
const response = await fetch('/api/promises/checkoutoptions/delivery/timepoint', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "facilities": [
        {
          "facilityRef": "text",
          "latestPickingStart": "2020-02-03T09:45:51.525Z"
        }
      ],
      "tenantArticleIds": [
        "DE-ZGT-4711"
      ],
      "desiredDeliveryDate": "2024-06-03T00:00:00.000Z"
    }),
});
const data = await response.json();
Response
{
  "items": [
    {
      "tenantArticleId": "DE-ZGT-4711",
      "available": 4,
      "facilityRef": "text"
    }
  ]
}

4. Create a new purchaseOrder

Before patching the existing purchaseOrder (created in step 2) with the actually ordered quantity, a new purchaseOrder with large quantities needs to be created. This ensures that the systems can already accept customer orders that should be fulfilled within next production or replenishment cycle. See step 2 for this.

5. Patch purchaseOrder with actual quantity

Once the purchase order was placed or the production schedule was defined, patch requested items in purchase order with quantities that were actually ordered or planned to be produced. Adjust stock properties such as expiry date if necessary.

If there are more reservations than (expected) stock for reasons such as problems during production or defective items in a delivery, our systems try to distribute these abandoned reservations to other stock. If no alternative stock is available, the reservation is still tracked and will be shifted to a stock as soon as some stock becomes available.

Partially updates a Purchase Order using a selection of fields

PATCH/api/purchaseorders/{purchaseOrderId}
Path parameters
purchaseOrderId*string
Body
version*number
orderDatestring (date-time)
requestedDateInputRequestedDate (object)
requestedItemsarray of InboundLineItem (object)
statusenum
OPEN
cancelledboolean
supplierInboundProcessPurchaseOrderSupplier (object)
Response

Updated Purchase Order entity

Body
id*string
created*string (date-time)
lastModified*string (date-time)
orderDate*string (date-time)
requestedDate*RequestedDate (object)
requestedItems*array of InboundLineItem (object)
status*enum
OPEN
cancelled*boolean
supplierInboundProcessPurchaseOrderSupplier (object)
transferInboundProcessPurchaseOrderTransfer (object)
customAttributesnullable object

Attributes that can be added to this entity. These attributes cannot be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.

version*number
facilityRef*string
inboundProcessRef*string
Request
const response = await fetch('/api/purchaseorders/{purchaseOrderId}', {
    method: 'PATCH',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "version": 0
    }),
});
const data = await response.json();
Response
{
  "id": "text",
  "created": "2024-09-17T19:28:13.216Z",
  "lastModified": "2024-09-17T19:28:13.216Z",
  "orderDate": "2024-09-17T19:28:13.216Z",
  "requestedDate": {
    "type": "ASAP",
    "value": "2024-09-17T19:28:13.216Z"
  },
  "requestedItems": [
    {
      "tenantArticleId": "text",
      "quantity": {
        "unit": "text"
      },
      "stockProperties": {
        "expiry": "text",
        "batch": "text"
      }
    }
  ],
  "status": "OPEN",
  "cancelled": false,
  "supplier": {
    "name": "text"
  },
  "transfer": {
    "id": "text"
  },
  "version": 0,
  "facilityRef": "text",
  "inboundProcessRef": "text"
}
Example query for patching purchaseOrder
{
  "version": 2,
  "requestedItems": [
    {
      "tenantArticleId": "4711",
      "quantity": {
        "value": 150
      },
      "stockProperties": {
        "expiry": "2025-02-19T12:59:37.192Z"
      }
    }
  ],
  "facilityRef": "warehouse-cgn"
}

6. Create stock after delivery has arrived or products are produced

If the delivery of the ordered products has arrived or the production was finished, a receipt needs to be added to the inbound process of the purchase order to create stock. Use the GET /api/purchaseorders/{purchaseOrderId} endpoint to query the inboundProcessRef if not sure about the inboundProcess that the purchase order belongs to.

Adds a receipt to an inbound process.

POST/api/inboundprocesses/{inboundProcessId}/receipts
Path parameters
inboundProcessId*string
Body
asnRefstring
receivedDate*string (date-time)
receivedItems*array of InboundReceiptLineItem (object)
comments*array of InboundReceiptComment (object)
statusenum
IN_PROGRESSFINISHED
customAttributesnullable object

Attributes that can be added to this entity. These attributes cannot be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.

Response

Receipt was added to the inbound process

Body
asnRefstring
receivedDate*string (date-time)
receivedItems*array of InboundReceiptLineItem (object)
comments*array of InboundReceiptComment (object)
statusenum
IN_PROGRESSFINISHED
customAttributesnullable object

Attributes that can be added to this entity. These attributes cannot be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.

id*string
Request
const response = await fetch('/api/inboundprocesses/{inboundProcessId}/receipts', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "receivedDate": "2024-09-17T19:28:13.216Z",
      "receivedItems": [
        {
          "tenantArticleId": "text",
          "acceptedQuantity": {},
          "rejectedQuantity": {},
          "comments": [
            {
              "content": "text"
            }
          ]
        }
      ],
      "comments": [
        {
          "content": "text"
        }
      ]
    }),
});
const data = await response.json();
Response
{
  "asnRef": "text",
  "receivedDate": "2024-09-17T19:28:13.216Z",
  "receivedItems": [
    {
      "tenantArticleId": "text",
      "acceptedQuantity": {
        "unit": "text"
      },
      "rejectedQuantity": {
        "unit": "text"
      },
      "comments": [
        {
          "userRef": "text",
          "content": "text",
          "attachments": [
            {
              "inboundAttachmentRef": "text"
            }
          ]
        }
      ],
      "storageLocationRef": "text",
      "stockProperties": {
        "expiry": "text",
        "batch": "text"
      }
    }
  ],
  "comments": [
    {
      "userRef": "text",
      "content": "text",
      "attachments": [
        {
          "inboundAttachmentRef": "text"
        }
      ]
    }
  ],
  "status": "IN_PROGRESS",
  "id": "text"
}

Example query for adding a receipt to an inboundProcess
{
  "receivedDate": "2024-08-18T13:40:05.864Z",
  "receivedItems": [
    {
      "tenantArticleId": "4711",
      "acceptedQuantity": {
        "value": 149
      },
      "rejectedQuantity": {
        "value": 1
      },
      "stockProperties": {
        "expiry": "2025-02-19T12:59:37.192Z"
      },
      "comments": [
        {
          "content": "One item was broken.",
        }
      ],
    }
  ],
  "status": "FINISHED"
}

Last updated