curl -X PUT "https://api.playground.try.be/inventory/suppliers/00000000-0000-0000-0000-000000000000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Elemis",
"email": "orders@example.com",
"phone": "+44 20 8012 3456",
"address_1": "Unit E, Dominion Way",
"address_2": "Rustington",
"city": "Littlehampton",
"county": "West Sussex",
"country": "UK",
"postcode": "BN16 3HQ"
}'
const response = await fetch('https://api.playground.try.be/inventory/suppliers/00000000-0000-0000-0000-000000000000', {
method: 'PUT',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
"name": "Elemis",
"email": "orders@example.com",
"phone": "+44 20 8012 3456",
"address_1": "Unit E, Dominion Way",
"address_2": "Rustington",
"city": "Littlehampton",
"county": "West Sussex",
"country": "UK",
"postcode": "BN16 3HQ"
}),
})
if (!response.ok) {
throw new Error(`Trybe API ${response.status}: ${await response.text()}`)
}
const data = await response.json()
import httpx
response = httpx.put(
"https://api.playground.try.be/inventory/suppliers/00000000-0000-0000-0000-000000000000",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"name": "Elemis",
"email": "orders@example.com",
"phone": "+44 20 8012 3456",
"address_1": "Unit E, Dominion Way",
"address_2": "Rustington",
"city": "Littlehampton",
"county": "West Sussex",
"country": "UK",
"postcode": "BN16 3HQ"
},
)
response.raise_for_status()
data = response.json()
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.playground.try.be/inventory/suppliers/00000000-0000-0000-0000-000000000000', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Elemis',
'email' => 'orders@example.com',
'phone' => '+44 20 8012 3456',
'address_1' => 'Unit E, Dominion Way',
'address_2' => 'Rustington',
'city' => 'Littlehampton',
'county' => 'West Sussex',
'country' => 'UK',
'postcode' => 'BN16 3HQ'
],
]);
$data = json_decode($response->getBody(), true);
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"name": "Elemis",
"email": "orders@example.com",
"phone": "+44 20 8012 3456",
"address_1": "Unit E, Dominion Way",
"address_2": "Rustington",
"city": "Littlehampton",
"county": "West Sussex",
"country": "UK",
"postcode": "BN16 3HQ",
})
req, _ := http.NewRequest("PUT", "https://api.playground.try.be/inventory/suppliers/00000000-0000-0000-0000-000000000000", 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)
}