curl --request POST \
--url https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "<string>",
"quantity": 2,
"components": [
{
"stockable_id": "<string>",
"asset_id": "<string>",
"cost": 123
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach"
payload = {
"asset_id": "<string>",
"quantity": 2,
"components": [
{
"stockable_id": "<string>",
"asset_id": "<string>",
"cost": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
asset_id: '<string>',
quantity: 2,
components: [{stockable_id: '<string>', asset_id: '<string>', cost: 123}]
})
};
fetch('https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach', 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/bundles/{bundle}/detach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'asset_id' => '<string>',
'quantity' => 2,
'components' => [
[
'stockable_id' => '<string>',
'asset_id' => '<string>',
'cost' => 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/bundles/{bundle}/detach"
payload := strings.NewReader("{\n \"asset_id\": \"<string>\",\n \"quantity\": 2,\n \"components\": [\n {\n \"stockable_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"cost\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"<string>\",\n \"quantity\": 2,\n \"components\": [\n {\n \"stockable_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"cost\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_id\": \"<string>\",\n \"quantity\": 2,\n \"components\": [\n {\n \"stockable_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"cost\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bundle_id": "<string>",
"asset_id": "<string>",
"quantity_assembled": 123,
"quantity_disassembled": 123,
"component_deductions": "<array>",
"component_returns": "<array>"
}{
"message": "<string>",
"errors": {}
}Break bundles back into items
Takes assembled bundles out of stock at a location and returns their components to stock.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "<string>",
"quantity": 2,
"components": [
{
"stockable_id": "<string>",
"asset_id": "<string>",
"cost": 123
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach"
payload = {
"asset_id": "<string>",
"quantity": 2,
"components": [
{
"stockable_id": "<string>",
"asset_id": "<string>",
"cost": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
asset_id: '<string>',
quantity: 2,
components: [{stockable_id: '<string>', asset_id: '<string>', cost: 123}]
})
};
fetch('https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach', 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/bundles/{bundle}/detach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'asset_id' => '<string>',
'quantity' => 2,
'components' => [
[
'stockable_id' => '<string>',
'asset_id' => '<string>',
'cost' => 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/bundles/{bundle}/detach"
payload := strings.NewReader("{\n \"asset_id\": \"<string>\",\n \"quantity\": 2,\n \"components\": [\n {\n \"stockable_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"cost\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"<string>\",\n \"quantity\": 2,\n \"components\": [\n {\n \"stockable_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"cost\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/bundles/{bundle}/detach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"asset_id\": \"<string>\",\n \"quantity\": 2,\n \"components\": [\n {\n \"stockable_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"cost\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"bundle_id": "<string>",
"asset_id": "<string>",
"quantity_assembled": 123,
"quantity_disassembled": 123,
"component_deductions": "<array>",
"component_returns": "<array>"
}{
"message": "<string>",
"errors": {}
}bundles.detach
Conditions
- The bundle must not be archived.
- asset_id and each component asset_id must be locations of the organization.
- components must list exactly the bundle’s components, each once, with the location it returns to.
- The bundle must hold stock at asset_id; a shortfall is refused.
- Every component unit must be active.
- Each component cost, when sent, is in major units, at least 0, with at most the currency’s decimals; when omitted the returned stock is booked at cost 0.
- Withdraws the given quantity of bundles from stock at asset_id.
- Stocks the components back in at their listed locations (recipe quantity times the bundle quantity each), at the given cost, with the matching inventory movements and entries in the books.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the bundle (27-character KSUID string).
Body
Location holding the bundles to take apart. It must be a location of the organization and hold bundle stock.
Number of bundles to take apart, at least 1.
x >= 1One entry for each component of the bundle, no more and no fewer, telling where it is returned.
1Show child attributes
Show child attributes
Response
BundleStockOperationResource
Identifier of the bundle that was assembled or detached.
Location where the bundles were stocked in (assembly) or taken out (detach).
Number of bundles assembled. Null on a detach.
Number of bundles taken apart. Null on an assembly.
On an assembly, one entry per recipe component with stockable_id, stockable_unit_id, quantity_deducted (what was withdrawn, in the recipe unit; 0 for an untracked component) and base_quantity_deducted. Null on a detach.
On a detach, one entry per component with stockable_id, stockable_unit_id, quantity_returned and base_quantity_returned. Null on an assembly.