Order Lines
Working with order lines.
Create Order Line
POST /v1/orders/goodsouts/:id/lines
Adds a new line to an existing goodsout.
Parameter Regular Expressions
- :id: [1-9][0-9]{0,}
Request Body
Return Type
Types for the Request Body
CreateOrderGoodsoutLine (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
variation | Product description | Variation | requirednot null |
net_unit_principal | The net amount paid for a single one of these items. | number | requirednot nullmin is 0 |
principal_tax | The ID of the tax that should be applied to the line principal value. | integer | requirednot nullmin is 1 |
discount | The amount of discount to be applied to the line principal value. | number | not nullmin is 0 |
discount_type | The type of discount to apply. | enum(percentage, value) | not null |
quantity | The quantity ordered. | integer | requirednot nullmin is 1 |
Variation
| Key | Description | Types | Restrictions |
|---|---|---|---|
sku | The product’s stock keeping unit (SKU). | string | requirednot nullmin length is 1 |
channel | The product channel’s ID. | integer | requirednot nullmin is 1 |
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::ORDERS::MANAGE.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("POST", "https://public-api.bladepro.io/v1/orders/goodsouts/1234567/lines", [
"body" => json_encode([
"variation" => [
"sku" => "GREEN-BALL",
"channel" => 1,
],
"net_unit_principal" => 12.55,
"principal_tax" => 12,
"discount" => 0,
"discount_type" => "value",
"quantity" => 4,
]),
"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/orders/goodsouts/1234567/lines', {
variation: {
sku: "GREEN-BALL",
channel: 1,
},
net_unit_principal: 12.55,
principal_tax: 12,
discount: 0,
discount_type: "value",
quantity: 4,
}, {
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/orders/goodsouts/1234567/lines",
body: {
"variation": {
"sku": "GREEN-BALL",
"channel": 1
},
"net_unit_principal": 12.55,
"principal_tax": 12,
"discount": 0,
"discount_type": "value",
"quantity": 4
},
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/orders/goodsouts/1234567/lines' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"variation": {
"sku": "GREEN-BALL",
"channel": 1
},
"net_unit_principal": 12.55,
"principal_tax": 12,
"discount": 0,
"discount_type": "value",
"quantity": 4
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 3450345,
"transaction_sku": "GREEN-BALL",
"quantity": 4,
"discount_type": "percentage",
"discount": 1.5,
"net_unit_principal": 12,
"status": "active"
}
}Update Order Line Quantity
PUT /v1/orders/goodsouts/:id/lines/:lineId/quantity
Updates the quantity of an order goodsout line.
Parameter Regular Expressions
- :id: [1-9][0-9]{0,}
- :lineId: [1-9][0-9]{0,}
Request Body
Return Type
Types for the Request Body
UpdateGoodsoutLineQuantity (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
quantity | Quantity. | integer | requirednot nullmin is 1 |
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::ORDERS::MANAGE.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/orders/goodsouts/1234567/lines/3450345/quantity", [
"body" => json_encode([
"quantity" => 4,
]),
"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/orders/goodsouts/1234567/lines/3450345/quantity', {
quantity: 4,
}, {
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/orders/goodsouts/1234567/lines/3450345/quantity",
body: {
"quantity": 4
},
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/orders/goodsouts/1234567/lines/3450345/quantity' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"quantity": 4
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 3450345,
"transaction_sku": "GREEN-BALL",
"quantity": 4,
"discount_type": "percentage",
"discount": 1.5,
"net_unit_principal": 12,
"status": "active"
}
}Cancel Order Line
PUT /v1/orders/goodsouts/:id/lines/:lineId/cancel
Cancel a order goodsout line.
Parameter Regular Expressions
- :id: [1-9][0-9]{0,}
- :lineId: [1-9][0-9]{0,}
Request Body
Return Type
Types for the Request Body
CancelGoodsoutLine (root level)
| Key | Description | Types | Restrictions |
|---|---|---|---|
reason | Reason for canceling the line. | string | requirednot nullmin length is 1max length is 250 |
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::ORDERS::MANAGE.
<?php
// Instantiate a GuzzleHttp client
$client = new \GuzzleHttp\Client();
// Make the request
$response = $client->request("PUT", "https://public-api.bladepro.io/v1/orders/goodsouts/1234567/lines/3450345/cancel", [
"body" => json_encode([
"reason" => "Item no longer wanted.",
]),
"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/orders/goodsouts/1234567/lines/3450345/cancel', {
reason: "Item no longer wanted.",
}, {
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/orders/goodsouts/1234567/lines/3450345/cancel",
body: {
"reason": "Item no longer wanted."
},
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/orders/goodsouts/1234567/lines/3450345/cancel' \
--header 'Content-Type: application/json' \
--header 'Access-Token: my-token-from-login' \
--data-raw '{
"reason": "Item no longer wanted."
}'Example result:
{
"meta": {
"request_reference": "235chjz9h-c893v86"
},
"data": {
"id": 3450345,
"transaction_sku": "GREEN-BALL",
"quantity": 4,
"discount_type": "percentage",
"discount": 1.5,
"net_unit_principal": 12,
"status": "active"
}
}