Create a new Rental Case
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");curl_easy_setopt(hnd, CURLOPT_URL, "https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case");
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, "{ \"status\": \"requested\", \"title\": \"Rent the printer.\", \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" } ], \"is_full_day\": false, \"issue_at\": \"2025-04-23T08:00:00+00:00\", \"due_at\": \"2025-04-23T10:00:00+00:00\", \"issue_date\": \"2025-04-23\", \"issue_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"due_date\": \"2025-04-23\", \"due_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"responsible_user_uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"renter\": { \"type\": \"plain\", \"value\": \"example\" }, \"comment\": \"The printer is running low on ink.\", \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ] }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"status\": \"requested\", \"title\": \"Rent the printer.\", \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" } ], \"is_full_day\": false, \"issue_at\": \"2025-04-23T08:00:00+00:00\", \"due_at\": \"2025-04-23T10:00:00+00:00\", \"issue_date\": \"2025-04-23\", \"issue_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"due_date\": \"2025-04-23\", \"due_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"responsible_user_uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"renter\": { \"type\": \"plain\", \"value\": \"example\" }, \"comment\": \"The printer is running low on ink.\", \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ] }") { 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/rental-management/rental-case"
payload := strings.NewReader("{ \"status\": \"requested\", \"title\": \"Rent the printer.\", \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" } ], \"is_full_day\": false, \"issue_at\": \"2025-04-23T08:00:00+00:00\", \"due_at\": \"2025-04-23T10:00:00+00:00\", \"issue_date\": \"2025-04-23\", \"issue_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"due_date\": \"2025-04-23\", \"due_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"responsible_user_uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"renter\": { \"type\": \"plain\", \"value\": \"example\" }, \"comment\": \"The printer is running low on ink.\", \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ] }")
req, _ := http.NewRequest("POST", 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/rental-management/rental-case")) .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("POST", HttpRequest.BodyPublishers.ofString("{ \"status\": \"requested\", \"title\": \"Rent the printer.\", \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" } ], \"is_full_day\": false, \"issue_at\": \"2025-04-23T08:00:00+00:00\", \"due_at\": \"2025-04-23T10:00:00+00:00\", \"issue_date\": \"2025-04-23\", \"issue_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"due_date\": \"2025-04-23\", \"due_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"responsible_user_uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"renter\": { \"type\": \"plain\", \"value\": \"example\" }, \"comment\": \"The printer is running low on ink.\", \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ] }")) .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, "{ \"status\": \"requested\", \"title\": \"Rent the printer.\", \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" } ], \"is_full_day\": false, \"issue_at\": \"2025-04-23T08:00:00+00:00\", \"due_at\": \"2025-04-23T10:00:00+00:00\", \"issue_date\": \"2025-04-23\", \"issue_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"due_date\": \"2025-04-23\", \"due_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"responsible_user_uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"renter\": { \"type\": \"plain\", \"value\": \"example\" }, \"comment\": \"The printer is running low on ink.\", \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ] }");Request request = new Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { status: 'requested', title: 'Rent the printer.', references: [{type: 'asset', uuid: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'}], is_full_day: false, issue_at: '2025-04-23T08:00:00+00:00', due_at: '2025-04-23T10:00:00+00:00', issue_date: '2025-04-23', issue_date_reminder: {unit: 'days', value: 2}, due_date: '2025-04-23', due_date_reminder: {unit: 'days', value: 2}, responsible_user_uuid: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', renter: {type: 'plain', value: 'example'}, comment: 'The printer is running low on ink.', attachments: ['7d8296ad-da7c-45f7-b676-9220b3a9d4dc'] }};
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/rental-management/rental-case';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"status":"requested","title":"Rent the printer.","references":[{"type":"asset","uuid":"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"}],"is_full_day":false,"issue_at":"2025-04-23T08:00:00+00:00","due_at":"2025-04-23T10:00:00+00:00","issue_date":"2025-04-23","issue_date_reminder":{"unit":"days","value":2},"due_date":"2025-04-23","due_date_reminder":{"unit":"days","value":2},"responsible_user_uuid":"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11","renter":{"type":"plain","value":"example"},"comment":"The printer is running low on ink.","attachments":["7d8296ad-da7c-45f7-b676-9220b3a9d4dc"]}'};
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, "{ \"status\": \"requested\", \"title\": \"Rent the printer.\", \"references\": [ { \"type\": \"asset\", \"uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\" } ], \"is_full_day\": false, \"issue_at\": \"2025-04-23T08:00:00+00:00\", \"due_at\": \"2025-04-23T10:00:00+00:00\", \"issue_date\": \"2025-04-23\", \"issue_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"due_date\": \"2025-04-23\", \"due_date_reminder\": { \"unit\": \"days\", \"value\": 2 }, \"responsible_user_uuid\": \"a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11\", \"renter\": { \"type\": \"plain\", \"value\": \"example\" }, \"comment\": \"The printer is running low on ink.\", \"attachments\": [ \"7d8296ad-da7c-45f7-b676-9220b3a9d4dc\" ] }")val request = Request.Builder() .url("https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case";
let payload = json!({ "status": "requested", "title": "Rent the printer.", "references": ( json!({ "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" }) ), "is_full_day": false, "issue_at": "2025-04-23T08:00:00+00:00", "due_at": "2025-04-23T10:00:00+00:00", "issue_date": "2025-04-23", "issue_date_reminder": json!({ "unit": "days", "value": 2 }), "due_date": "2025-04-23", "due_date_reminder": json!({ "unit": "days", "value": 2 }), "responsible_user_uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "renter": json!({ "type": "plain", "value": "example" }), "comment": "The printer is running low on ink.", "attachments": ("7d8296ad-da7c-45f7-b676-9220b3a9d4dc") });
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.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-case \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "status": "requested", "title": "Rent the printer.", "references": [ { "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" } ], "is_full_day": false, "issue_at": "2025-04-23T08:00:00+00:00", "due_at": "2025-04-23T10:00:00+00:00", "issue_date": "2025-04-23", "issue_date_reminder": { "unit": "days", "value": 2 }, "due_date": "2025-04-23", "due_date_reminder": { "unit": "days", "value": 2 }, "responsible_user_uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "renter": { "type": "plain", "value": "example" }, "comment": "The printer is running low on ink.", "attachments": [ "7d8296ad-da7c-45f7-b676-9220b3a9d4dc" ] }'wget --quiet \ --method POST \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "status": "requested", "title": "Rent the printer.", "references": [ { "type": "asset", "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" } ], "is_full_day": false, "issue_at": "2025-04-23T08:00:00+00:00", "due_at": "2025-04-23T10:00:00+00:00", "issue_date": "2025-04-23", "issue_date_reminder": { "unit": "days", "value": 2 }, "due_date": "2025-04-23", "due_date_reminder": { "unit": "days", "value": 2 }, "responsible_user_uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", "renter": { "type": "plain", "value": "example" }, "comment": "The printer is running low on ink.", "attachments": [ "7d8296ad-da7c-45f7-b676-9220b3a9d4dc" ] }' \ --output-document \ - https://your-instance.seventhings.com/customer-api/v1/rental-management/rental-caseCreate a new Rental Case.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Rental Case to be created
The payload for creating a new rental case.
object
The status of the rental case.
The title of the rental case.
Example
Rent the printer.The reference of the rental case.
object
The type of the referenced object.
Example
assetThe UUID of the referenced object.
Example
a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11Display name of the referenced object.
Example
Asset name (asset barcode)The id of the referenced object.
Example
1true reserves whole days in UTC from issue_date to due_date. false reserves from issue_at to due_at. If omitted, issue_at and due_at decide: with both given the rental case has times, without them an update keeps the kind and times of the stored rental case and moves its times to the given dates, and a new rental case is full-day.
Example
falseThe pickup time, required for a rental case with times and ignored for a full-day one. Any offset is accepted and stored as UTC; issue_date is then derived from it.
Example
2025-04-23T08:00:00+00:00The return time, required for a rental case with times and ignored for a full-day one. It is exclusive, so another rental case of the same object may start at this time. due_date is derived from it.
Example
2025-04-23T10:00:00+00:00The start of the rental case.
Example
2025-04-23The lead time before the pickup date at which a reminder is sent. null means that no reminder is sent, the value 0 reminds on the pickup date itself.
object
The unit of the time interval.
Example
weeksThe value of the time interval.
Example
2The start of the rental case.
Example
2025-04-23The lead time before the return date at which a reminder is sent. null means that no reminder is sent, the value 0 reminds on the return date itself.
object
The unit of the time interval.
Example
weeksThe value of the time interval.
Example
2The uuid of the responsible user.
Example
a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11The renter.
object
The type of the renter.
Example
plainThe value of the renter. In case of a user the uuid is given.
A comment that is displayed in the rental case details.
Example
The printer is running low on ink.Responses
Section titled “Responses”Success
Headers
Section titled “Headers”Location of the newly created Rental Case
The UUID of the newly created object.
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.
Internal Server Error.

