Applications

Working with apps core settings.

List Preference Values

GET /v1/preferences

Lists every preference value for the authenticated application instance.

Return Type

array<ApplicationInstancePreferenceValues>

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/preferences", [
    "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/preferences', {
  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/preferences",
    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/preferences' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": [
        {
            "code": "HOLD_FRAUDULENT_ORDERS",
            "value": "12.43",
            "modified": "2019-11-25T14:52:56.000Z"
        }
    ]
}

Get Preference Value

GET /v1/preferences/:code

Returns the value of a preference.

Parameter Regular Expressions

  • :code: [a-zA-Z_]{1,100}

Return Type

ApplicationInstancePreferences

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/preferences/my_preference", [
    "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/preferences/my_preference', {
  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/preferences/my_preference",
    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/preferences/my_preference' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "value": "12.43",
        "modified": "2019-11-25T14:52:56.000Z"
    }
}

Set Preference Value

PUT /v1/preferences/:code

Sets the value of a preference.

Parameter Regular Expressions

  • :code: [a-zA-Z_]{1,100}

Request Body

SetValue

Return Type

ApplicationInstancePreferences

Types for the Request Body

SetValue (root level)

KeyDescriptionTypesRestrictions
valueThe value.stringrequired

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/preferences/my_preference", [
    "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/preferences/my_preference', {}, {
  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/preferences/my_preference",
    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/preferences/my_preference' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "value": "12.43",
        "modified": "2019-11-25T14:52:56.000Z"
    }
}

Activate Application

PUT /v1/apps/activate

Mark the application’s installation as active.

Request Body

Ignored.

Return Type

ApplicationInstanceStatuses

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/apps/activate", [
    "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/apps/activate', {}, {
  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/apps/activate",
    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/apps/activate' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "name": "Active",
        "code": "ACTIVE",
        "description": "The application is live and active."
    }
}

Deactivate Application

PUT /v1/apps/deactivate

Mark the application’s installation as deactivated.

Request Body

Ignored.

Return Type

ApplicationInstanceStatuses

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/apps/deactivate", [
    "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/apps/deactivate', {}, {
  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/apps/deactivate",
    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/apps/deactivate' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "name": "Active",
        "code": "ACTIVE",
        "description": "The application is live and active."
    }
}

App Instance Info

GET /v1/apps/info

Get a summary of the logged in application instance.

Return Type

ApplicationInstanceInfos

Available expands

FieldReturn TypeDescription
statusApplicationInstanceStatusesRepresents a status for an application instance.

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/apps/info?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/apps/info?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/apps/info?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/apps/info?expand=*' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "nickname": "My web store",
        "status": {
            "name": "Active",
            "code": "ACTIVE",
            "description": "The application is live and active."
        }
    }
}

Get Marketplace Application Settings

GET /v1/apps/marketplace/settings

Returns the main configuration settings for an app of type Marketplace.

Return Type

MarketplaceApplicationInstanceSettings

Available expands

FieldReturn TypeDescription
currencySummarisedCurrencyA currency.
localeSummarisedLocaleLocale / Language.
order_channelOrderChannelsCustomer order groups.
order_channel.taxOrganisationTaxesOrganisation tax data.
primary_warehouseSummarisedWarehouseA warehouse.
primary_warehouse.countrySummarisedCountryA country.
warehousesarray<SummarisedWarehouse>A warehouse.
warehouses.countrySummarisedCountryA country.

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/apps/marketplace/settings?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/apps/marketplace/settings?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/apps/marketplace/settings?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/apps/marketplace/settings?expand=*' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "currency_id": 1,
        "locale_id": 1,
        "order_channel_id": 321,
        "primary_warehouse_id": 1,
        "order_import_grace_period_minutes": 0,
        "ignore_orders_created_before": null,
        "allow_multi_location_support": 0,
        "currency": {
            "code": "GBP",
            "name": "British Pound",
            "symbol": "£"
        },
        "locale": {
            "id": 1,
            "name": "English",
            "code": "en",
            "created": "2019-11-25T14:52:56.000Z",
            "modified": "2019-11-25T14:52:56.000Z"
        },
        "order_channel": {
            "id": 321,
            "organisation_id": 321,
            "name": "Demo Channel",
            "short_code": "DEMO",
            "status": "active",
            "created": "2019-11-25T14:52:56.000Z",
            "modified": "2019-11-25T14:52:56.000Z",
            "tax": {
                "id": 1,
                "name": "standard",
                "code": "20",
                "rate": 20,
                "description": "standard 20%",
                "active": true,
                "created": "2019-11-25T14:52:56.000Z",
                "modified": "2019-11-25T14:52:56.000Z"
            }
        },
        "primary_warehouse": {
            "id": 1,
            "short_code": "CHR",
            "name": "Christchurch"
        },
        "warehouses": [
            {
                "id": 1,
                "short_code": "CHR",
                "name": "Christchurch"
            }
        ]
    }
}

Get Demand Planning Application Settings

GET /v1/apps/demand_planning/settings

Returns the main configuration settings for an app of type Demand Planning.

Return Type

DemandPlanningApplicationInstanceSettings

Rate limit cost

Each call to this endpoint deducts 3 credits from your request bucket.

Scopes

This endpoint is only available for users with any of these scopes: APP::PRODUCTS::MANAGE, APP:PURCHASE-ORDERS::MANAGE.

<?php

// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();

// Make the request
$response = $client->request("GET", "https://public-api.bladepro.io/v1/apps/demand_planning/settings", [
    "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/apps/demand_planning/settings', {
  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/apps/demand_planning/settings",
    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/apps/demand_planning/settings' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login'

Example result:

{
    "meta": {
        "request_reference": "235chjz9h-c893v86"
    },
    "data": {
        "product_channel_id": 123,
        "organisation_id": 123,
        "warehouse_code": "TRAI"
    }
}