Grade items
curl --request POST \
--url https://api.treet-test.co/v1/items/grade \
--header 'Content-Type: application/json' \
--header 'X-Treet-Authentication-Key: <api-key>' \
--header 'X-Treet-Client-Id: <api-key>' \
--data '
{
"items": [
{
"id": "c7383262-e266-4b97-a957-40caa69b6a56",
"condition": "GOOD",
"notes": "Loose thread on button",
"images": [
{
"url": "https://example.com/image1.jpg",
"notes": "Front view of the item, see loose thread"
},
{
"url": "https://example.com/image2.jpg"
}
]
}
]
}
'import requests
url = "https://api.treet-test.co/v1/items/grade"
payload = { "items": [
{
"id": "c7383262-e266-4b97-a957-40caa69b6a56",
"condition": "GOOD",
"notes": "Loose thread on button",
"images": [{
"url": "https://example.com/image1.jpg",
"notes": "Front view of the item, see loose thread"
}, { "url": "https://example.com/image2.jpg" }]
}
] }
headers = {
"X-Treet-Client-Id": "<api-key>",
"X-Treet-Authentication-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Treet-Client-Id': '<api-key>',
'X-Treet-Authentication-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
id: 'c7383262-e266-4b97-a957-40caa69b6a56',
condition: 'GOOD',
notes: 'Loose thread on button',
images: [
{
url: 'https://example.com/image1.jpg',
notes: 'Front view of the item, see loose thread'
},
{url: 'https://example.com/image2.jpg'}
]
}
]
})
};
fetch('https://api.treet-test.co/v1/items/grade', 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.treet-test.co/v1/items/grade",
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([
'items' => [
[
'id' => 'c7383262-e266-4b97-a957-40caa69b6a56',
'condition' => 'GOOD',
'notes' => 'Loose thread on button',
'images' => [
[
'url' => 'https://example.com/image1.jpg',
'notes' => 'Front view of the item, see loose thread'
],
[
'url' => 'https://example.com/image2.jpg'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Treet-Authentication-Key: <api-key>",
"X-Treet-Client-Id: <api-key>"
],
]);
$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.treet-test.co/v1/items/grade"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"c7383262-e266-4b97-a957-40caa69b6a56\",\n \"condition\": \"GOOD\",\n \"notes\": \"Loose thread on button\",\n \"images\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"notes\": \"Front view of the item, see loose thread\"\n },\n {\n \"url\": \"https://example.com/image2.jpg\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Treet-Client-Id", "<api-key>")
req.Header.Add("X-Treet-Authentication-Key", "<api-key>")
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.treet-test.co/v1/items/grade")
.header("X-Treet-Client-Id", "<api-key>")
.header("X-Treet-Authentication-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"id\": \"c7383262-e266-4b97-a957-40caa69b6a56\",\n \"condition\": \"GOOD\",\n \"notes\": \"Loose thread on button\",\n \"images\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"notes\": \"Front view of the item, see loose thread\"\n },\n {\n \"url\": \"https://example.com/image2.jpg\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treet-test.co/v1/items/grade")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Treet-Client-Id"] = '<api-key>'
request["X-Treet-Authentication-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"id\": \"c7383262-e266-4b97-a957-40caa69b6a56\",\n \"condition\": \"GOOD\",\n \"notes\": \"Loose thread on button\",\n \"images\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"notes\": \"Front view of the item, see loose thread\"\n },\n {\n \"url\": \"https://example.com/image2.jpg\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "c7383262-e266-4b97-a957-40caa69b6a56",
"condition": "GOOD",
"notes": "Loose thread on button",
"images": [
{
"url": "<string>",
"notes": "<string>"
}
]
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Grade Items API
Grade Items
Endpoint to grade items with specified conditions and notes.
All items sent in a single request should be part of the same shipment.
All items in a single request should be distinct.
POST
/
v1
/
items
/
grade
Grade items
curl --request POST \
--url https://api.treet-test.co/v1/items/grade \
--header 'Content-Type: application/json' \
--header 'X-Treet-Authentication-Key: <api-key>' \
--header 'X-Treet-Client-Id: <api-key>' \
--data '
{
"items": [
{
"id": "c7383262-e266-4b97-a957-40caa69b6a56",
"condition": "GOOD",
"notes": "Loose thread on button",
"images": [
{
"url": "https://example.com/image1.jpg",
"notes": "Front view of the item, see loose thread"
},
{
"url": "https://example.com/image2.jpg"
}
]
}
]
}
'import requests
url = "https://api.treet-test.co/v1/items/grade"
payload = { "items": [
{
"id": "c7383262-e266-4b97-a957-40caa69b6a56",
"condition": "GOOD",
"notes": "Loose thread on button",
"images": [{
"url": "https://example.com/image1.jpg",
"notes": "Front view of the item, see loose thread"
}, { "url": "https://example.com/image2.jpg" }]
}
] }
headers = {
"X-Treet-Client-Id": "<api-key>",
"X-Treet-Authentication-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Treet-Client-Id': '<api-key>',
'X-Treet-Authentication-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [
{
id: 'c7383262-e266-4b97-a957-40caa69b6a56',
condition: 'GOOD',
notes: 'Loose thread on button',
images: [
{
url: 'https://example.com/image1.jpg',
notes: 'Front view of the item, see loose thread'
},
{url: 'https://example.com/image2.jpg'}
]
}
]
})
};
fetch('https://api.treet-test.co/v1/items/grade', 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.treet-test.co/v1/items/grade",
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([
'items' => [
[
'id' => 'c7383262-e266-4b97-a957-40caa69b6a56',
'condition' => 'GOOD',
'notes' => 'Loose thread on button',
'images' => [
[
'url' => 'https://example.com/image1.jpg',
'notes' => 'Front view of the item, see loose thread'
],
[
'url' => 'https://example.com/image2.jpg'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Treet-Authentication-Key: <api-key>",
"X-Treet-Client-Id: <api-key>"
],
]);
$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.treet-test.co/v1/items/grade"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"c7383262-e266-4b97-a957-40caa69b6a56\",\n \"condition\": \"GOOD\",\n \"notes\": \"Loose thread on button\",\n \"images\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"notes\": \"Front view of the item, see loose thread\"\n },\n {\n \"url\": \"https://example.com/image2.jpg\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Treet-Client-Id", "<api-key>")
req.Header.Add("X-Treet-Authentication-Key", "<api-key>")
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.treet-test.co/v1/items/grade")
.header("X-Treet-Client-Id", "<api-key>")
.header("X-Treet-Authentication-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"id\": \"c7383262-e266-4b97-a957-40caa69b6a56\",\n \"condition\": \"GOOD\",\n \"notes\": \"Loose thread on button\",\n \"images\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"notes\": \"Front view of the item, see loose thread\"\n },\n {\n \"url\": \"https://example.com/image2.jpg\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treet-test.co/v1/items/grade")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Treet-Client-Id"] = '<api-key>'
request["X-Treet-Authentication-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"id\": \"c7383262-e266-4b97-a957-40caa69b6a56\",\n \"condition\": \"GOOD\",\n \"notes\": \"Loose thread on button\",\n \"images\": [\n {\n \"url\": \"https://example.com/image1.jpg\",\n \"notes\": \"Front view of the item, see loose thread\"\n },\n {\n \"url\": \"https://example.com/image2.jpg\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "c7383262-e266-4b97-a957-40caa69b6a56",
"condition": "GOOD",
"notes": "Loose thread on button",
"images": [
{
"url": "<string>",
"notes": "<string>"
}
]
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Body
application/json
List of Treet items to condition grade
Minimum array length:
1Show child attributes
Show child attributes
Response
Grade Items response
Minimum array length:
1Show child attributes
Show child attributes
⌘I

