Expected stock in availability

This page is outdated. Please go to our new documentation under https://docs.fulfillmenttools.com/documentation.

Summary

In some cases, stock should be available for sale before it has even arrived at the site or has been produced. This means that expected stock needs to be tracked and communicated to shop systems. It is also necessary that reservations can be made on expected stock.

Use Case Example

A company is selling gift items online and in retail stores. As a special service, the company offers to send the gift directly to the recipient on the day of the birthday. As the delivery date often lies far in the future, it should be possible to take expected stock into account when ordering. Furthermore, some of the gift baskets contain perishable goods. As the company only wants to sell items up to 30 days before their expiration date, this attribute must also be taken into account when customers place orders and reservations are made.

Implementation in fulfillmenttools

1. Create listings

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 product whose expected stocks should be considered. 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.

Create or Update listings of a facility with the given ID

put
Authorizations
Path parameters
facilityIdstringRequired

ID of facility you want to get its listing

Body
Responses
200
Facility listing was found & you were allowed to access it.
put
PUT / HTTP/1.1
Host: %%HOST%%
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 529

{
  "listings": [
    {
      "attributes": [
        {
          "category": "descriptive",
          "key": "%%subtitle%%",
          "priority": 100,
          "value": "585er Gold"
        }
      ],
      "imageUrl": "text",
      "price": 1200,
      "tenantArticleId": "4711",
      "title": "Adidas Superstar",
      "weight": 1,
      "scanningRule": {
        "values": []
      },
      "scannableCodes": [
        "text"
      ],
      "outOfStockBehaviour": "BACKORDER",
      "availabilityTimeframe": {
        "start": "2020-02-03T08:45:50.525Z"
      },
      "tags": [],
      "measurementUnitKey": "liter",
      "stockProperties": {
        "ANY_ADDITIONAL_PROPERTY": {
          "inputType": "DATE",
          "required": true,
          "defaultValue": "text"
        }
      },
      "legal": {
        "hsCode": "text"
      }
    }
  ]
}

No content

2. Create purchase order

Create a purchaseOrder for all items that have already been (re-)ordered. After the purchase order has been created, an expected stock is automatically created for each position in requestedItems. If stock properties such as expiry date or batch number are already known at the time of the order placement they can be defined as well.

Create a new Purchase Order

post
Body
cancelledbooleanOptionalDeprecated

This field is deprecated. Set the status to 'CANCELED' Set the purchaseOrder to 'cancelled'. No further deliveries will be expected. Already received goods are unaffected.

customAttributesobject | nullableOptional

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.

facilityRefstring · min: 1Required
orderDatestring · date-timeRequired

Time and date at which the order was placed. Note: This does not refer to the creation date of this entity in the system.

requestedDateall ofRequired

Time and date at which the order is expected to arrive. Use 'ASAP' for deliveries with unknown date, but be aware that some features will not include these orders.

statusstring · enumOptionalPossible values:
Responses
201
Created Purchase Order entity
application/json
post
POST /api/purchaseorders HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 334

{
  "customAttributes": {},
  "facilityRef": "text",
  "orderDate": "2025-07-05T13:34:57.689Z",
  "requestedDate": {
    "type": "ASAP",
    "value": "2025-07-05T13:34:57.689Z"
  },
  "requestedItems": [
    {
      "customAttributes": {},
      "quantity": {
        "unit": "text",
        "value": 1
      },
      "stockProperties": {
        "expiry": "text"
      },
      "tenantArticleId": "text"
    }
  ],
  "status": "OPEN",
  "supplier": {
    "name": "text"
  }
}
{
  "created": "2025-07-05T13:34:57.689Z",
  "customAttributes": {},
  "facilityRef": "text",
  "id": "text",
  "inboundProcessRef": "text",
  "lastModified": "2025-07-05T13:34:57.689Z",
  "orderDate": "2025-07-05T13:34:57.689Z",
  "requestedDate": {
    "type": "ASAP",
    "value": "2025-07-05T13:34:57.689Z"
  },
  "requestedItems": [
    {
      "customAttributes": {},
      "quantity": {
        "unit": "text",
        "value": 1
      },
      "stockProperties": {
        "expiry": "text"
      },
      "tenantArticleId": "text"
    }
  ],
  "status": "OPEN",
  "supplier": {
    "name": "text"
  },
  "transfer": {
    "id": "text"
  },
  "version": 1
}

3. Query checkout options endpoints for shop availability

Query one of the checkout options endpoints to get the future availability for a specific delivery date or time period. In the future availability, all stock is included that:

Before using the delivery/earliest or the /delivery/timeperiod endpoint, the transit times in the carrier country service mapping for the requested carrier(s) must be configured.

Example:

Request availability for a gift item in the store in Cologne for the delivery date 14/09/2024

  1. Request: POST /api/promises/checkoutoptions/delivery/timepoint​

  • desiredDeliveryDate: "2024-09-14"

  • tenantArticleId: gift-set-01​

  • facilityRef: facility-CGN​

    • latestPickingStart for Cologne: "2024-09-10"

