Virtual Warehouses
Working with virtual warehouses
List Virtual Warehouses
GET /v1/warehouses/virtual
Lists virtual warehouses.
Return Type
array<VirtualWarehouses>
Filters
| Field | Operators | Value List URL |
|---|---|---|
| active | EQUALS |
Sortings
Results can be sorted by the following keys: name.
Rate limit cost
Each call to this endpoint deducts 3 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("GET", "https://public-api.bladepro.io/v1/warehouses/virtual", [
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.get 'https://public-api.bladepro.io/v1/warehouses/virtual', {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "GET",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual",
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request GET 'https://public-api.bladepro.io/v1/warehouses/virtual' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86",
"paging": {
"page": 1,
"records": 1,
"per_page": 250,
"total_records": 1,
"total_pages": 1
}
},
"data": [
{
"id": 1,
"name": "Amazon FBA",
"description": "Stock shipped to Amazon.",
"active": true,
"api_managed_only": true,
"location_creation_enabled": false,
"created": "2019-11-25T14:52:56.000Z"
}
]
}Create Virtual Warehouse
POST /v1/warehouses/virtual
Create virtual warehouses.
Request Body
Return Type
Types for the Request Body
CreateVirtualWarehouse (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
warehouse | Warehouse details. | Warehouse | requirednot null |
location | Location details. | CreateVirtualWarehouseLocation | requirednot null |
CreateVirtualWarehouseLocation
| Key | Description | Types | Restrictions |
|---|---|---|---|
barcode | Identifier of the location the virtual warehouse starts out with. | string | requirednot nullmin length is 1 |
sellable | Should the stock in this location be considered sellable? | boolean | requirednot null |
Warehouse
| Key | Description | Types | Restrictions |
|---|---|---|---|
name | Name. | string | requirednot nullmin length is 1 |
description | Description. | string | requirednot nullmin length is 0 |
api_managed_only | Is this warehouse managed by an API? | boolean | requirednot null |
location_creation_enabled | Is creating additional locations allowed? | boolean | requirednot null |
Available expands
| Field | Return Type | Description |
|---|---|---|
locations | array<VirtualWarehouseLocations> | A location in a virtual warehouse. |
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("POST", "https://public-api.bladepro.io/v1/warehouses/virtual?expand=*", [
"body" => json_encode([
"warehouse" => [
"name" => "Amazon FBA",
"description" => "Stock shipped to Amazon.",
"api_managed_only" => true,
"location_creation_enabled" => true,
],
"location" => [
"barcode" => "SHOWROOM",
"sellable" => true,
],
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.post 'https://public-api.bladepro.io/v1/warehouses/virtual?expand=*', {
warehouse: {
name: "Amazon FBA",
description: "Stock shipped to Amazon.",
api_managed_only: true,
location_creation_enabled: true,
},
location: {
barcode: "SHOWROOM",
sellable: true,
},
}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "POST",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual?expand=*",
body: {
"warehouse": {
"name": "Amazon FBA",
"description": "Stock shipped to Amazon.",
"api_managed_only": true,
"location_creation_enabled": true
},
"location": {
"barcode": "SHOWROOM",
"sellable": true
}
},
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request POST 'https://public-api.bladepro.io/v1/warehouses/virtual?expand=*' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"warehouse": {
"name": "Amazon FBA",
"description": "Stock shipped to Amazon.",
"api_managed_only": true,
"location_creation_enabled": true
},
"location": {
"barcode": "SHOWROOM",
"sellable": true
}
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"name": "Amazon FBA",
"description": "Stock shipped to Amazon.",
"active": true,
"api_managed_only": true,
"location_creation_enabled": false,
"created": "2019-11-25T14:52:56.000Z",
"locations": [
{
"id": 1,
"barcode": "SHOWROOM",
"virtual_warehouse_id": 1,
"active": true,
"sellable": true,
"created": "2019-11-25T14:52:56.000Z"
}
]
}
}Void Virtual Warehouse
PUT /v1/warehouses/virtual/:warehouseId/void
Deactivates a virtual warehouse.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
Request Body
Ignored.
Return Type
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/warehouses/virtual/1/void", [
"body" => "{}",
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.put 'https://public-api.bladepro.io/v1/warehouses/virtual/1/void', {}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "PUT",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/void",
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request PUT 'https://public-api.bladepro.io/v1/warehouses/virtual/1/void' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"name": "Amazon FBA",
"description": "Stock shipped to Amazon.",
"active": true,
"api_managed_only": true,
"location_creation_enabled": false,
"created": "2019-11-25T14:52:56.000Z"
}
}List Locations
GET /v1/warehouses/virtual/:warehouseId/locations
Lists virtual warehouse locations.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
Return Type
array<VirtualWarehouseLocations>
Filters
| Field | Operators | Value List URL |
|---|---|---|
| active | EQUALS | |
| barcode | EQUALS, LIKE, NOT_LIKE, IN, NOT_IN | |
| sellable | EQUALS |
Sortings
Results can be sorted by the following keys: barcode.
Rate limit cost
Each call to this endpoint deducts 3 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("GET", "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations", [
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.get 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations', {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "GET",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations",
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request GET 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86",
"paging": {
"page": 1,
"records": 1,
"per_page": 250,
"total_records": 1,
"total_pages": 1
}
},
"data": [
{
"id": 1,
"barcode": "SHOWROOM",
"virtual_warehouse_id": 1,
"active": true,
"sellable": true,
"created": "2019-11-25T14:52:56.000Z"
}
]
}Create Location
POST /v1/warehouses/virtual/:warehouseId/locations
Create a location for a virtual warehouse.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
Request Body
CreateVirtualWarehouseLocation
Return Type
Types for the Request Body
CreateVirtualWarehouseLocation (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
barcode | Identifier of the location the virtual warehouse starts out with. | string | requirednot nullmin length is 1 |
sellable | Should the stock in this location be considered sellable? | boolean | requirednot null |
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("POST", "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations", [
"body" => json_encode([
"barcode" => "SHOWROOM",
"sellable" => true,
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.post 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations', {
barcode: "SHOWROOM",
sellable: true,
}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "POST",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations",
body: {
"barcode": "SHOWROOM",
"sellable": true
},
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request POST 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"barcode": "SHOWROOM",
"sellable": true
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"barcode": "SHOWROOM",
"virtual_warehouse_id": 1,
"active": true,
"sellable": true,
"created": "2019-11-25T14:52:56.000Z"
}
}Void Virtual Warehouse Location
PUT /v1/warehouses/virtual/:warehouseId/locations/:locationId/void
Deactivates a virtual warehouse location.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
- :locationId: [1-9][0-9]{0,}
Request Body
Ignored.
Return Type
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/void", [
"body" => "{}",
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.put 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/void', {}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "PUT",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/void",
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request PUT 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/void' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"barcode": "SHOWROOM",
"virtual_warehouse_id": 1,
"active": true,
"sellable": true,
"created": "2019-11-25T14:52:56.000Z"
}
}List Virtual Stock
GET /v1/warehouses/virtual/stocks
Lists virtual stock.
Return Type
array<VirtualStocks>
Filters
| Field | Operators | Value List URL |
|---|---|---|
| quantity | LESS_THAN, EQUALS, MORE_THAN | |
| expiry_date | LESS_THAN, MORE_THAN, ON_DATE | |
| location.barcode | EQUALS, LIKE, NOT_LIKE, IN, NOT_IN | |
| location.virtual_warehouse_id | IN | |
| product_variation.sku | LIKE, NOT_LIKE, IN |
Available expands
| Field | Return Type | Description |
|---|---|---|
location | VirtualWarehouseLocations | A location in a virtual warehouse. |
location.warehouse | VirtualWarehouses | Storages that are outside of BladePRO’s control, such as showrooms, or stock at Amazon’s warehouse. |
product_variation | ProductVariations | Marketplace listable products’ data. |
Rate limit cost
Each call to this endpoint deducts 1 credit from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("GET", "https://public-api.bladepro.io/v1/warehouses/virtual/stocks?expand=*", [
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.get 'https://public-api.bladepro.io/v1/warehouses/virtual/stocks?expand=*', {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "GET",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/stocks?expand=*",
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request GET 'https://public-api.bladepro.io/v1/warehouses/virtual/stocks?expand=*' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86",
"paging": {
"page": 1,
"records": 1,
"per_page": 250,
"total_records": 1,
"total_pages": 1
}
},
"data": [
{
"id": 1,
"virtual_warehouse_location_id": 1,
"product_variation_id": 1,
"quantity": 1000,
"expiry_date": null,
"created": "2019-11-25T14:52:56.000Z",
"modified": "2019-11-25T14:52:56.000Z",
"location": {
"id": 1,
"barcode": "SHOWROOM",
"virtual_warehouse_id": 1,
"active": true,
"sellable": true,
"created": "2019-11-25T14:52:56.000Z",
"warehouse": {
"id": 1,
"name": "Amazon FBA",
"description": "Stock shipped to Amazon.",
"active": true,
"api_managed_only": true,
"location_creation_enabled": false,
"created": "2019-11-25T14:52:56.000Z"
}
},
"product_variation": {
"id": 1,
"product_id": 1,
"status": "active",
"sku": "DEMO-SKU-01",
"barcode": "0123456789012",
"product_variation_type_id": 1,
"discontinued_date": "2019-11-25T14:52:56.000Z",
"despatch_instructions": "Always pack facing upwards.",
"created": "2019-11-25T14:52:56.000Z",
"modified": "2019-11-25T14:52:56.000Z"
}
}
]
}Adjust Virtual Stock - Delta
PUT /v1/warehouses/virtual/:warehouseId/locations/:locationId/stocks/:variationId/adjust
Adjusts stock by a delta value.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
- :locationId: [1-9][0-9]{0,}
- :variationId: [1-9][0-9]{0,}
Request Body
Return Type
Types for the Request Body
AdjustVirtualStockDelta (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
quantity | Quantity to adjust the stock by. | integer | requirednot nullnot equals is 0 |
expiry_date | Expiry date. | date |
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/adjust", [
"body" => json_encode([
"quantity" => -10,
"expiry_date" => null,
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.put 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/adjust', {
quantity: -10,
expiry_date: nil,
}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "PUT",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/adjust",
body: {
"quantity": -10,
"expiry_date": null
},
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request PUT 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/adjust' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"quantity": -10,
"expiry_date": null
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"virtual_warehouse_location_id": 1,
"product_variation_id": 1,
"quantity": 1000,
"expiry_date": null,
"created": "2019-11-25T14:52:56.000Z",
"modified": "2019-11-25T14:52:56.000Z"
}
}Adjust Virtual Stock - Absolute
PUT /v1/warehouses/virtual/:warehouseId/locations/:locationId/stocks/:variationId/set
Adjusts stock to an absolute value.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
- :locationId: [1-9][0-9]{0,}
- :variationId: [1-9][0-9]{0,}
Request Body
Return Type
Types for the Request Body
AdjustVirtualStockAbsolute (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
quantity | Quantity to set the value to. | integer | requirednot nullmin is 0 |
expiry_date | Expiry date. | date |
Rate limit cost
Each call to this endpoint deducts 2 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/set", [
"body" => json_encode([
"quantity" => 1000,
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.put 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/set', {
quantity: 1000,
}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "PUT",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/set",
body: {
"quantity": 1000
},
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request PUT 'https://public-api.bladepro.io/v1/warehouses/virtual/1/locations/1/stocks/1/set' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"quantity": 1000
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 1,
"virtual_warehouse_location_id": 1,
"product_variation_id": 1,
"quantity": 1000,
"expiry_date": null,
"created": "2019-11-25T14:52:56.000Z",
"modified": "2019-11-25T14:52:56.000Z"
}
}Bulk Adjust Virtual Stock - Delta
PUT /v1/warehouses/virtual/:warehouseId/stocks/adjust
Adjust stock by a delta value.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
Request Body
array<BulkAdjustVirtualStockDelta>
Return Type
Types for the Request Body
BulkAdjustVirtualStockDelta
| Key | Description | Types | Restrictions |
|---|---|---|---|
location_id | Virtual warehouse location ID. Required if the warehouse allows for multiple locations. | integer | not nullmin is 1 |
product_variation_id | Product variation ID. | integer | requirednot nullmin is 1 |
quantity | Quantity to adjust the stock by. | integer | requirednot nullnot equals is 0 |
expiry_date | Expiry date. | date |
Rate limit cost
Each call to this endpoint deducts 5 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/adjust", [
"body" => json_encode([
[
"location_id" => 1,
"product_variation_id" => 1,
"quantity" => -15,
"expiry_date" => null,
],
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.put 'https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/adjust', [
{
location_id: 1,
product_variation_id: 1,
quantity: -15,
expiry_date: nil,
},
], {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "PUT",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/adjust",
body: [
{
"location_id": 1,
"product_variation_id": 1,
"quantity": -15,
"expiry_date": null
}
],
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request PUT 'https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/adjust' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '[
{
"location_id": 1,
"product_variation_id": 1,
"quantity": -15,
"expiry_date": null
}
]'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"affected": 15
}
}Bulk Adjust Virtual Stock - Absolute
PUT /v1/warehouses/virtual/:warehouseId/stocks/set
Adjust stock to an absolute value.
Parameter Regular Expressions
- :warehouseId: [1-9][0-9]{0,}
Request Body
BulkAdjustVirtualStockAbsolute
Return Type
Types for the Request Body
BulkAdjustVirtualStockAbsolute (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
stocks | Values to be set. | array<Stock> | requirednot nullmin count is 1 |
set_skipped_skus_to_zero | Should unlisted products in the listed locations be set to 0 quantity? | boolean | requirednot null |
Stock
| Key | Description | Types | Restrictions |
|---|---|---|---|
location_id | Virtual warehouse location ID. Required if the warehouse allows for multiple locations. | integer | not nullmin is 1 |
product_variation_id | Product variation ID. | integer | requirednot nullmin is 1 |
quantity | Quantity to set the stock to. | integer | requirednot nullmin is 0 |
expiry_date | Expiry date. | date |
Rate limit cost
Each call to this endpoint deducts 5 credits from your request bucket.
Scopes
This endpoint is only available for users with scope APP::MISC.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/set", [
"body" => json_encode([
"stocks" => [
[
"location_id" => 1,
"product_variation_id" => 1,
"quantity" => 1000,
"expiry_date" => null,
],
],
"set_skipped_skus_to_zero" => true,
]),
"headers" => [
"Content-Type" => "application/json",
"Access-Token" => "my-token-from-login",
],
]);
// Process the response
$responseBody = json_decode($response->getBody(), true);require 'rest-client'
require 'json'
# Make the request
response = RestClient.put 'https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/set', {
stocks: [
{
location_id: 1,
product_variation_id: 1,
quantity: 1000,
expiry_date: nil,
},
],
set_skipped_skus_to_zero: true,
}, {
access_token: 'my-token-from-login',
content_type: :json,
accept: :json
}
# Process the response
puts response.body// Require the node HTTP module
var request = require("request");
// Make the request
request({
method: "PUT",
json: true,
uri: "https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/set",
body: {
"stocks": [
{
"location_id": 1,
"product_variation_id": 1,
"quantity": 1000,
"expiry_date": null
}
],
"set_skipped_skus_to_zero": true
},
headers: {
"Access-Token": "my-token-from-login",
"Content-Type": "application/json",
},
(error, response, body) => {
// Process the response
console.log(body);
},
});# Make the request
curl --location --request PUT 'https://public-api.bladepro.io/v1/warehouses/virtual/1/stocks/set' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"stocks": [
{
"location_id": 1,
"product_variation_id": 1,
"quantity": 1000,
"expiry_date": null
}
],
"set_skipped_skus_to_zero": true
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"affected": 15
}
}