Update one order.
PATCH
/customer-api/v1/circularity-hub/order/{identifier}
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");curl_easy_setopt(hnd, CURLOPT_URL, "https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Authorization: Bearer <token>");headers = curl_slist_append(headers, "Content-Type: application/json");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Patch, RequestUri = new Uri("https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1"
payload := strings.NewReader("{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }")
req, _ := http.NewRequest("PATCH", 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(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1")) .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PATCH", HttpRequest.BodyPublishers.ofString("{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }");Request request = new Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1") .patch(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'PATCH', url: 'https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { completed: true, cancelled: true, cancellation_reason: 'Item could not be found any more' }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"completed":true,"cancelled":true,"cancellation_reason":"Item could not be found any more"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }")val request = Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1") .patch(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PATCH", CURLOPT_POSTFIELDS => json_encode([ 'completed' => null, 'cancelled' => null, 'cancellation_reason' => 'Item could not be found any more' ]), 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;}<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1', [ 'body' => '{ "completed": true, "cancelled": true, "cancellation_reason": "Item could not be found any more" }', 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json', ],]);
echo $response->getBody();import http.client
conn = http.client.HTTPSConnection("your-instance.seventhings.com")
payload = "{ \"completed\": true, \"cancelled\": true, \"cancellation_reason\": \"Item could not be found any more\" }"
headers = { 'Authorization': "Bearer <token>", 'Content-Type': "application/json"}
conn.request("PATCH", "/customer-api/v1/circularity-hub/order/1", payload, headers)
res = conn.getresponse()data = res.read()
print(data.decode("utf-8"))import requests
url = "https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1"
payload = { "completed": True, "cancelled": True, "cancellation_reason": "Item could not be found any more"}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1";
let payload = json!({ "completed": true, "cancelled": true, "cancellation_reason": "Item could not be found any more" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PATCH \ --url https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "completed": true, "cancelled": true, "cancellation_reason": "Item could not be found any more" }'wget --quiet \ --method PATCH \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "completed": true, "cancelled": true, "cancellation_reason": "Item could not be found any more" }' \ --output-document \ - https://your-instance.seventhings.com/customer-api/v1/circularity-hub/order/1Update one order.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”identifier
required
integer
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
key
additional properties
any
Example
{ "completed": true, "cancelled": true, "cancellation_reason": "Item could not be found any more"}Responses
Section titled “Responses”Success
Request body is missing or invalid or request data is invalid.
Access token is missing or invalid.
You are not permitted to perform the requested operation.
The requested resource could not be found.
The requested resource representation has no acceptable format.
The requested entry is not processable.
Internal Server Error.