If the latest possible picking start for a certain delivery date in a facility is not known, it can be requested via our /api/promises/checkoutoptions endpoint. Our systems then calculate the latestPickingStartbased on cut-off time of carriers and fulfillment process buffer.​

  1. Availability Check:

After the request has been made, an availability check is performed which validates if the expected stock fulfills all necessary criteria to be considered for the (potential) order. ​

  • Is desiredDeliveryDate < availableUntil date?​ -> Items should not have expired until they have reached the customer

  • Is latestPickingStart > requested date of stock​ -> Items must have arrived in the facility before they can be picked.

  1. Response:

The response returns all stock in the requested facility that is currently available and will not expire until the desiredDeliveryDate plus all expected stock that fulfills the criteria of the availability check.

  • Available: 30

4. Make reservation

If an item should already be reserved but has not been ordered yet (e.g., a customer placed it in the shopping cart), the deliveryPromise endpoint can be used. If an order was placed and the item should be reserved, the order endpoint can be used. Go here for more information on reservations.

5. Manage reservations on expected stocks

Reservations on expected stock can be monitored via the Stock Overview in the Backoffice. Go here for more information on expected stock.

6. Create stock after delivery has arrived

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 respective inboundProcessRef if it is not stored in your systems.

After the stock was created in the facility, reservations are shifted from expected stock to "real" stock. When shifting reservations, an available stock in the facility is chosen, considering the running sequence (if defined). This means the reservation is not necessarily made on the exact item that has arrived in the delivery.

Adds a receipt to an inbound process.

post
Path parameters
inboundProcessIdstringRequired
Body
asnRefstringOptional

enables mapping a receipt to one of the ASNs in this inbound process

customAttributesobject | nullableOptional

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.

receivedDatestring · date-timeRequired

date-time of the arrival of the items in the facility

statusstring · enumOptional

status of this receipt, only receipts with status 'FINISHED' are booked. IN_PROGRESS can be used to save partial receipts.

Possible values:
Responses
201
Receipt was added to the inbound process
application/json
post
POST /api/inboundprocesses/{inboundProcessId}/receipts HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 416

{
  "asnRef": "text",
  "comments": [
    {
      "content": "text",
      "userRef": "text"
    }
  ],
  "customAttributes": {},
  "receivedDate": "2025-07-05T13:34:57.689Z",
  "receivedItems": [
    {
      "acceptedQuantity": {
        "unit": "text",
        "value": 1
      },
      "comments": [
        {
          "content": "text",
          "userRef": "text"
        }
      ],
      "customAttributes": {},
      "rejectedQuantity": {
        "unit": "text",
        "value": 1
      },
      "stockProperties": {
        "expiry": "text"
      },
      "storageLocationRef": "text",
      "tenantArticleId": "text"
    }
  ],
  "status": "OPEN"
}
{
  "asnRef": "text",
  "comments": [
    {
      "content": "text",
      "documentSetRef": "text",
      "id": "text",
      "userRef": "text"
    }
  ],
  "customAttributes": {},
  "id": "text",
  "receivedDate": "2025-07-05T13:34:57.689Z",
  "receivedItems": [
    {
      "acceptedQuantity": {
        "unit": "text",
        "value": 1
      },
      "comments": [
        {
          "content": "text",
          "documentSetRef": "text",
          "id": "text",
          "userRef": "text"
        }
      ],
      "customAttributes": {},
      "id": "text",
      "rejectedQuantity": {
        "unit": "text",
        "value": 1
      },
      "stockProperties": {
        "expiry": "text"
      },
      "storageLocationRef": "text",
      "tenantArticleId": "text"
    }
  ],
  "status": "OPEN"
}

FAQ

What happens if the requested date for a delivery changes?

If it is known that a delivery will arrive later than planned, the requestedDate in the purchaseOrder needs to be patched for the correct date. After the purchase order has been updated, our systems check whether reservations on the respective expected stocks can still be fulfilled. If the delivery arrives too late to be considered for a reservation, the reservation is shifted to an alternative stock. If there is no alternative stock available, the reservation is still tracked and will be shifted to a stock as soon as some stock becomes available.

What happens if the supplier can only deliver less goods than ordered?

If it is know that there will be less items in the delivery than ordered, the requestedItems in the purchaseOrder need to be patched for the correct items and quantities. After the purchase order has been updated, our systems check whether reservations on the respective expected stocks can still be fulfilled. If a reservation on the purchase order cannot be fulfilled anymore, the reservation is shifted to an alternative stock. If there is no alternative stock available, the reservation is still tracked and will be shifted to a stock as soon as some stock becomes available.

What happens if part of the delivery is missing or defective?

After a delivery has arrived and a receipt was added to the inbound process, reservations are shifted from expected to "real" stock. If there is not enough stock available in the facility due to some items in the delivery being missing or defective, the reservations will still be tracked and shifted to a stock as soon as some stock becomes available.

What happens if the delivery is delayed?

If a delivery is delayed, it is no longer considered for new reservations. Existing reservations on the expected stocks are kept until the purchase order has been cancelled. Therefore, we advise users to update the requestedDate or cancel the purchaseOrder as soons as it is known that the delivery will be delayed.

Last updated

Was this helpful?