Both sides previous revision
Previous revision
Next revision
|
Previous revision
Next revision
Both sides next revision
|
udropship:umarketplace:m2:vendor-api [2018/03/12 15:42] wtsergo |
udropship:umarketplace:m2:vendor-api [2018/03/23 21:53] renata |
===== Introduction ===== | ===== Introduction ===== |
| |
This add-on extend magento2 REST/Soap API and allow vendors utilize it to pull/update Purchase Orders information and update inventory data. | The Vendor API add-on extends Magento 2 REST/Soap API and allow vendors utilize it to pull/update Purchase Orders information and update inventory data. |
To get more technical details check: | To get more technical details check: |
- //app\code\Unirgy\DropshipApi\etc\webapi.xml// - list of entry points for API calls | - //app\code\Unirgy\DropshipApi\etc\webapi.xml// - list of entry points for API calls |
===== Authentication ===== | ===== Authentication ===== |
| |
In order to perform API operations vendor need authentication. System use Token-based authentication by vendor email/password. Before doing actual API calls vendor need to get authentication token by doing post to ///V1/integration/admin/token// with json encoded array of ''username'', ''password''. Response of that POST will be 32 bit token that need to be used for further API calls in Authorization request header with the Bearer HTTP authorization scheme to prove vendor identity. More information you can get here [[http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html]] | In order to perform API operations vendor need authentication. System use Token-based authentication by vendor email/password. Before doing actual API calls vendor need to get authentication token by doing post to ///V1/integration/admin/token// with json encoded array of ''username'', ''password''. Response of that POST will be 32 bit token that need to be used for further API calls in Authorization request header with the Bearer HTTP authorization scheme to prove vendor identity. More information is available here [[http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html]] |
| |
'' | '' |
===== Get list of Vendor Purchase Orders (possible to filter) ===== | ===== Get list of Vendor Purchase Orders (possible to filter) ===== |
| |
In order to get list of Purchase Orders need to perform ///V1/udpos// GET API call. It expect ''searchCriteria'' as parameter. More details on how to construct such filter check [[http://devdocs.magento.com/guides/v2.1/rest/performing-searches.html]] | In order to get list of Purchase Orders perform ///V1/udpos// GET API call. It expect ''searchCriteria'' as parameter. More details on how to construct the filter check can be found here [[http://devdocs.magento.com/guides/v2.1/rest/performing-searches.html]] |
| |
'' | '' |
===== Get Single Purchase Order Info ===== | ===== Get Single Purchase Order Info ===== |
| |
In order to get list of single Purchase Order information need to perform ///V1/udpo/:id// GET API call. :id parameter could be either Purchase Order entity id or it's increment id. | In order to get list of single Purchase Order information perform ///V1/udpo/:id// GET API call. :id parameter could be either Purchase Order entity id or it's increment id. |
| |
'' | '' |
===== Get Purchase Order Comments List ===== | ===== Get Purchase Order Comments List ===== |
| |
In order to get list of Purchase Order comments need to perform ///V1/udpo/:id/comments// GET API call. :id parameter could be either Purchase Order entity id or it's increment id. | In order to get list of Purchase Order comments perform ///V1/udpo/:id/comments// GET API call. :id parameter could be either Purchase Order entity id or it's increment id. |
| |
'' | '' |
===== Perform Inventory update ===== | ===== Perform Inventory update ===== |
| |
Vendor can use ///V1/udstock/update// POST API calls to update his products inventory (products offers when multivendor add-on used). Request payload expect **items** parameter which should be array of arrays (later one contain single offer data details). Each offer detail can have following parameters: | Vendors can use ///V1/udstock/update// POST API calls to update their products inventory (products offers, when Multivendor add-on is used). Request payload expect **items** parameter which should be array of arrays (later one contain single offer data details). Each offer detail can have following parameters: |
* sku | * sku |
* priority | * priority |
* specialToDate | * specialToDate |
| |
But only **sku** or **vendor_sku** are required. When not using multivendor add-on it's possible to use only this keys in offer details array **sku**, **vendor_sku**, **stock_qty**, **stock_qty_add** | But only **sku** or **vendor_sku** are required. When not using Multivendor add-on it's possible to use only this keys in offer details array **sku**, **vendor_sku**, **stock_qty**, **stock_qty_add** |
| |
| Response of API call will contain string information of how many items were updated and errors list at the end if any. |
| |
| '' |
| Example:\\ |
| POST http://magento222.loc/index.php/rest/V1/udstock/update/\\ |
| {"items":[{"sku":"24-MB01","vendor_sku":"v2-24-MB01","stock_qty":"11"},{"vendor_sku":"v2-24-MB04","stock_qty":"22"},{"vendor_sku":"not-existing-vendor-sku","stock_qty":"22"},{"sku":"not-existing-sku","vendor_sku":"not-existing-vendor-sku","stock_qty":"22"}]}\\ |
| \\ |
| RESPONSE\\ |
| "Updated 2 items of 4: (Product not found for vendor sku \"not-existing-vendor-sku\", Product not found for sku \"not-existing-sku\")" |
| '' |
| |
| |