Skip to content

Before you begin [Web API Tutorial]

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

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.

Getting started

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

Complete these prerequisites

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