Virtual Warehouses

Working with virtual warehouses

List Virtual Warehouses

GET /v1/warehouses/virtual

Lists virtual warehouses.

Return Type

array<VirtualWarehouses>

Filters

FieldOperatorsValue List URL
activeEQUALS

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

CreateVirtualWarehouse

Return Type

VirtualWarehouses

Types for the Request Body

CreateVirtualWarehouse (root level)

KeyDescriptionTypesRestrictions
warehouseWarehouse details.Warehouserequired
not null
locationLocation details.CreateVirtualWarehouseLocationrequired
not null

CreateVirtualWarehouseLocation

KeyDescriptionTypesRestrictions
barcodeIdentifier of the location the virtual warehouse starts out with.stringrequired
not null
min length is 1
sellableShould the stock in this location be considered sellable?booleanrequired
not null

Warehouse

KeyDescriptionTypesRestrictions
nameName.stringrequired
not null
min length is 1
descriptionDescription.stringrequired
not null
min length is 0
api_managed_onlyIs this warehouse managed by an API?booleanrequired
not null
location_creation_enabledIs creating additional locations allowed?booleanrequired
not null

Available expands

FieldReturn TypeDescription
locationsarray<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

VirtualWarehouses

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

FieldOperatorsValue List URL
activeEQUALS
barcodeEQUALS, LIKE, NOT_LIKE, IN, NOT_IN
sellableEQUALS

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

VirtualWarehouseLocations

Types for the Request Body

CreateVirtualWarehouseLocation (root level)

KeyDescriptionTypesRestrictions
barcodeIdentifier of the location the virtual warehouse starts out with.stringrequired
not null
min length is 1
sellableShould the stock in this location be considered sellable?booleanrequired
not 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

VirtualWarehouseLocations

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

FieldOperatorsValue List URL
quantityLESS_THAN, EQUALS, MORE_THAN
expiry_dateLESS_THAN, MORE_THAN, ON_DATE
location.barcodeEQUALS, LIKE, NOT_LIKE, IN, NOT_IN
location.virtual_warehouse_idIN
product_variation.skuLIKE, NOT_LIKE, IN

Available expands

FieldReturn TypeDescription
locationVirtualWarehouseLocationsA location in a virtual warehouse.
location.warehouseVirtualWarehousesStorages that are outside of BladePRO’s control, such as showrooms, or stock at Amazon’s warehouse.
product_variationProductVariationsMarketplace 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

AdjustVirtualStockDelta

Return Type

VirtualStocks

Types for the Request Body

AdjustVirtualStockDelta (root level)

KeyDescriptionTypesRestrictions
quantityQuantity to adjust the stock by.integerrequired
not null
not equals is 0
expiry_dateExpiry 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

AdjustVirtualStockAbsolute

Return Type

VirtualStocks

Types for the Request Body

AdjustVirtualStockAbsolute (root level)

KeyDescriptionTypesRestrictions
quantityQuantity to set the value to.integerrequired
not null
min is 0
expiry_dateExpiry 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

BulkAdjustVirtualStockResult

Types for the Request Body

BulkAdjustVirtualStockDelta

KeyDescriptionTypesRestrictions
location_idVirtual warehouse location ID. Required if the warehouse allows for multiple locations.integernot null
min is 1
product_variation_idProduct variation ID.integerrequired
not null
min is 1
quantityQuantity to adjust the stock by.integerrequired
not null
not equals is 0
expiry_dateExpiry 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

BulkAdjustVirtualStockResult

Types for the Request Body

BulkAdjustVirtualStockAbsolute (root level)

KeyDescriptionTypesRestrictions
stocksValues to be set.array<Stock>required
not null
min count is 1
set_skipped_skus_to_zeroShould unlisted products in the listed locations be set to 0 quantity?booleanrequired
not null

Stock

KeyDescriptionTypesRestrictions
location_idVirtual warehouse location ID. Required if the warehouse allows for multiple locations.integernot null
min is 1
product_variation_idProduct variation ID.integerrequired
not null
min is 1
quantityQuantity to set the stock to.integerrequired
not null
min is 0
expiry_dateExpiry 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
    }
}