> ## 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.

# Update Policy

> Updates the Replenishment Policy identified by the `id` and `policy_id` path
parameters. Only the properties present in the body are applied; an absent one
keeps its stored value.

Changing a property that affects evaluation — the subject, Location Profile,
DOI band, demand period, activity, or precedence — invalidates the warehouse's
published Replenishment results and requests a rebuild. Renaming a Policy does
not. There is no response body.



## OpenAPI

````yaml PUT /v1/inventory/warehouses/{id}/replenishment-policies/{policy_id}
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-policies/{policy_id}:
    put:
      tags:
        - Replenishment
      summary: Update Policy
      description: >-
        Updates the Replenishment Policy identified by the `id` and `policy_id`
        path

        parameters. Only the properties present in the body are applied; an
        absent one

        keeps its stored value.


        Changing a property that affects evaluation — the subject, Location
        Profile,

        DOI band, demand period, activity, or precedence — invalidates the
        warehouse's

        published Replenishment results and requests a rebuild. Renaming a
        Policy does

        not. There is no response body.
      operationId: updateReplenishmentPolicy
      parameters:
        - name: id
          in: path
          schema:
            type: integer
            format: int32
          required: true
          description: The `id` of the referenced `Warehouse`.
        - name: policy_id
          in: path
          schema:
            type: integer
            format: int32
          required: true
          description: The `id` of the referenced `ReplenishmentPolicy`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Inventory_API_v1_ReplenishmentPolicyUpdate'
      responses:
        '200':
          $ref: '#/components/responses/Inventory_API_v1_200-ok-no-body'
        '400':
          $ref: '#/components/responses/Inventory_API_v1_400-bad-request'
        '404':
          $ref: '#/components/responses/Inventory_API_v1_404-not-found'
        '422':
          $ref: '#/components/responses/Inventory_API_v1_422-unprocessable'
        '500':
          $ref: '#/components/responses/Inventory_API_v1_500-internal-server-error'
components:
  schemas:
    Inventory_API_v1_ReplenishmentPolicyUpdate:
      title: ReplenishmentPolicyUpdate
      type: object
      description: >-
        Properties of a Replenishment Policy to change. Only the properties
        present in

        the body are applied; an absent one keeps its stored value rather than
        being

        cleared. The warehouse cannot be changed, and every derived or
        index-owned

        property of `ReplenishmentPolicy` is rejected if present.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          example: Fast Movers - Forward Pick
          description: The user-visible Policy name; must be unique within the warehouse.
        is_active:
          type: boolean
          description: |-
            Whether the Policy participates in Product evaluation. Changing this
            invalidates the warehouse's published Replenishment results.
        sort_order:
          type: integer
          minimum: 0
          maximum: 65535
          example: 10
          description: >-
            Policy precedence; lower values are evaluated first, with `id` as
            the tie-break.
        merchant_ids:
          type: array
          nullable: true
          maxItems: 100
          items:
            type: integer
            minimum: 1
          example:
            - 2
            - 7
          description: >-
            Merchant IDs the Policy selects. `null` or an empty list means every
            Merchant.
        product_profile_ids:
          type: array
          maxItems: 100
          items:
            type: integer
            minimum: 1
          example:
            - 12
            - 15
          description: >-
            Product Profile IDs the Policy selects. An empty list means Product
            Profiles do not restrict the subject.
        product_profile_match_mode:
          type: string
          enum:
            - any
            - all
            - none
          description: >-
            How the selected Product Profiles are matched against a Product. The
            `none`

            mode requires at least one Product Profile.
        handling_class_ids:
          type: array
          maxItems: 100
          items:
            type: integer
            minimum: 1
          example:
            - 4
          description: >-
            Handling Class IDs the Policy selects. Each must be assigned to this

            warehouse. An empty list means Handling Classes do not restrict the
            subject.
        location_profile_id:
          type: integer
          format: int32
          minimum: 1
          example: 3
          description: >-
            The `id` of the Location Profile supplying the target group. It must
            belong

            to this warehouse and already have a published revision.
        demand_period_days:
          type: integer
          minimum: 1
          maximum: 65535
          example: 30
          description: >-
            The Product Velocity window used to derive daily demand. Must equal
            one of

            the configured Product Velocity periods.
        trigger_doi_days:
          type: number
          minimum: 0
          maximum: 999999.9999
          example: 7
          description: >-
            The coverage threshold below which an assigned Product is flagged
            for Replenishment.
        target_doi_days:
          type: number
          minimum: 0
          maximum: 999999.9999
          example: 21
          description: >-
            The target coverage used to calculate the required replenishment
            quantity.

            Must not be lower than `trigger_doi_days`; equal values are
            accepted.
      additionalProperties: false
  responses:
    Inventory_API_v1_200-ok-no-body:
      description: OK - The operation completed successfully and there is no response body.
    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_422-unprocessable:
      description: >-
        There was an error processing 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:
                        - application
                        - unable_to_process
                    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: unable_to_process
                message: There was an error processing the request.
    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.

````