curl --request PUT \
--url https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sku": "<string>",
"barcode": "<string>",
"is_active": true,
"sort_order": 123
}
'import requests
url = "https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}"
payload = {
"sku": "<string>",
"barcode": "<string>",
"is_active": True,
"sort_order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sku: '<string>', barcode: '<string>', is_active: true, sort_order: 123})
};
fetch('https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sku' => '<string>',
'barcode' => '<string>',
'is_active' => true,
'sort_order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}"
payload := strings.NewReader("{\n \"sku\": \"<string>\",\n \"barcode\": \"<string>\",\n \"is_active\": true,\n \"sort_order\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sku\": \"<string>\",\n \"barcode\": \"<string>\",\n \"is_active\": true,\n \"sort_order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sku\": \"<string>\",\n \"barcode\": \"<string>\",\n \"is_active\": true,\n \"sort_order\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"stockable_id": "<string>",
"uom_unit_id": "<string>",
"sku": "<string>",
"barcode": "<string>",
"is_active": true,
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"uom_unit": {},
"prices": "<array>",
"stockable": {}
}{
"message": "<string>",
"errors": {}
}Change a unit of an item
Changes a unit of sale such as its SKU, barcode or order.
curl --request PUT \
--url https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sku": "<string>",
"barcode": "<string>",
"is_active": true,
"sort_order": 123
}
'import requests
url = "https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}"
payload = {
"sku": "<string>",
"barcode": "<string>",
"is_active": True,
"sort_order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({sku: '<string>', barcode: '<string>', is_active: true, sort_order: 123})
};
fetch('https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sku' => '<string>',
'barcode' => '<string>',
'is_active' => true,
'sort_order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}"
payload := strings.NewReader("{\n \"sku\": \"<string>\",\n \"barcode\": \"<string>\",\n \"is_active\": true,\n \"sort_order\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sku\": \"<string>\",\n \"barcode\": \"<string>\",\n \"is_active\": true,\n \"sort_order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/stockables/{stockable}/units/{unit}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sku\": \"<string>\",\n \"barcode\": \"<string>\",\n \"is_active\": true,\n \"sort_order\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"stockable_id": "<string>",
"uom_unit_id": "<string>",
"sku": "<string>",
"barcode": "<string>",
"is_active": true,
"sort_order": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"uom_unit": {},
"prices": "<array>",
"stockable": {}
}{
"message": "<string>",
"errors": {}
}variant_units.update, bundle_units.update
Conditions
- The permission depends on the type of item: variant_units.update or bundle_units.update.
- A sku or barcode sent must not be used by another unit of the organization; null is accepted for both. Empty values are not compared.
- Reactivating an inactive unit is refused when its measurement category differs from the one of the item.
- Reactivating a unit sets the item’s measurement category when it had none.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the sellable item (stockable): the stockable record of a product variant or of a bundle, not the variant or bundle identifier itself.
Identifier of the unit of measure (27-character KSUID).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, stockable_id, uom_unit_id, sku, barcode, is_active, sort_order, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: uomUnit, prices, stockable, stockable.vat_rate, stockable.taxes, stockable.subject.
Body
New SKU, up to 512 characters, unique within the organization. null is accepted; when omitted the stored SKU is kept.
512New barcode, up to 120 characters, unique within the organization when not null. Send null to clear it; when omitted the stored barcode is kept.
120Set false to deactivate the unit or true to reactivate it. Reactivation is refused when the unit's measurement category differs from the item's. When omitted, the state is kept.
Display position, integer of at least 0. When omitted, the stored position is kept.
Response
Resource (only with response=resource).
Identifier of the unit of sale (27-character KSUID string).
Identifier of the item the unit belongs to.
Identifier of the unit of measure (for example piece or box) this unit of sale uses.
Stock keeping unit code, unique within the organization. Generated as ITEM-UNIT-001 when not sent at creation.
Barcode of the unit, unique within the organization when set; null when none.
Whether the unit can be used for new prices and sales. A unit already used by orders is deactivated instead of deleted.
Display position of the unit; lower values come first. 0 when not sent at creation.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Unit of measure object. Only returned when selected with ?include=uomUnit.
Prices of this unit for the caller's company. Only returned when selected with ?include=prices.
The item the unit belongs to. Only returned when selected with ?include=stockable.