Skip to content

Step 18. Create a shipment [Web API]

Ievgen Shakhsuvarov edited this page Jul 16, 2019 · 15 revisions

One of the most significant parts of MSI is Source Selection Algorithm(SSA). At moment of writing, there is only one available SSA in MSI. You can get the list of all available algorithms this way:

Endpoint
GET V1/inventory/source-selection-algorithm-list

Headers

Content-Type: application/json
Authorization: Bearer <admin_token>

Payload
None

Response

[                                                                                                                                                                                                      
   {                                                                                                                                                                                                   
      "title" : "Source Priority",                                                                                                                                                                     
      "code" : "priority",                                                                                                                                                                             
      "description" : "Algorithm which provides Source Selections based on predefined priority of Source"                                                                                              
   }                                                                                                                                                                                                   
]

Complete cURL request

curl -X GET "$endpoint/V1/inventory/source-selection-algorithm-list" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $admin_token" | json_pp

The goal of any SSA is to provide the best source item selection computed by the algorithm. We get the list of SKU and QTY per Stock as a result.

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

Headers

Content-Type: application/json
Authorization: Bearer <admin_token>

Payload

{
	"inventoryRequest": {
		"stockId": 0,
		"items": [{
			"sku": "Simple Product MSM 1",
			"qty": 12
		}]
	},
	"algorithmCode": "priority"
}

Response

Complete cURL request

curl -X POST "$endpoint/V1/inventory/source-selection-algorithm-result" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $admin_token" \
-d '{"inventoryRequest":{"stockId":0,"items":[{"sku":"Simple Product MSM 1","qty":12}]},"algorithmCode":"priority"}'

Create a shipment with Simple Product
Create a shipment with Configurable Product
Create a shipment with Downloadable Product
Create a shipment with Virtual Product

◀️ Previous Step 📖 Table of Contents Next Step ▶️

MSI Documentation:

  1. Technical Vision. Catalog Inventory
  2. Installation Guide
  3. List of Inventory APIs and their legacy analogs
  4. MSI Roadmap
  5. Known Issues in Order Lifecycle
  6. MSI User Guide
  7. DevDocs Documentation
  8. User Stories
  9. User Scenarios:
  10. Technical Designs:
  11. Admin UI
  12. MFTF Extension Tests
  13. Weekly MSI Demos
  14. Tutorials
Clone this wiki locally