> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rebuild Replenishment Index

> Durably requests a rebuild of the Warehouse's Replenishment Index. Repeated requests coalesce
into one pending generation, so retrying a request that may not have landed is safe; the
published report keeps serving its current generation until the new one publishes.

A `soft` request lets a build already in progress finish and publish. A `force` request marks
a running build superseded — it stops without publishing and the fresh generation recomputes
everything from scratch, so repeated `force` requests at intervals shorter than a full build
defer publication indefinitely. `force` is for an explicit operator-initiated full
recalculation; automation should default to `soft`.

A successful request returns `202 Accepted` with the `requested_generation` this request
coalesced into. Poll `/v1/inventory/warehouses/{id}/replenishment-index/status` until
`published_generation` is greater than or equal to that number (the report's
`meta.published_generation` carries the same value), then read the report at
`/v1/inventory/warehouses/{id}/replenishment-report`. If `status` reads `failed`, the server
retries automatically and alerts operators on persistent failure — `last_error` carries a
classified failure summary; stop polling after an hour and escalate rather than wait
indefinitely.



## OpenAPI

````yaml POST /v1/inventory/warehouses/{id}/replenishment-index/rebuild
openapi: 3.0.3
info:
  title: ShipStream
  version: '1.0'
  license:
    name: Commercial (Copyright 2025 - All Rights Reserved)
    url: https://shipstream.io
  contact:
    name: ShipStream Support
    email: help@shipstream.io
  termsOfService: https://shipstream.io/legal/api-terms/
servers:
  - url: https://{base_url_domain}/api/global
    description: Direct API Url
    variables:
      base_url_domain:
        default: example.shipstream.app
        description: >-
          The fully qualified domain name for your ShipStream WMS instance. This
          is either a custom domain, or a subdomain of shipstream.app,

          and will be the same as the domain name for the page which you use to
          login to ShipStream WMS.
security:
  - ShipStream_bearerAuth: []
tags:
  - name: Warehouses
    x-displayName: Warehouses
  - name: Products
    x-displayName: Products
  - name: ProductProfiles
    x-displayName: ProductProfiles
  - name: HandlingClasses
    x-displayName: HandlingClasses
  - name: Locations
    x-displayName: Locations
  - name: LocationTags
    x-displayName: LocationTags
  - name: SlotTypes
    x-displayName: SlotTypes
  - name: Levels
    x-displayName: Levels
  - name: HoldReasons
    x-displayName: HoldReasons
  - name: Holds
    x-displayName: Holds
  - name: Replenishment
    x-displayName: Replenishment
  - name: LocationProfiles
    x-displayName: LocationProfiles
  - name: SlottingRules
    x-displayName: SlottingRules
  - name: Deliveries
    description: Every thing about a Delivery Receiving
    x-displayName: Deliveries
  - name: Shipments
    x-displayName: Shipments
  - name: Orders
    x-displayName: Orders
  - name: Retailers
    x-displayName: Retailers
  - name: Users
    x-displayName: Users
  - name: User Roles
    x-displayName: User Roles
  - name: Merchants
    x-displayName: Merchants
  - name: Healthcheck
    x-displayName: Healthcheck
