All URIs are relative to https://apiv2.shiprocket.in
Method | HTTP request | Description |
---|---|---|
getInventories | GET /v1/external/inventory | Get Details of orders with inventories |
updateInventory | PUT /v1/external/inventory/{id}/update | Update Inventory |
\Swagger\Client\Model\GetInventoriesResponse getInventories($page, $per_page, $sort, $sort_by)
Get Details of orders with inventories
Checks the availability of inventory according to the SKU
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Bearer
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\InventoryApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$page = 56; // int | The page number which is to be displayed
$per_page = 56; // int | The total number of products in each page in an integer format
$sort = "sort_example"; // string | Whether to arrange the items in ascending or descending order
$sort_by = "sort_by_example"; // string | Allows to choose the value field by which the items will be sorted. Could be sorted by id, by sku, time created etc.
try {
$result = $apiInstance->getInventories($page, $per_page, $sort, $sort_by);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InventoryApi->getInventories: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
page | int | The page number which is to be displayed | |
per_page | int | The total number of products in each page in an integer format | [optional] |
sort | string | Whether to arrange the items in ascending or descending order | [optional] |
sort_by | string | Allows to choose the value field by which the items will be sorted. Could be sorted by id, by sku, time created etc. | [optional] |
\Swagger\Client\Model\GetInventoriesResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\UpdateInventoryResponse updateInventory($id, $quantity, $action)
Update Inventory
Through this API you can make changes to the inventory listings in your ShipRocket panel
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Bearer
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\InventoryApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 56; // int | You have to pass the product id of the inventory which is to be updated
$quantity = 56; // int | The specific number which needs to be changed
$action = "action_example"; // string | Added = The number is added to the inventory Replace = The original number is replaced by the specific number Remove = The specific number is deducted from the opening number
try {
$result = $apiInstance->updateInventory($id, $quantity, $action);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InventoryApi->updateInventory: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | You have to pass the product id of the inventory which is to be updated | |
quantity | int | The specific number which needs to be changed | |
action | string | Added = The number is added to the inventory Replace = The original number is replaced by the specific number Remove = The specific number is deducted from the opening number |
\Swagger\Client\Model\UpdateInventoryResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]