Post v1 inventory sourceselectionalgorithmresult

POST /V1/inventory/source-selection-algorithm-result

Body

  • inventoryRequest object Required

    Request products in a given Qty and StockId

    Hide inventoryRequest attributes Show inventoryRequest attributes object
    • stock_id integer Required

      Stock Id

    • items array[object] Required

      Represents requested quantity for particular product

      Hide items attributes Show items attributes object

      Represents requested quantity for particular product

      • sku string Required

        SKU

      • qty number Required

        Product Quantity

      • ExtensionInterface class for @see \Magento\InventorySourceSelectionApi\Api\Data\ItemRequestInterface

    • ExtensionInterface class for @see \Magento\InventorySourceSelectionApi\Api\Data\InventoryRequestInterface

      Hide extension_attributes attribute Show extension_attributes attribute object
      • Data interface for shipping source or shipping destination

        Hide destination_address attributes Show destination_address attributes object
        • country string Required

          Shipping country

        • postcode string Required

          Shipping postcode

        • street string Required

          Shipping street address

        • region string Required

          Shipping region

        • city string Required

          Shipping city

  • algorithmCode string Required

Responses

  • 200 Success.

    Hide response attributes Show response attributes object

    Result of how we will deduct product qty from different Sources

    • source_selection_items array[object] Required

      Represents source selection result for the specific source and SKU

      Hide source_selection_items attributes Show source_selection_items attributes object

      Represents source selection result for the specific source and SKU

      • source_code string Required

        Source code

      • sku string Required

        Item SKU

      • qty_to_deduct number Required

        Quantity which will be deducted for this source

      • qty_available number Required

        Available quantity for this source

      • ExtensionInterface class for @see \Magento\InventorySourceSelectionApi\Api\Data\SourceSelectionItemInterface

    • shippable boolean Required
    • ExtensionInterface class for @see \Magento\InventorySourceSelectionApi\Api\Data\SourceSelectionResultInterface

  • 401 Unauthorized

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Hide parameters attributes Show parameters attributes object

        Error parameters item

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Hide parameters attributes Show parameters attributes object

      Error parameters item

    • trace string

      Stack trace

  • Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Error details

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters item

        Hide parameters attributes Show parameters attributes object

        Error parameters item

    • code integer

      Error code

    • parameters array[object]

      Error parameters item

      Hide parameters attributes Show parameters attributes object

      Error parameters item

    • trace string

      Stack trace

POST /V1/inventory/source-selection-algorithm-result
curl \
 -X POST https://magento2.winkelstraat.mac/rest/all/V1/inventory/source-selection-algorithm-result \
 -d '{"inventoryRequest":{"stock_id":42,"items":[{"sku":"string","qty":42.0,"extension_attributes":{}}],"extension_attributes":{"destination_address":{"country":"string","postcode":"string","street":"string","region":"string","city":"string"}}},"algorithmCode":"string"}'
Request examples
{
  "inventoryRequest": {
    "stock_id": 42,
    "items": [
      {
        "sku": "string",
        "qty": 42.0,
        "extension_attributes": {}
      }
    ],
    "extension_attributes": {
      "destination_address": {
        "country": "string",
        "postcode": "string",
        "street": "string",
        "region": "string",
        "city": "string"
      }
    }
  },
  "algorithmCode": "string"
}
Response examples (200)
{
  "source_selection_items": [
    {
      "source_code": "string",
      "sku": "string",
      "qty_to_deduct": 42.0,
      "qty_available": 42.0,
      "extension_attributes": {}
    }
  ],
  "shippable": true,
  "extension_attributes": {}
}
Response examples (401)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}