Suppliers
Update a supplier
PUT
/
api
/
v1
/
suppliers
/
{id}
Update a supplier
curl --request PUT \
--url https://sherpa-topaz.vercel.app/api/v1/suppliers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"category": "<string>",
"terms": "<string>",
"paymentMethod": "<string>",
"supplierGroup": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>"
},
"addresses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isDefault": true,
"isBillTo": true,
"isShipTo": true
}
],
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"title": "<string>",
"email": "<string>",
"phone": "<string>",
"isDefault": true
}
]
}
}
'import requests
url = "https://sherpa-topaz.vercel.app/api/v1/suppliers/{id}"
payload = { "data": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"category": "<string>",
"terms": "<string>",
"paymentMethod": "<string>",
"supplierGroup": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>"
},
"addresses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isDefault": True,
"isBillTo": True,
"isShipTo": True
}
],
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"title": "<string>",
"email": "<string>",
"phone": "<string>",
"isDefault": True
}
]
} }
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({
data: {
name: '<string>',
email: '<string>',
phone: '<string>',
category: '<string>',
terms: '<string>',
paymentMethod: '<string>',
supplierGroup: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', code: '<string>', name: '<string>'},
addresses: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: '<string>',
label: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>',
isDefault: true,
isBillTo: true,
isShipTo: true
}
],
contacts: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
title: '<string>',
email: '<string>',
phone: '<string>',
isDefault: true
}
]
}
})
};
fetch('https://sherpa-topaz.vercel.app/api/v1/suppliers/{id}', 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://sherpa-topaz.vercel.app/api/v1/suppliers/{id}",
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([
'data' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'category' => '<string>',
'terms' => '<string>',
'paymentMethod' => '<string>',
'supplierGroup' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'code' => '<string>',
'name' => '<string>'
],
'addresses' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => '<string>',
'label' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>',
'isDefault' => true,
'isBillTo' => true,
'isShipTo' => true
]
],
'contacts' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'title' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'isDefault' => true
]
]
]
]),
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://sherpa-topaz.vercel.app/api/v1/suppliers/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"category\": \"<string>\",\n \"terms\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"supplierGroup\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"addresses\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isDefault\": true,\n \"isBillTo\": true,\n \"isShipTo\": true\n }\n ],\n \"contacts\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"isDefault\": true\n }\n ]\n }\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://sherpa-topaz.vercel.app/api/v1/suppliers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"category\": \"<string>\",\n \"terms\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"supplierGroup\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"addresses\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isDefault\": true,\n \"isBillTo\": true,\n \"isShipTo\": true\n }\n ],\n \"contacts\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"isDefault\": true\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sherpa-topaz.vercel.app/api/v1/suppliers/{id}")
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 \"data\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"category\": \"<string>\",\n \"terms\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"supplierGroup\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"addresses\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isDefault\": true,\n \"isBillTo\": true,\n \"isShipTo\": true\n }\n ],\n \"contacts\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"isDefault\": true\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"supplierNumber": "<string>",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"category": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"terms": "<string>",
"supplierGroup": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>"
},
"paymentMethod": "<string>",
"addresses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isDefault": true,
"isBillTo": true,
"isShipTo": true
}
],
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"title": "<string>",
"email": "<string>",
"phone": "<string>",
"isDefault": true
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Create or update payload inside { data }. Server-owned id, supplierNumber,
timestamps, and child ids are ignored. On PUT, omitted header fields keep their
current values. Omitted addresses and contacts are left unchanged; send []
to clear.
Show child attributes
Show child attributes
Response
Updated supplier (same shape as GET)
Show child attributes
Show child attributes
⌘I
Update a supplier
curl --request PUT \
--url https://sherpa-topaz.vercel.app/api/v1/suppliers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"category": "<string>",
"terms": "<string>",
"paymentMethod": "<string>",
"supplierGroup": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>"
},
"addresses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isDefault": true,
"isBillTo": true,
"isShipTo": true
}
],
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"title": "<string>",
"email": "<string>",
"phone": "<string>",
"isDefault": true
}
]
}
}
'import requests
url = "https://sherpa-topaz.vercel.app/api/v1/suppliers/{id}"
payload = { "data": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"category": "<string>",
"terms": "<string>",
"paymentMethod": "<string>",
"supplierGroup": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>"
},
"addresses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isDefault": True,
"isBillTo": True,
"isShipTo": True
}
],
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"title": "<string>",
"email": "<string>",
"phone": "<string>",
"isDefault": True
}
]
} }
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({
data: {
name: '<string>',
email: '<string>',
phone: '<string>',
category: '<string>',
terms: '<string>',
paymentMethod: '<string>',
supplierGroup: {id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', code: '<string>', name: '<string>'},
addresses: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: '<string>',
label: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>',
isDefault: true,
isBillTo: true,
isShipTo: true
}
],
contacts: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
title: '<string>',
email: '<string>',
phone: '<string>',
isDefault: true
}
]
}
})
};
fetch('https://sherpa-topaz.vercel.app/api/v1/suppliers/{id}', 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://sherpa-topaz.vercel.app/api/v1/suppliers/{id}",
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([
'data' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'category' => '<string>',
'terms' => '<string>',
'paymentMethod' => '<string>',
'supplierGroup' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'code' => '<string>',
'name' => '<string>'
],
'addresses' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => '<string>',
'label' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>',
'isDefault' => true,
'isBillTo' => true,
'isShipTo' => true
]
],
'contacts' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'title' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'isDefault' => true
]
]
]
]),
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://sherpa-topaz.vercel.app/api/v1/suppliers/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"category\": \"<string>\",\n \"terms\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"supplierGroup\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"addresses\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isDefault\": true,\n \"isBillTo\": true,\n \"isShipTo\": true\n }\n ],\n \"contacts\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"isDefault\": true\n }\n ]\n }\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://sherpa-topaz.vercel.app/api/v1/suppliers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"category\": \"<string>\",\n \"terms\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"supplierGroup\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"addresses\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isDefault\": true,\n \"isBillTo\": true,\n \"isShipTo\": true\n }\n ],\n \"contacts\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"isDefault\": true\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sherpa-topaz.vercel.app/api/v1/suppliers/{id}")
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 \"data\": {\n \"name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"category\": \"<string>\",\n \"terms\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"supplierGroup\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"addresses\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"<string>\",\n \"label\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isDefault\": true,\n \"isBillTo\": true,\n \"isShipTo\": true\n }\n ],\n \"contacts\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"title\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"isDefault\": true\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"supplierNumber": "<string>",
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"category": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"terms": "<string>",
"supplierGroup": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "<string>",
"name": "<string>"
},
"paymentMethod": "<string>",
"addresses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"label": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isDefault": true,
"isBillTo": true,
"isShipTo": true
}
],
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"title": "<string>",
"email": "<string>",
"phone": "<string>",
"isDefault": true
}
]
}
}
