Commerce Layer inventory_models API

resource type

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

commerce-layer-inventory-models-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Commerce Layer addresses inventory_models API
  version: 7.10.1
  contact:
    name: API Support
    url: https://commercelayer.io
    email: support@commercelayer.io
  description: Headless Commerce for Global Brands.
servers:
- url: https://{your_organization_slug}.commercelayer.io/api
  description: API
- url: https://core.commercelayer.io/users/sign_in
  description: Sign in
- url: https://docs.commercelayer.io/api
  description: API reference
security:
- bearerAuth: []
tags:
- name: inventory_models
  description: resource type
paths:
  /inventory_models:
    get:
      operationId: GET/inventory_models
      summary: List all inventory models
      description: List all inventory models
      tags:
      - inventory_models
      responses:
        '200':
          description: A list of inventory model objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/inventoryModelResponseList'
    post:
      operationId: POST/inventory_models
      summary: Create an inventory model
      description: Create an inventory model
      tags:
      - inventory_models
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/inventoryModelCreate'
      responses:
        '201':
          description: The created inventory model object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/inventoryModelResponse'
  /inventory_models/{inventoryModelId}:
    get:
      operationId: GET/inventory_models/inventoryModelId
      summary: Retrieve an inventory model
      description: Retrieve an inventory model
      tags:
      - inventory_models
      parameters:
      - name: inventoryModelId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The inventory model object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/inventoryModelResponse'
    patch:
      operationId: PATCH/inventory_models/inventoryModelId
      summary: Update an inventory model
      description: Update an inventory model
      tags:
      - inventory_models
      parameters:
      - name: inventoryModelId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/inventoryModelUpdate'
      responses:
        '200':
          description: The updated inventory model object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/inventoryModelResponse'
    delete:
      operationId: DELETE/inventory_models/inventoryModelId
      summary: Delete an inventory model
      description: Delete an inventory model
      tags:
      - inventory_models
      parameters:
      - name: inventoryModelId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '204':
          description: No content
  /inventory_return_locations/{inventoryReturnLocationId}/inventory_model:
    get:
      operationId: GET/inventoryReturnLocationId/inventory_model
      summary: Retrieve the inventory model associated to the inventory return location
      description: Retrieve the inventory model associated to the inventory return location
      tags:
      - inventory_models
      parameters:
      - name: inventoryReturnLocationId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The inventory_model associated to the inventory return location
  /inventory_stock_locations/{inventoryStockLocationId}/inventory_model:
    get:
      operationId: GET/inventoryStockLocationId/inventory_model
      summary: Retrieve the inventory model associated to the inventory stock location
      description: Retrieve the inventory model associated to the inventory stock location
      tags:
      - inventory_models
      parameters:
      - name: inventoryStockLocationId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The inventory_model associated to the inventory stock location
  /markets/{marketId}/inventory_model:
    get:
      operationId: GET/marketId/inventory_model
      summary: Retrieve the inventory model associated to the market
      description: Retrieve the inventory model associated to the market
      tags:
      - inventory_models
      parameters:
      - name: marketId
        in: path
        schema:
          type: string
        required: true
        description: The resource's id
      responses:
        '200':
          description: The inventory_model associated to the market
components:
  schemas:
    inventoryModelUpdate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - id
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - inventory_models
            id:
              type: string
              description: Unique identifier for the resource (hash).
              example: XAyRWNUzyN
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The inventory model's internal name.
                  example: EU Inventory Model
                  nullable: false
                strategy:
                  type: string
                  description: 'The inventory model''s shipping strategy: one between ''no_split'' (default), ''split_shipments'', ''ship_from_primary'' and ''ship_from_first_available_or_primary''.'
                  example: no_split
                  nullable: true
                stock_locations_cutoff:
                  type: integer
                  description: The maximum number of stock locations used for inventory computation.
                  example: 3
                  nullable: true
                stock_reservation_cutoff:
                  type: integer
                  description: The duration in seconds of the generated stock reservations.
                  example: 3600
                  nullable: true
                put_stock_transfers_on_hold:
                  type: boolean
                  description: Indicates if the the stock transfers must be put on hold automatically with the associated shipment.
                  example: true
                  nullable: false
                manual_stock_decrement:
                  type: boolean
                  description: Indicates if the the stock will be decremented manually after the order approval.
                  example: true
                  nullable: false
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                  nullable: true
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                  nullable: true
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
                  nullable: true
            relationships:
              type: object
              properties: {}
    inventoryModelCreate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type
              enum:
              - inventory_models
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The inventory model's internal name.
                  example: EU Inventory Model
                strategy:
                  type: string
                  description: 'The inventory model''s shipping strategy: one between ''no_split'' (default), ''split_shipments'', ''ship_from_primary'' and ''ship_from_first_available_or_primary''.'
                  example: no_split
                stock_locations_cutoff:
                  type: integer
                  description: The maximum number of stock locations used for inventory computation.
                  example: 3
                stock_reservation_cutoff:
                  type: integer
                  description: The duration in seconds of the generated stock reservations.
                  example: 3600
                put_stock_transfers_on_hold:
                  type: boolean
                  description: Indicates if the the stock transfers must be put on hold automatically with the associated shipment.
                  example: true
                manual_stock_decrement:
                  type: boolean
                  description: Indicates if the the stock will be decremented manually after the order approval.
                  example: true
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
              required:
              - name
            relationships:
              type: object
              properties: {}
    inventoryModelResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: Unique identifier for the resource (hash).
              example: XAyRWNUzyN
            type:
              type: string
              description: The resource's type
              enum:
              - inventory_models
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/inventoryModel/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                inventory_stock_locations:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - inventory_stock_locations
                        id:
                          type: string
                          description: The resource ID
                inventory_return_locations:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - inventory_return_locations
                        id:
                          type: string
                          description: The resource ID
                attachments:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - attachments
                        id:
                          type: string
                          description: The resource ID
                event_stores:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type
                          enum:
                          - event_stores
                        id:
                          type: string
                          description: The resource ID
    inventoryModelResponseList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/inventoryModelResponse/properties/data'
    inventoryModel:
      properties:
        data:
          properties:
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The inventory model's internal name.
                  example: EU Inventory Model
                  nullable: false
                strategy:
                  type: string
                  description: 'The inventory model''s shipping strategy: one between ''no_split'' (default), ''split_shipments'', ''ship_from_primary'' and ''ship_from_first_available_or_primary''.'
                  example: no_split
                  nullable: true
                stock_locations_cutoff:
                  type: integer
                  description: The maximum number of stock locations used for inventory computation.
                  example: 3
                  nullable: true
                stock_reservation_cutoff:
                  type: integer
                  description: The duration in seconds of the generated stock reservations.
                  example: 3600
                  nullable: true
                put_stock_transfers_on_hold:
                  type: boolean
                  description: Indicates if the the stock transfers must be put on hold automatically with the associated shipment.
                  example: true
                  nullable: true
                manual_stock_decrement:
                  type: boolean
                  description: Indicates if the the stock will be decremented manually after the order approval.
                  example: true
                  nullable: true
                created_at:
                  type: string
                  description: Time at which the resource was created.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: false
                updated_at:
                  type: string
                  description: Time at which the resource was last updated.
                  example: '2018-01-01T12:00:00.000Z'
                  nullable: false
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                  nullable: true
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                  nullable: true
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
                  nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT