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

# Set product out of stock



## OpenAPI

````yaml post /ecommerce/stores/{storeId}/products/{productId}/out-of-stock
openapi: 3.1.0
info:
  title: Justo API
  version: 3.0.0
servers:
  - url: https://api.service.getjusto.com/v3
    description: Production server
security: []
paths:
  /ecommerce/stores/{storeId}/products/{productId}/out-of-stock:
    post:
      summary: Set product out of stock
      parameters:
        - in: path
          name: storeId
          required: true
          schema:
            type: string
          description: ID Justo o ID externo del local.
        - in: path
          name: productId
          required: true
          schema:
            type: string
          description: ID Justo o ID externo del producto.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - outOfStock
              properties:
                outOfStock:
                  type: boolean
                  description: >-
                    Si es verdadero, marca el producto como agotado. Si es
                    falso, lo vuelve a dejar disponible.
                until:
                  type: string
                  enum:
                    - none
                    - tomorrow
                  description: >-
                    Duración predefinida del bloqueo. Usa tomorrow para agotarlo
                    hasta el cierre del día siguiente.
                untilDate:
                  type: string
                  format: date-time
                  description: Fecha hasta la que el producto permanecerá agotado.
                stock:
                  type: number
                  description: >-
                    Stock disponible. Cuando se consume en pedidos, el producto
                    queda agotado al llegar a 0.
      responses:
        '200':
          description: The OpenAPI spec
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/apiProductOutOfStock'
        '400':
          description: Errors
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: 'false'
                  error:
                    type: object
                    properties:
                      error:
                        type: string
                        example: error
                      message:
                        type: string
                        example: The request has an error
components:
  schemas:
    apiProductOutOfStock:
      type: object
      description: Estado de disponibilidad de un producto en un local.
      properties:
        storeId:
          type: string
          description: ID Justo del local.
        productId:
          type: string
          description: ID Justo del producto.
        productExternalId:
          type: string
          description: ID externo del producto configurado por la marca.
        outOfStock:
          type: boolean
          description: Indica si el producto quedó marcado como agotado en el local.
        outOfStockItemId:
          type: string
          description: ID del registro de producto agotado creado por Justo.
        until:
          type: string
          enum:
            - none
            - tomorrow
          description: Duración predefinida del bloqueo de stock.
        untilDate:
          type: string
          format: date-time
          description: Fecha hasta la que el producto permanecerá agotado.
        stock:
          type: number
          description: Stock disponible configurado para el producto.

````