curl -X POST "https://api.playground.try.be/inventory/adjustments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"product_id": "5f8a1b2c-9d3e-4a5b-8c6d-7e8f9a0b1c2d",
"quantity": -3,
"reason_code": "waste",
"reason_description": "Damaged in transit — three units written off.",
"location_id": 12,
"site_id": "5dcb47800000000000000010"
}'
const response = await fetch('https://api.playground.try.be/inventory/adjustments', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
"product_id": "5f8a1b2c-9d3e-4a5b-8c6d-7e8f9a0b1c2d",
"quantity": -3,
"reason_code": "waste",
"reason_description": "Damaged in transit — three units written off.",
"location_id": 12,
"site_id": "5dcb47800000000000000010"
}),
})
if (!response.ok) {
throw new Error(`Trybe API ${response.status}: ${await response.text()}`)
}
const data = await response.json()
import httpx
response = httpx.post(
"https://api.playground.try.be/inventory/adjustments",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"product_id": "5f8a1b2c-9d3e-4a5b-8c6d-7e8f9a0b1c2d",
"quantity": -3,
"reason_code": "waste",
"reason_description": "Damaged in transit — three units written off.",
"location_id": 12,
"site_id": "5dcb47800000000000000010"
},
)
response.raise_for_status()
data = response.json()
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.playground.try.be/inventory/adjustments', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'product_id' => '5f8a1b2c-9d3e-4a5b-8c6d-7e8f9a0b1c2d',
'quantity' => -3,
'reason_code' => 'waste',
'reason_description' => 'Damaged in transit — three units written off.',
'location_id' => 12,
'site_id' => '5dcb47800000000000000010'
],
]);
$data = json_decode($response->getBody(), true);
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"product_id": "5f8a1b2c-9d3e-4a5b-8c6d-7e8f9a0b1c2d",
"quantity": -3,
"reason_code": "waste",
"reason_description": "Damaged in transit — three units written off.",
"location_id": 12,
"site_id": "5dcb47800000000000000010",
})
req, _ := http.NewRequest("POST", "https://api.playground.try.be/inventory/adjustments", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
}