paths:
  /v1/inventory/warehouses/{id}/replenishment-index/rebuild:
    post:
      tags:
        - Replenishment
      summary: Rebuild Replenishment Index
      description: >-
        Durably requests a rebuild of the Warehouse's Replenishment Index.
        Repeated requests coalesce

        into one pending generation, so retrying a request that may not have
        landed is safe; the

        published report keeps serving its current generation until the new one
        publishes.


        A `soft` request lets a build already in progress finish and publish. A
        `force` request marks

        a running build superseded — it stops without publishing and the fresh
        generation recomputes

        everything from scratch, so repeated `force` requests at intervals
        shorter than a full build

        defer publication indefinitely. `force` is for an explicit
        operator-initiated full

        recalculation; automation should default to `soft`.


        A successful request returns `202 Accepted` with the
        `requested_generation` this request

        coalesced into. Poll
        `/v1/inventory/warehouses/{id}/replenishment-index/status` until

        `published_generation` is greater than or equal to that number (the
        report's

        `meta.published_generation` carries the same value), then read the
        report at

        `/v1/inventory/warehouses/{id}/replenishment-report`. If `status` reads
        `failed`, the server

        retries automatically and alerts operators on persistent failure —
        `last_error` carries a

        classified failure summary; stop polling after an hour and escalate
        rather than wait

        indefinitely.
      operationId: rebuildReplenishmentIndex
      parameters:
        - name: id
          in: path
          schema:
            type: integer
            format: int32
          required: true
          description: The `id` of the referenced `Warehouse`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Inventory_API_v1_ReplenishmentIndexRebuild'
      responses:
        '202':
          description: >-
            Accepted - The rebuild request was durably recorded.
            `requested_generation` is this

            caller's completion predicate: the rebuild is complete once the
            status endpoint's

            `published_generation` (also the report's
            `meta.published_generation`) is greater than

            or equal to it. The comparison is exact — a superseded generation
            never publishes, and

            any successor publishes with a higher number computed from data read
            after this request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  requested_generation:
                    type: integer
                    format: int64
                    minimum: 1
                    description: >-
                      The pending generation this request coalesced into.
                      Repeated requests made

                      before the build completes return the same number.
                  meta:
                    type: object
                    properties:
                      processing_time:
                        type: number
                        description: >-
                          Total time in which request is processed and response
                          is sent back.
                additionalProperties: false
                required:
                  - requested_generation
                  - meta
              example:
                requested_generation: 6
                meta:
                  processing_time: 0.0042
        '400':
          $ref: '#/components/responses/Inventory_API_v1_400-bad-request'
        '404':
          $ref: '#/components/responses/Inventory_API_v1_404-not-found'
        '500':
          $ref: '#/components/responses/Inventory_API_v1_500-internal-server-error'
components:
  schemas:
    Inventory_API_v1_ReplenishmentIndexRebuild:
      title: ReplenishmentIndexRebuild
      type: object
      description: Rebuild request for one Warehouse's Replenishment Index.
      properties:
        mode:
          type: string
          enum:
            - soft
            - force
          description: >-
            `soft` coalesces into the pending generation and lets a build
            already in progress finish and publish. `force` additionally marks a
            running build superseded, so its result is never published and the
            fresh generation recomputes everything from scratch — repeated
            `force` requests at intervals shorter than a full build defer
            publication indefinitely. Both request a new generation when none is
            pending. `force` is for an explicit operator-initiated full
            recalculation; automation should default to `soft`.
      required:
        - mode
      additionalProperties: false
      example:
        mode: soft
  responses:
    Inventory_API_v1_400-bad-request:
      description: >-
        The request was invalid. The client must change the request. See the
        response body for more details.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: The error type code.
                      enum:
                        - parser
                        - parameters
                        - openapi
                    message:
                      type: string
                      description: An English sentence describing the error type.
                    details:
                      type: array
                      description: >-
                        An array of objects describing which keys are
                        responsible for the error and detailed messages
                        describing why they are not valid.
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            description: The path to the key which relates to the error.
                          message:
                            type: string
                            description: >-
                              An English sentence describing the details of the
                              error.
                        additionalProperties: false
                  additionalProperties: false
                minItems: 1
            additionalProperties: false
          example:
            errors:
              - type: parameters
                message: The supplied parameters are invalid.
    Inventory_API_v1_404-not-found:
      description: >-
        The requested resource was not found. It may have been deleted, it may
        have never existed, or you may not have permission to view it.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: The error type code.
                      enum:
                        - not_found
                    message:
                      type: string
                      description: An English sentence describing the error type.
                    details:
                      type: array
                      description: >-
                        An array of objects describing which keys are
                        responsible for the error and detailed messages
                        describing why they are not valid.
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            description: The path to the key which relates to the error.
                          message:
                            type: string
                            description: >-
                              An English sentence describing the details of the
                              error.
                        additionalProperties: false
                  additionalProperties: false
                minItems: 1
            additionalProperties: false
          example:
            errors:
              - type: not_found
                message: The server could not find the requested resource.
    Inventory_API_v1_500-internal-server-error:
      description: >-
        Internal Server Error - Something wrong happened at server side. Contact
        server administrator for more details.
  securitySchemes:
    ShipStream_bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Generate a JWT access token through a Custom Global Integration and
        provide it with each request in the `Authorization` header prefixed with
        "Bearer" and then a single space.

````