younifyd
Menu

Create inventory/source-selection-algorithm-result

Create inventory/source-selection-algorithm-result

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

Use it in a workflow

  1. Add a step and choose the Adobe Commerce connector.
  2. Pick the Create inventory/source-selection-algorithm-result action (under Inventory).
  3. Fill in the fields below, then reference the result from later steps as {{createInventorySourceSelectionAlgorithmResult.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

inventoryRequestobjectrequired

Request products in a given Qty and StockId

stock_idintegerrequired

Stock Id

itemsarray<object>required3 fields

Items

extension_attributesobject1 fields

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

algorithmCodestringrequired
json
{
  "inventoryRequest": {
    "stock_id": 0,
    "items": [
      {
        "sku": "string",
        "qty": 0,
        "extension_attributes": {}
      }
    ],
    "extension_attributes": {
      "destination_address": {
        "country": "string",
        "postcode": "string",
        "street": "string",
        "region": "string",
        "city": "string"
      }
    }
  },
  "algorithmCode": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{createInventorySourceSelectionAlgorithmResult.response.data.<field>}}.

source_selection_itemsarray<object>

The list of source selection items representing how product quantities are deducted from sources.

source_codestringrequired

Source code

skustringrequired

Item SKU

qty_to_deductnumberrequired

Quantity which will be deducted for this source

qty_availablenumberrequired

Available quantity for this source

extension_attributesobject

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

shippableboolean

If the source selection result is eligible for shipping.

extension_attributesobject

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

json
{
  "source_selection_items": [
    {
      "source_code": "string",
      "sku": "string",
      "qty_to_deduct": 0,
      "qty_available": 0,
      "extension_attributes": {}
    }
  ],
  "shippable": false,
  "extension_attributes": {}
}

Need more? See the Adobe Commerce guide for connection setup and behaviour shared by every action.