-
Notifications
You must be signed in to change notification settings - Fork 248
Before you begin [Web API Tutorial]
This is the simplest example of Order Processing that takes into account all the new features that are specific for Multi-Source Inventory. This step-by-step guide is written in the form of a tutorial.
Each step in this tutorial provides the following information:
Endpoint
This section lists the HTTP verb and full path to the endpoint. The basic structure of a REST call in Magento is
<HTTP verb> http://<host>/rest/<scope>/<endpoint>
where:
Element | Description |
---|---|
HTTP verb | One of GET , POST , PUT , or DELETE
|
host | The hostname or IP address (and optionally, port) of the Magento installation. |
scope | Specifies which store the call affects. In this tutorial, this value is default . |
endpoint | The full URI (Uniform Resource Identifier) to the endpoint. These values always start with /V1 . For example, /V1/orders/4 . |
HTTP headers
This section indicates which key/value pairs you must specify in the HTTP headers. All calls require one or more HTTP headers.
Payload
This section lists the information that is sent to Magento. All payload samples are valid and can be copied and pasted into your calls, but you might need to change the id values that Magento returns.
Response
This section lists the information that Magento sends to the REST client. These values are often referenced in other steps in the tutorial. The values Magento returns might be different than the values listed in the examples provided in this tutorial.
Complete cURL request sample
This section contains the code that can be copied and pasted to UNIX-like console emulator (Bourne Shell for example) with cURL support. The information that should be modified by the user will be enclosed between angle brackets. Example:
endpoint="http://<host>/rest"
curl -X GET "$endpoint/V1/directory/countries" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $admin_token" | json_pp | grep -in -B3 -A3 "United States"
where:
-
endpoint
is a temporary variable set to Bourne Shell environment. You have access to it only during this terminal session. It is not reachable in other tab or window or if the terminal is reopened. -
<host>
is the Magento Base URL -
json_pp
is the prettifier (only humans need it) -
grep
is used for search and highlighting information
- Install a Magento 2.3.0 MSI (or later) instance.
- Install a REST client. You can use any REST client to send calls to Magento. Postman is recommended.
- Know how to construct a REST call in Magento. See Construct a request for details.
- Generate a local API reference.
- Find the Magento MSI WebAPI wiki on Github.
📖 Table of Contents | Next Step |
Multi-Source Inventory developed by Magento 2 Community
- Technical Vision. Catalog Inventory
- Installation Guide
- List of Inventory APIs and their legacy analogs
- MSI Roadmap
- Known Issues in Order Lifecycle
- MSI User Guide
- 2.3 LIVE User Guide
- MSI Release Notes and Installation
- Overview
- Get Started with MSI
- MSI features and processes
- Global and Product Settings
- Configure Source Selection Algorithm
- Create Sources
- Create Stock
- Assign Inventory and Product Notifications
- Configure MSI backorders
- MSI Import and Export Product Data
- Mass Action Tool
- Shipment and Order Management
- CLI reference
- Reports and MSI
- MSI FAQs
- DevDocs Documentation
- Manage Inventory Management Modules (install/upgrade info)
- Inventory Management
- Reservations
- Inventory CLI reference
- Inventory API reference
- Inventory In-Store Pickup API reference
- Order Processing with Inventory Management
- Managing sources
- Managing stocks
- Link and unlink stocks and sources
- Manage source items
- Perform bulk actions
- Manage Low-Quantity Notifications
- Check salable quantities
- Manage source selection algorithms
- User Stories
- Support of Store Pickup for MSI
- Product list assignment per Source
- Source assignment per Product
- Stocks to Sales Channel Mapping
- Adapt Product Import/Export to support multi Sourcing
- Introduce SourceCode attribute for Source and SourceItem entities
- Assign Source Selector for Processing of Returns Credit Memo
- User Scenarios:
- Technical Designs:
- Module Structure in MSI
- When should an interface go into the Model directory and when should it go in the Api directory?
- Source and Stock Item configuration Design and DB structure
- Stock and Source Configuration design
- Open Technical Questions
- Inconsistent saving of Stock Data
- Source API
- Source WebAPI
- Sources to Sales Channels mapping
- Service Contracts MSI
- Salable Quantity Calculation and Mechanism of Reservations
- StockItem indexation
- Web API and How To cover them with Functional Testing
- Source Selection Algorithms
- Validation of Domain Entities
- PHP 7 Syntax usage for Magento contribution
- The first step towards pre generated IDs. And how this will improve your Integration tests
- The Concept of Default Source and Domain Driven Design
- Extension Point of Product Import/Export
- Source Selection Algorithm
- SourceItem Entity Extension
- Design Document for changing SerializerInterface
- Stock Management for Order Cancelation
- Admin UI
- MFTF Extension Tests
- Weekly MSI Demos
- Tutorials