{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bol-com/json-schema/bol-com-replenishment-response-schema.json",
  "title": "ReplenishmentResponse",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bol-com-openapi.json#/components/schemas/ReplenishmentResponse",
  "required": [
    "creationDateTime",
    "deliveryInformation",
    "invalidLines",
    "labelingByBol",
    "lines",
    "loadCarriers",
    "reference",
    "replenishmentId",
    "state",
    "stateTransitions"
  ],
  "type": "object",
  "properties": {
    "replenishmentId": {
      "type": "string",
      "description": "The unique identifier of the replenishment."
    },
    "creationDateTime": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time when this replenishment was created. In ISO 8601 format.",
      "format": "date-time"
    },
    "reference": {
      "type": [
        "string",
        "null"
      ],
      "description": "Custom user defined reference to identify the replenishment."
    },
    "labelingByBol": {
      "type": "boolean",
      "description": "Indicates whether the replenishment will be labeled by bol.com or not."
    },
    "state": {
      "type": "string",
      "description": "Indicates the state of this replenishment order.",
      "enum": [
        "ANNOUNCED, IN_TRANSIT, ARRIVED_AT_WH, IN_PROGRESS_AT_WH, CANCELLED, DONE"
      ]
    },
    "deliveryInformation": {
      "$ref": "#/$defs/DeliveryInformation"
    },
    "pickupAppointment": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/PickupAppointment"
        }
      ]
    },
    "numberOfLoadCarriers": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The number of load carriers in this shipment.",
      "format": "int32"
    },
    "loadCarriers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LoadCarrier"
      }
    },
    "lines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReplenishmentLine"
      }
    },
    "invalidLines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InvalidReplenishmentLine"
      }
    },
    "stateTransitions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StateTransition"
      }
    }
  },
  "$defs": {
    "Address": {
      "required": [
        "attentionOf",
        "city",
        "countryCode",
        "houseNumber",
        "houseNumberExtension",
        "streetName",
        "zipCode"
      ],
      "type": "object",
      "properties": {
        "streetName": {
          "type": "string",
          "description": "The street name of the pickup location."
        },
        "houseNumber": {
          "type": "string",
          "description": "The house number of the pickup location."
        },
        "houseNumberExtension": {
          "type": [
            "string",
            "null"
          ],
          "description": "The extension of the house number of the pickup location."
        },
        "zipCode": {
          "type": "string",
          "description": "The zip code in '1234AB' format for NL and '0000' for BE addresses."
        },
        "city": {
          "type": "string",
          "description": "The city of the pickup address."
        },
        "countryCode": {
          "type": "string",
          "description": "The ISO 3166-2 country code."
        },
        "attentionOf": {
          "type": "string",
          "description": "Name of the person responsible for this replenishment."
        }
      }
    },
    "DeliveryInformation": {
      "required": [
        "destinationWarehouse",
        "expectedDeliveryDate",
        "transporterCode"
      ],
      "type": "object",
      "properties": {
        "expectedDeliveryDate": {
          "type": "string",
          "description": "The expected delivery date of the shipment at the bol.com warehouse in ISO 8601 format.",
          "format": "date"
        },
        "transporterCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "The transporter that will pickup this replenishment.",
          "enum": [
            "POSTNL, DHL, DPD, GLS, UPS, OTHER"
          ]
        },
        "destinationWarehouse": {
          "$ref": "#/$defs/DestinationWarehouse"
        }
      }
    },
    "DestinationWarehouse": {
      "required": [
        "attentionOf",
        "city",
        "countryCode",
        "houseNumber",
        "houseNumberExtension",
        "streetName",
        "zipCode"
      ],
      "type": "object",
      "properties": {
        "streetName": {
          "type": "string",
          "description": "The street name of the pickup address."
        },
        "houseNumber": {
          "type": "string",
          "description": "The house number of the pickup address."
        },
        "houseNumberExtension": {
          "type": [
            "string",
            "null"
          ],
          "description": "The extension of the house number."
        },
        "zipCode": {
          "type": "string",
          "description": "The zip code in '1234AB' format for NL and '0000' for BE addresses."
        },
        "city": {
          "type": "string",
          "description": "The city of the pickup address."
        },
        "countryCode": {
          "type": "string",
          "description": "The ISO 3166-2 country code."
        },
        "attentionOf": {
          "type": "string",
          "description": "Name of the person responsible for this replenishment."
        }
      }
    },
    "InvalidReplenishmentLine": {
      "required": [
        "quantityAnnounced",
        "quantityInProgress",
        "quantityReceived",
        "quantityWithGradedState",
        "quantityWithRegularState",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of invalid replenishment line, in case the BSKU and/or EAN cannot be determined for this replenishment line.",
          "enum": [
            "UNKNOWN_FBB_PRODUCT",
            "UNKNOWN_EAN_INVENTORY_RELATION"
          ]
        },
        "quantityAnnounced": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The amount of announced quantity for this replenishment line.",
          "format": "int32"
        },
        "quantityReceived": {
          "type": "integer",
          "description": "The amount of received quantity for this replenishment line.",
          "format": "int32"
        },
        "quantityInProgress": {
          "type": "integer",
          "description": "The amount of quantity that is still in progress at the warehouse for this replenishment line.",
          "format": "int32"
        },
        "quantityWithGradedState": {
          "type": "integer",
          "description": "The quantity within this shipment line that has a graded (unsalable) state.",
          "format": "int32"
        },
        "quantityWithRegularState": {
          "type": "integer",
          "description": "The quantity within this shipment line that has a regular (salable) state.",
          "format": "int32"
        }
      }
    },
    "LoadCarrier": {
      "required": [
        "transportState",
        "transportStateUpdateDateTime"
      ],
      "type": "object",
      "properties": {
        "sscc": {
          "type": [
            "string",
            "null"
          ],
          "description": "The Serial Shipping Container Code (SSCC) for this load carrier."
        },
        "transportLabelTrackAndTrace": {
          "type": [
            "string",
            "null"
          ],
          "description": "The track and trace code for this load carrier."
        },
        "transportState": {
          "type": [
            "string",
            "null"
          ],
          "description": "The current state of the transport for this load carrier.",
          "enum": [
            "ANNOUNCED, PICKED_UP, UNDERWAY, DELAYED, ARRIVED, ERROR"
          ]
        },
        "transportStateUpdateDateTime": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date and time in ISO 8601 format when the latest update for this transport was received.",
          "format": "date-time"
        }
      }
    },
    "PickupAppointment": {
      "required": [
        "address",
        "pickupTimeSlot"
      ],
      "type": "object",
      "properties": {
        "commentToTransporter": {
          "type": [
            "string",
            "null"
          ],
          "description": "A comment to the transporter regarding the pickup appointment."
        },
        "address": {
          "$ref": "#/$defs/Address"
        },
        "pickupTimeSlot": {
          "$ref": "#/$defs/ReplenishmentPickupTimeSlot"
        },
        "pickupDateTime": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date and time in ISO 8601 format when this replenishment was picked up by the transporter.",
          "format": "date-time"
        },
        "cancellationReason": {
          "type": [
            "string",
            "null"
          ],
          "description": "In case of a pickup cancellation this field indicates the reason for cancelling this pickup.",
          "enum": [
            "UNKNOWN_ADDRESS, NOT_READY, NO_LABEL, WRONG_PACKAGE, NOT_AT_HOME, OTHER_REASON, REQUEST_FROM_RETAILER"
          ]
        }
      }
    },
    "ReplenishmentLine": {
      "required": [
        "ean",
        "lineState",
        "quantityAnnounced",
        "quantityInProgress",
        "quantityReceived",
        "quantityWithGradedState",
        "quantityWithRegularState"
      ],
      "type": "object",
      "properties": {
        "ean": {
          "type": [
            "string",
            "null"
          ],
          "description": "The EAN number associated with this product."
        },
        "lineState": {
          "type": "string",
          "description": "The state of the line indicating whether this line was announced within this replenishment.",
          "enum": [
            "ANNOUNCED, UNANNOUNCED, UNKNOWN"
          ]
        },
        "quantityAnnounced": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The amount of announced quantity for this replenishment line.",
          "format": "int32"
        },
        "quantityReceived": {
          "type": "integer",
          "description": "The amount of received quantity for this replenishment line.",
          "format": "int32"
        },
        "quantityInProgress": {
          "type": "integer",
          "description": "The amount of quantity that is still in progress at the warehouse for this replenishment line.",
          "format": "int32"
        },
        "quantityWithGradedState": {
          "type": "integer",
          "description": "The quantity within this shipment line that has a graded (unsalable) state.",
          "format": "int32"
        },
        "quantityWithRegularState": {
          "type": "integer",
          "description": "The quantity within this shipment line that has a regular (salable) state.",
          "format": "int32"
        }
      }
    },
    "ReplenishmentPickupTimeSlot": {
      "required": [
        "fromDateTime",
        "untilDateTime"
      ],
      "type": "object",
      "properties": {
        "fromDateTime": {
          "type": "string",
          "description": "The selected start date and time for the replenishment pickup appointment. In ISO 8601 format.",
          "format": "date-time"
        },
        "untilDateTime": {
          "type": "string",
          "description": "The selected end date and time for the replenishment pickup appointment. In ISO 8601 format.",
          "format": "date-time"
        }
      }
    },
    "StateTransition": {
      "required": [
        "state",
        "stateDateTime"
      ],
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "description": "Indicates the state of this replenishment order.",
          "enum": [
            "DRAFT, ANNOUNCED, IN_TRANSIT, ARRIVED_AT_WH, IN_PROGRESS_AT_WH, CANCELLED, DONE"
          ]
        },
        "stateDateTime": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date and time in ISO 8601 format that indicates when this states was updated for this replenishment.",
          "format": "date-time"
        }
      }
    }
  }
}