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

      Items

      Hide items attributes Show items attributes object

      Represents requested quantity for particular product

      • sku string Required

        SKU

      • qty number Required

        Product Quantity

      • extension_attributes object

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

    • extension_attributes object

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

      Hide extension_attributes attribute Show extension_attributes attribute object
      • destination_address 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

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

      Items

      Hide items attributes Show items attributes object

      Represents requested quantity for particular product

      • sku string Required

        SKU

      • qty number Required

        Product Quantity

      • extension_attributes object

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

    • extension_attributes object

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

      Hide extension_attributes attribute Show extension_attributes attribute object
      • destination_address 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
    • source_selection_items array[object] Required
      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

      • extension_attributes object

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

    • shippable boolean Required
    • extension_attributes object

      ExtensionInterface class for @see \Magento\InventorySourceSelectionApi\Api\Data\SourceSelectionResultInterface

    Hide response attributes Show response attributes object
    • source_selection_items array[object] Required
      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

      • extension_attributes object

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

    • shippable boolean Required
    • extension_attributes object

      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]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

POST /V1/inventory/source-selection-algorithm-result
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/inventory/source-selection-algorithm-result' \
 --header "Content-Type: application/json" \
 --data '{"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"}'
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/inventory/source-selection-algorithm-result' \
 --header "Content-Type: application/xml"
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"
}
Request examples
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <inventoryRequest>
    <stock-id type="integer">42</stock-id>
    <items type="array">
      <item>
        <sku>string</sku>
        <qty type="float">42.0</qty>
        <extension-attributes>
        </extension-attributes>
      </item>
    </items>
    <extension-attributes>
      <destination-address>
        <country>string</country>
        <postcode>string</postcode>
        <street>string</street>
        <region>string</region>
        <city>string</city>
      </destination-address>
    </extension-attributes>
  </inventoryRequest>
  <algorithmCode>string</algorithmCode>
</root>
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 (200)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <source-selection-items type="array">
    <source-selection-item>
      <source-code>string</source-code>
      <sku>string</sku>
      <qty-to-deduct type="float">42.0</qty-to-deduct>
      <qty-available type="float">42.0</qty-available>
      <extension-attributes>
      </extension-attributes>
    </source-selection-item>
  </source-selection-items>
  <shippable type="boolean">true</shippable>
  <extension-attributes>
  </extension-attributes>
</root>
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 (401)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <message>string</message>
  <errors type="array">
    <error>
      <message>string</message>
      <parameters type="array">
        <parameter>
          <resources>string</resources>
          <fieldName>string</fieldName>
          <fieldValue>string</fieldValue>
        </parameter>
      </parameters>
    </error>
  </errors>
  <code type="integer">42</code>
  <parameters type="array">
    <parameter>
      <resources>string</resources>
      <fieldName>string</fieldName>
      <fieldValue>string</fieldValue>
    </parameter>
  </parameters>
  <trace>string</trace>
</root>
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"
}
Response examples (default)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <message>string</message>
  <errors type="array">
    <error>
      <message>string</message>
      <parameters type="array">
        <parameter>
          <resources>string</resources>
          <fieldName>string</fieldName>
          <fieldValue>string</fieldValue>
        </parameter>
      </parameters>
    </error>
  </errors>
  <code type="integer">42</code>
  <parameters type="array">
    <parameter>
      <resources>string</resources>
      <fieldName>string</fieldName>
      <fieldValue>string</fieldValue>
    </parameter>
  </parameters>
  <trace>string</trace>
</root>