Skip to content

Step 7. Make the additional website to be the Sales Channel for additional stock [Web API Tutorial]

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

Endpoint
PUT http://<host>/rest/all/V1/inventory/stocks/2

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

Payload

{
  "stock": {
    "stock_id": 2,
    "name": "Stock 2",
    "extension_attributes": {
      "sales_channels": [
        {
          "type": "website",
          "code": "test"
        }
      ]
    }
  }
}

Response

Complete cURL request

curl -X PUT "$endpoint/all/V1/inventory/stocks/$stock_id_2" \
 -H 'Content-Type: application/json' \
 -H "Authorization: Bearer $admin_token" \
 -d '{"stock":{"stock_id":"'"$stock_id_2"'","name":"'"$stock_name_2"'","extension_attributes":{"sales_channels":[{"type":"website","code":"additional"}]}}}'

◀️ 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