Maintenance
Create maintenance record
Open a maintenance record against a truck or trailer, with category, repair shop, vendor, cost, odometer and reminders, safely retryable with ExternalId.
POST
/
api
/
p
/
v
{version}
/
maintenance
Create maintenance record
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/maintenance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Asset": {
"AssetId": "<string>",
"AssetType": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Status": "<string>",
"Date": "2023-11-07T05:31:56Z",
"Description": "<string>",
"Comments": "<string>",
"Amount": 123,
"PO": "<string>",
"Reference": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"OdometerReading": 123,
"WorkPerformed": "<string>",
"Reminders": [
{
"DueDate": "2023-11-07T05:31:56Z"
}
],
"ExternalId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
Asset: {AssetId: '<string>', AssetType: '<string>'},
Category: {Id: '<string>', Name: '<string>'},
Status: '<string>',
Date: '2023-11-07T05:31:56Z',
Description: '<string>',
Comments: '<string>',
Amount: 123,
PO: '<string>',
Reference: '<string>',
RepairShop: {Id: '<string>', Name: '<string>'},
Vendor: {Id: '<string>', Name: '<string>'},
OdometerReading: 123,
WorkPerformed: '<string>',
Reminders: [{DueDate: '2023-11-07T05:31:56Z'}],
ExternalId: '<string>'
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/maintenance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/maintenance"
payload = {
"Asset": {
"AssetId": "<string>",
"AssetType": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Status": "<string>",
"Date": "2023-11-07T05:31:56Z",
"Description": "<string>",
"Comments": "<string>",
"Amount": 123,
"PO": "<string>",
"Reference": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"OdometerReading": 123,
"WorkPerformed": "<string>",
"Reminders": [{ "DueDate": "2023-11-07T05:31:56Z" }],
"ExternalId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/maintenance",
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([
'Asset' => [
'AssetId' => '<string>',
'AssetType' => '<string>'
],
'Category' => [
'Id' => '<string>',
'Name' => '<string>'
],
'Status' => '<string>',
'Date' => '2023-11-07T05:31:56Z',
'Description' => '<string>',
'Comments' => '<string>',
'Amount' => 123,
'PO' => '<string>',
'Reference' => '<string>',
'RepairShop' => [
'Id' => '<string>',
'Name' => '<string>'
],
'Vendor' => [
'Id' => '<string>',
'Name' => '<string>'
],
'OdometerReading' => 123,
'WorkPerformed' => '<string>',
'Reminders' => [
[
'DueDate' => '2023-11-07T05:31:56Z'
]
],
'ExternalId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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://integrations.alvys.com/api/p/v{version}/maintenance"
payload := strings.NewReader("{\n \"Asset\": {\n \"AssetId\": \"<string>\",\n \"AssetType\": \"<string>\"\n },\n \"Category\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Status\": \"<string>\",\n \"Date\": \"2023-11-07T05:31:56Z\",\n \"Description\": \"<string>\",\n \"Comments\": \"<string>\",\n \"Amount\": 123,\n \"PO\": \"<string>\",\n \"Reference\": \"<string>\",\n \"RepairShop\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Vendor\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"OdometerReading\": 123,\n \"WorkPerformed\": \"<string>\",\n \"Reminders\": [\n {\n \"DueDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"ExternalId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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://integrations.alvys.com/api/p/v{version}/maintenance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Asset\": {\n \"AssetId\": \"<string>\",\n \"AssetType\": \"<string>\"\n },\n \"Category\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Status\": \"<string>\",\n \"Date\": \"2023-11-07T05:31:56Z\",\n \"Description\": \"<string>\",\n \"Comments\": \"<string>\",\n \"Amount\": 123,\n \"PO\": \"<string>\",\n \"Reference\": \"<string>\",\n \"RepairShop\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Vendor\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"OdometerReading\": 123,\n \"WorkPerformed\": \"<string>\",\n \"Reminders\": [\n {\n \"DueDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"ExternalId\": \"<string>\"\n}")
.asString();{
"Id": "<string>",
"RelatedAsset": {
"AssetId": "<string>",
"AssetType": "<string>",
"AssetNumber": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Amount": {
"Amount": 123,
"Currency": 123
},
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"Status": "<string>",
"OdometerReading": 123,
"IsDeducted": true,
"PO": "<string>",
"Reference": "<string>",
"Description": "<string>",
"Comments": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Reminders": [
{
"id": "<string>",
"DueDate": "2023-11-07T05:31:56Z"
}
],
"ModifiedAt": "2023-11-07T05:31:56Z",
"ModifiedBy": "<string>",
"RecordNumber": "<string>",
"Date": "2023-11-07T05:31:56Z",
"WorkPerformed": "<string>",
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"ExternalId": "<string>"
}{
"Id": "<string>",
"RelatedAsset": {
"AssetId": "<string>",
"AssetType": "<string>",
"AssetNumber": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Amount": {
"Amount": 123,
"Currency": 123
},
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"Status": "<string>",
"OdometerReading": 123,
"IsDeducted": true,
"PO": "<string>",
"Reference": "<string>",
"Description": "<string>",
"Comments": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Reminders": [
{
"id": "<string>",
"DueDate": "2023-11-07T05:31:56Z"
}
],
"ModifiedAt": "2023-11-07T05:31:56Z",
"ModifiedBy": "<string>",
"RecordNumber": "<string>",
"Date": "2023-11-07T05:31:56Z",
"WorkPerformed": "<string>",
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"ExternalId": "<string>"
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}The Create Maintenance Record endpoint opens a maintenance record against one of your trucks or trailers, for example a PM service or a repair invoice from your shop system. On success it returns the new record and its optimistic-concurrency token in the
To attach the invoice or another file to the record, use Upload maintenance document with the
Replace
The example shows a subset of the response fields.
ETag response header. Send that value in the If-Match header of a later Update maintenance record request. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
This endpoint requires the
maintenance:create scope. See Authentication.Id this endpoint returns.
Asset
Asset.AssetId is the Alvys id of the truck or trailer, as returned by Search trucks or Search trailers. Asset.AssetType is Truck or Trailer (case-insensitive). The asset cannot be changed after the record is created.
If the asset does not exist in your account, or it belongs to a subsidiary your credential cannot access, the request is rejected with 404 Not Found.
Category, repair shop and vendor
Category, RepairShop and Vendor are resolved by Name. A name that already exists in your maintenance lists is reused. A name that does not exist yet is added, the same way typing a new value in the Alvys maintenance form adds it. The response returns the Id and Name the value was saved under.
You may send back the Id you received in a response, but it is not used to look anything up: always send Name with it. An Id without a Name is rejected with 400 Bad Request.
Retry safely with ExternalId
ExternalId is your own unique id for the record, such as your work order or invoice number. Send the same value when you retry a request, for example after a timeout. If a record with that ExternalId already exists, it is returned with 200 OK and no second record is created. Without ExternalId, a retry creates another record.
- Matching ignores case and surrounding spaces.
- The check protects a retry that follows the first request. Two requests with the same
ExternalIdsent at exactly the same time can both create a record. - If the existing record with that
ExternalIdbelongs to an asset your credential cannot access, the request is rejected with404 Not Found.
Driver deductions
A record created through this endpoint is never linked to a driver settlement deduction, so creating one does not change any driver’s pay.IsDeducted is false on the response. A deduction can still be linked to the record later in Alvys.
Request parameters
The following parameter is required in the URL path:| Parameter | Type | Required | Description |
|---|---|---|---|
| version | String | Yes | The version of the API. |
Request body
OnlyAsset and Category are required.
| Field | Type | Required | Description |
|---|---|---|---|
| Asset | Object | Yes | The truck or trailer the record belongs to. See Asset. |
| Asset.AssetId | String | Yes | The Alvys id of the truck or trailer. |
| Asset.AssetType | String | Yes | Truck or Trailer (case-insensitive). |
| Category | Object | Yes | The kind of work, for example PM Service. See Category, repair shop and vendor. |
| Category.Name | String | Yes | The category name. Up to 200 characters. |
| Category.Id | String | No | The category id from a previous response. Not used to look anything up. |
| Status | String | No | One of Urgent, Open, Closed (case-insensitive). Defaults to Open. |
| Date | String (Date-Time) | No | When the work was done or is scheduled. |
| Description | String | No | A short summary of the work. Up to 500 characters. |
| Comments | String | No | Free-form notes. Up to 2,000 characters. |
| Amount | Number | No | The total cost in USD. Cannot be negative. Defaults to 0. |
| PO | String | No | The purchase order number. Up to 100 characters. |
| Reference | String | No | Your reference number, for example an invoice or work order number. Up to 100 characters. |
| RepairShop | Object | No | Where the work is done, with Name (up to 200 characters) and an optional Id, as in Category. |
| Vendor | Object | No | Who bills for the work, with Name (up to 200 characters) and an optional Id, as in Category. |
| OdometerReading | Number | No | The odometer of the asset at the time of service, in miles. Cannot be negative. Defaults to 0. |
| WorkPerformed | String | No | A longer description of the work done. Up to 2,000 characters. |
| Reminders | Array | No | Follow-up dates shown on the record. Up to 25. |
| Reminders.DueDate | String (Date-Time) | Yes | When the reminder is due. |
| ExternalId | String | No | Your own unique id for the record, used to make retries safe. Up to 100 characters. See Retry safely with ExternalId. |
Example cURL request
curl --location 'https://integrations.alvys.com/api/p/v1/maintenance' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"Asset": { "AssetId": "TR1000000000000417", "AssetType": "Truck" },
"Category": { "Name": "PM Service" },
"Status": "Closed",
"Date": "2026-11-24T14:00:00Z",
"Description": "A-service and oil change",
"Amount": 412.75,
"PO": "PO-88213",
"Reference": "WO-55120",
"RepairShop": { "Name": "Rocket Repairs" },
"Vendor": { "Name": "Rocket Repairs" },
"OdometerReading": 412880,
"WorkPerformed": "Changed engine oil and filters, greased chassis, inspected brakes.",
"Reminders": [{ "DueDate": "2027-02-24T00:00:00Z" }],
"ExternalId": "WO-55120"
}'
YOUR_ACCESS_TOKEN with your actual Bearer token.
Response fields
A successful request returns the maintenance record. The record’s currentETag is in the ETag response header.
| Field | Type | Description |
|---|---|---|
| Id | String | The unique identifier of the maintenance record. |
| RecordNumber | String | The record number Alvys assigned. Unique within your account. |
| ExternalId | String | The ExternalId you sent, if any. |
| Status | String | Urgent, Open or Closed. |
| Date | String (Date-Time) | When the work was done or is scheduled. |
| RelatedAsset | Object | The truck or trailer, with AssetId, AssetNumber and AssetType. |
| Category | Object | The category, with Id and Name. |
| RepairShop | Object | The repair shop, with Id and Name. |
| Vendor | Object | The vendor, with Id and Name. |
| Description | String | The short summary of the work. |
| Comments | String | Free-form notes. |
| WorkPerformed | String | The longer description of the work done. |
| Amount | Object | The total cost, with Amount and Currency. |
| PO | String | The purchase order number. |
| Reference | String | Your reference number. |
| OdometerReading | Number | The odometer reading in miles. |
| Reminders | Array | The reminders, each with id and DueDate. |
| IsDeducted | Boolean | Whether the record is linked to a driver settlement deduction. Always false on a new record. |
| CreatedAt | String (Date-Time) | When the record was created. |
| CreatedBy | String | Who created the record. |
| ModifiedAt | String (Date-Time) | When the record was last changed. |
| ModifiedBy | String | Who last changed the record. |
Example response
201 Created{
"Id": "4b0e6a52-0000-0000-0000-000000000417",
"RecordNumber": "1042",
"ExternalId": "WO-55120",
"Status": "Closed",
"Date": "2026-11-24T14:00:00+00:00",
"RelatedAsset": { "AssetId": "TR1000000000000417", "AssetNumber": "T-417", "AssetType": "Truck" },
"Category": { "Id": "118", "Name": "PM Service" },
"RepairShop": { "Id": "204", "Name": "Rocket Repairs" },
"Vendor": { "Id": "311", "Name": "Rocket Repairs" },
"Description": "A-service and oil change",
"WorkPerformed": "Changed engine oil and filters, greased chassis, inspected brakes.",
"Amount": { "Amount": 412.75 },
"PO": "PO-88213",
"Reference": "WO-55120",
"OdometerReading": 412880,
"Reminders": [{ "id": "9f4d2c1a-0000-0000-0000-000000000001", "DueDate": "2027-02-24T00:00:00+00:00" }],
"IsDeducted": false,
"CreatedAt": "2026-11-30T15:04:05.000Z"
}
Status codes
| Status | Meaning |
|---|---|
| 201 | The record was created. |
| 200 | A record with this ExternalId already existed. It is returned and nothing new was created. |
| 400 | The request body failed validation. The response lists the invalid fields. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks the maintenance:create scope. |
| 404 | The asset does not exist in your account or is outside the subsidiaries your credential can access. |
| 409 | The record clashed with one saved at the same moment and was not created. Retry the request, with an ExternalId so a retry is safe. |
| 429 | The rate limit was exceeded. |
Rate limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the Rate Limits section. This page is interactive, allowing you to try a request by completing the fields for the parameters below. As you fill out the parameters, the cURL command on the right side of the page will be automatically updated.Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Response
OK
Per-tenant sequence number, server-assigned and not writable. Unique within your tenant, so it is safe to reconcile against: a simultaneous create cannot take the same number. NOT guaranteed gapless or strictly increasing - a losing race burns a number and a deleted record leaves its number behind, so treat it as an identifier, not a count.
⌘I
Create maintenance record
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/maintenance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Asset": {
"AssetId": "<string>",
"AssetType": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Status": "<string>",
"Date": "2023-11-07T05:31:56Z",
"Description": "<string>",
"Comments": "<string>",
"Amount": 123,
"PO": "<string>",
"Reference": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"OdometerReading": 123,
"WorkPerformed": "<string>",
"Reminders": [
{
"DueDate": "2023-11-07T05:31:56Z"
}
],
"ExternalId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
Asset: {AssetId: '<string>', AssetType: '<string>'},
Category: {Id: '<string>', Name: '<string>'},
Status: '<string>',
Date: '2023-11-07T05:31:56Z',
Description: '<string>',
Comments: '<string>',
Amount: 123,
PO: '<string>',
Reference: '<string>',
RepairShop: {Id: '<string>', Name: '<string>'},
Vendor: {Id: '<string>', Name: '<string>'},
OdometerReading: 123,
WorkPerformed: '<string>',
Reminders: [{DueDate: '2023-11-07T05:31:56Z'}],
ExternalId: '<string>'
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/maintenance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/maintenance"
payload = {
"Asset": {
"AssetId": "<string>",
"AssetType": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Status": "<string>",
"Date": "2023-11-07T05:31:56Z",
"Description": "<string>",
"Comments": "<string>",
"Amount": 123,
"PO": "<string>",
"Reference": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"OdometerReading": 123,
"WorkPerformed": "<string>",
"Reminders": [{ "DueDate": "2023-11-07T05:31:56Z" }],
"ExternalId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/maintenance",
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([
'Asset' => [
'AssetId' => '<string>',
'AssetType' => '<string>'
],
'Category' => [
'Id' => '<string>',
'Name' => '<string>'
],
'Status' => '<string>',
'Date' => '2023-11-07T05:31:56Z',
'Description' => '<string>',
'Comments' => '<string>',
'Amount' => 123,
'PO' => '<string>',
'Reference' => '<string>',
'RepairShop' => [
'Id' => '<string>',
'Name' => '<string>'
],
'Vendor' => [
'Id' => '<string>',
'Name' => '<string>'
],
'OdometerReading' => 123,
'WorkPerformed' => '<string>',
'Reminders' => [
[
'DueDate' => '2023-11-07T05:31:56Z'
]
],
'ExternalId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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://integrations.alvys.com/api/p/v{version}/maintenance"
payload := strings.NewReader("{\n \"Asset\": {\n \"AssetId\": \"<string>\",\n \"AssetType\": \"<string>\"\n },\n \"Category\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Status\": \"<string>\",\n \"Date\": \"2023-11-07T05:31:56Z\",\n \"Description\": \"<string>\",\n \"Comments\": \"<string>\",\n \"Amount\": 123,\n \"PO\": \"<string>\",\n \"Reference\": \"<string>\",\n \"RepairShop\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Vendor\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"OdometerReading\": 123,\n \"WorkPerformed\": \"<string>\",\n \"Reminders\": [\n {\n \"DueDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"ExternalId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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://integrations.alvys.com/api/p/v{version}/maintenance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Asset\": {\n \"AssetId\": \"<string>\",\n \"AssetType\": \"<string>\"\n },\n \"Category\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Status\": \"<string>\",\n \"Date\": \"2023-11-07T05:31:56Z\",\n \"Description\": \"<string>\",\n \"Comments\": \"<string>\",\n \"Amount\": 123,\n \"PO\": \"<string>\",\n \"Reference\": \"<string>\",\n \"RepairShop\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"Vendor\": {\n \"Id\": \"<string>\",\n \"Name\": \"<string>\"\n },\n \"OdometerReading\": 123,\n \"WorkPerformed\": \"<string>\",\n \"Reminders\": [\n {\n \"DueDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"ExternalId\": \"<string>\"\n}")
.asString();{
"Id": "<string>",
"RelatedAsset": {
"AssetId": "<string>",
"AssetType": "<string>",
"AssetNumber": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Amount": {
"Amount": 123,
"Currency": 123
},
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"Status": "<string>",
"OdometerReading": 123,
"IsDeducted": true,
"PO": "<string>",
"Reference": "<string>",
"Description": "<string>",
"Comments": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Reminders": [
{
"id": "<string>",
"DueDate": "2023-11-07T05:31:56Z"
}
],
"ModifiedAt": "2023-11-07T05:31:56Z",
"ModifiedBy": "<string>",
"RecordNumber": "<string>",
"Date": "2023-11-07T05:31:56Z",
"WorkPerformed": "<string>",
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"ExternalId": "<string>"
}{
"Id": "<string>",
"RelatedAsset": {
"AssetId": "<string>",
"AssetType": "<string>",
"AssetNumber": "<string>"
},
"Category": {
"Id": "<string>",
"Name": "<string>"
},
"Amount": {
"Amount": 123,
"Currency": 123
},
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"Status": "<string>",
"OdometerReading": 123,
"IsDeducted": true,
"PO": "<string>",
"Reference": "<string>",
"Description": "<string>",
"Comments": "<string>",
"RepairShop": {
"Id": "<string>",
"Name": "<string>"
},
"Reminders": [
{
"id": "<string>",
"DueDate": "2023-11-07T05:31:56Z"
}
],
"ModifiedAt": "2023-11-07T05:31:56Z",
"ModifiedBy": "<string>",
"RecordNumber": "<string>",
"Date": "2023-11-07T05:31:56Z",
"WorkPerformed": "<string>",
"Vendor": {
"Id": "<string>",
"Name": "<string>"
},
"ExternalId": "<string>"
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}