Update trip reference
Update an existing custom reference on a trip, requiring If-Match with the current trip ETag from Get trip or a prior write.
curl --request PUT \
--url https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/references/{referenceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Name": "<string>",
"Value": "<string>",
"ReferenceId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({Name: '<string>', Value: '<string>', ReferenceId: '<string>'})
};
fetch('https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/references/{referenceId}', 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}/trips/{tripId}/references/{referenceId}"
payload = {
"Name": "<string>",
"Value": "<string>",
"ReferenceId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(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}/trips/{tripId}/references/{referenceId}",
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([
'Name' => '<string>',
'Value' => '<string>',
'ReferenceId' => '<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}/trips/{tripId}/references/{referenceId}"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"Value\": \"<string>\",\n \"ReferenceId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/references/{referenceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Name\": \"<string>\",\n \"Value\": \"<string>\",\n \"ReferenceId\": \"<string>\"\n}")
.asString();{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<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>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}If-Match is required with the trip ETag.
Read that value from Get trip or from a prior create/update response. The write persists only the target trip and returns its refreshed ETag.
Requires trip:update.
See Updating records safely.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| version | string | Yes | API version (for example 2.0). |
| tripId | string | Yes | Trip id. |
| referenceId | string | Yes | Existing reference instance id (from a trip read or a prior create). |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| If-Match | string | Yes | Current trip ETag. Omit → 428; stale → 412. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| Name | string | Yes | Reference name. At most 50 characters. |
| Value | string | Yes | Reference value. At most 40 characters (CFDI folio UUID length). |
| ReferenceId | string | No | Optional catalog definition id. |
Example
curl --location --request PUT 'https://integrations.alvys.com/api/p/v2.0/trips/{tripId}/references/{referenceId}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--header 'If-Match: "00000000-0000-0000-0000-000000000001"' \
--data-raw '{
"Name": "Route",
"Value": "East"
}'
Status codes
| Code | Description |
|---|---|
| 200 | Reference updated; refreshed trip ETag on the response. |
| 400 | Validation failed (including name or value length). |
| 401 | Authentication failed or the token is missing. |
| 403 | The token is not authorized to update trips. |
| 404 | Trip or reference instance was not found. |
| 412 | The If-Match ETag did not match the trip’s current version. |
| 428 | The If-Match header was not provided. |
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>.
Headers
Path Parameters
API version (e.g., 2.0)
"2.0"
Body
Reference name. Must be 50 characters or fewer. For catalog-backed writes, must match the configured definition name.
50Reference value. Must be 40 characters or fewer — enough for a 36-character CFDI folio UUID. OrderNumber and PONumber stay at the X12 30-character bound and are unchanged by this field.
40Optional tenant catalog definition id from List custom reference definitions. When set, the value is validated against that definition.
curl --request PUT \
--url https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/references/{referenceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Name": "<string>",
"Value": "<string>",
"ReferenceId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({Name: '<string>', Value: '<string>', ReferenceId: '<string>'})
};
fetch('https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/references/{referenceId}', 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}/trips/{tripId}/references/{referenceId}"
payload = {
"Name": "<string>",
"Value": "<string>",
"ReferenceId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.put(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}/trips/{tripId}/references/{referenceId}",
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([
'Name' => '<string>',
'Value' => '<string>',
'ReferenceId' => '<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}/trips/{tripId}/references/{referenceId}"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"Value\": \"<string>\",\n \"ReferenceId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://integrations.alvys.com/api/p/v{version}/trips/{tripId}/references/{referenceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Name\": \"<string>\",\n \"Value\": \"<string>\",\n \"ReferenceId\": \"<string>\"\n}")
.asString();{
"Name": "<string>",
"Value": "<string>",
"Id": "<string>",
"ReferenceId": "<string>",
"Type": "<string>",
"Access": "<string>",
"Origin": "<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>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}