Update Order
Update order data in Liner.
Endpoint and method
POST /v2/order/update/{orderId}/
orderIdint
Order identifier in Liner. Value> 0.
Parameters (Body)
Send only the fields you want to update. There are no required fields in the request body.
codestringoptional
Order code in Liner. Allowed characters:a-z,0-9,-,_. Must be unique.
serviceTitlestringoptional
Internal order name.
titlestringoptional
Display name of the order.
callSchedulearrayoptional
Call schedule: up to 7 items, the item position is the weekday (Mon → Sun). An item is["HH:MM", "HH:MM"](start and end of the working day) or[]for a day off.
callHolidayOverridesarrayoptional
List of holidays (string). Any parsable date format is accepted; stored and returned indd.mm.yyyyformat.
autoDialingEnabledbooloptional
Whether calls are allowed for the order.
predictiveModeEnabledbooloptional
Whether calls are allowed in predictive mode.
aiDefaultLanguagestringoptional
Default language for AI. A code of one of the available languages, e.g.ru,gb.
amdDetectionEnabledbooloptional
Whether answering machine detection is enabled.
callRecordRulestringoptional
When to start call recording. Available values:client_is_connected,agent_is_connected.
sipEndpointUsageSchemestringoptional
Number usage scheme. Available values:random_default,random_without_repetition,even_loaded,even_loaded_daily.
agentUserIdsarrayoptional
IDs (int) of agents who can work in this order.
agentGroupIdsarrayoptional
IDs (int) of agent groups who can work in this order.
showLeadContactsToAgentbooloptional
Whether agents can see lead contacts.
callAttemptGroupIdintoptional
Call attempt intervals group ID. Value>= 1.
qualifiedLeadsPerDayLimitintoptional
Maximum number of qualified leads per day. Value>= 1.
callScenarioIdintoptional
Call scenario ID. Value>= 1.
leadTransformEnabledbooloptional
Whether an agent is allowed to change the lead type.
statusstringoptional
Order status. Available values:success,secondary,info.
speechRecognitionEnabledbooloptional
Whether call recognition is enabled.
ignoreLeadTimezonebooloptional
Whether to ignore the client’s time zone.
sipEndpointIdsarrayoptional
List of virtual number identifiers (int). Must not be empty.
customValuesarrayoptional
Map of custom field values: key is the custom field ID, value is the value to be stored for that field. The field must exist and belong to orders, and the value must match the field type (for a multiselect — a comma-separated string).
transferNumbersarrayoptional
Call transfer numbers. Each item is an object:number(string, required, no spaces) andnames(object, optional: key is a language code, value is the name).
autoProcessCallbooloptional
Whether the call is processed automatically.
agentLeadCreationIsAllowedbooloptional
Whether an agent is allowed to create leads.
agentLeadEditModestringoptional
Lead editing mode for agents, e.g.during-call.
Note
Unknown fields in the request body are ignored. The createdAt, updatedAt, createdBy, updatedBy fields cannot be set.
Request example
curl -X POST "https://YOUR_LINER_API_HOST/v2/order/update/{orderId}/" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_TOKEN" \
-d '{
"code": "{{code}}",
"serviceTitle": "{{serviceTitle}}",
"title": "{{title}}",
"status": "{{status}}",
"sipEndpointIds": [{{sipEndpointId}}, {{sipEndpointId2}}],
"callSchedule": [["{{start}}", "{{end}}"]],
"callHolidayOverrides": ["{{holiday}}"],
"autoDialingEnabled": {{autoDialingEnabled}},
"predictiveModeEnabled": {{predictiveModeEnabled}},
"aiDefaultLanguage": "{{aiDefaultLanguage}}",
"amdDetectionEnabled": {{amdDetectionEnabled}},
"callRecordRule": "{{callRecordRule}}",
"sipEndpointUsageScheme": "{{sipEndpointUsageScheme}}",
"agentUserIds": [{{agentUserId}}, ...],
"agentGroupIds": [{{agentGroupId}}, ...],
"showLeadContactsToAgent": {{showLeadContactsToAgent}},
"callAttemptGroupId": {{callAttemptGroupId}},
"qualifiedLeadsPerDayLimit": {{qualifiedLeadsPerDayLimit}},
"callScenarioId": {{callScenarioId}},
"leadTransformEnabled": {{leadTransformEnabled}},
"speechRecognitionEnabled": {{speechRecognitionEnabled}},
"ignoreLeadTimezone": {{ignoreLeadTimezone}},
"customValues": {
"{{customFieldId}}": "{{customFieldValue}}"
},
"transferNumbers": [
{
"number": "{{transferNumber}}",
"names": {
"{{langCode}}": "{{transferNumberName}}"
}
}
],
"autoProcessCall": {{autoProcessCall}},
"agentLeadCreationIsAllowed": {{agentLeadCreationIsAllowed}},
"agentLeadEditMode": "{{agentLeadEditMode}}"
}'
<?php
$host = 'https://YOUR_LINER_API_HOST';
$token = 'YOUR_API_TOKEN';
$orderId = (int)$orderId;
// Important: fill in only the fields you want to update
$payload = [
'code' => $code ?? null,
'serviceTitle' => $serviceTitle ?? null,
'title' => $title ?? null,
'status' => $status ?? null,
'sipEndpointIds' => $sipEndpointIds ?? null,
'callSchedule' => $callSchedule ?? null,
'callHolidayOverrides' => $callHolidayOverrides ?? null,
'autoDialingEnabled' => isset($autoDialingEnabled) ? (bool)$autoDialingEnabled : null,
'predictiveModeEnabled' => isset($predictiveModeEnabled) ? (bool)$predictiveModeEnabled : null,
'aiDefaultLanguage' => $aiDefaultLanguage ?? null,
'amdDetectionEnabled' => isset($amdDetectionEnabled) ? (bool)$amdDetectionEnabled : null,
'callRecordRule' => $callRecordRule ?? null,
'sipEndpointUsageScheme' => $sipEndpointUsageScheme ?? null,
'agentUserIds' => $agentUserIds ?? null,
'agentGroupIds' => $agentGroupIds ?? null,
'showLeadContactsToAgent' => isset($showLeadContactsToAgent) ? (bool)$showLeadContactsToAgent : null,
'callAttemptGroupId' => isset($callAttemptGroupId) ? (int)$callAttemptGroupId : null,
'qualifiedLeadsPerDayLimit' => isset($qualifiedLeadsPerDayLimit) ? (int)$qualifiedLeadsPerDayLimit : null,
'callScenarioId' => isset($callScenarioId) ? (int)$callScenarioId : null,
'leadTransformEnabled' => isset($leadTransformEnabled) ? (bool)$leadTransformEnabled : null,
'speechRecognitionEnabled' => isset($speechRecognitionEnabled) ? (bool)$speechRecognitionEnabled : null,
'ignoreLeadTimezone' => isset($ignoreLeadTimezone) ? (bool)$ignoreLeadTimezone : null,
'customValues' => [
$customFieldId => isset($customFieldValue) ? $customFieldValue : null,
],
'transferNumbers' => $transferNumbers ?? null,
'autoProcessCall' => isset($autoProcessCall) ? (bool)$autoProcessCall : null,
'agentLeadCreationIsAllowed' => isset($agentLeadCreationIsAllowed) ? (bool)$agentLeadCreationIsAllowed : null,
'agentLeadEditMode' => $agentLeadEditMode ?? null,
];
// Remove null fields so existing values are not overwritten by accident
$payload = array_filter($payload, fn($v) => $v !== null);
$ch = curl_init($host . '/v2/order/update/' . $orderId . '/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Api-Key: ' . $token,
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
CURLOPT_TIMEOUT => 15,
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) {
throw new RuntimeException('cURL error: ' . curl_error($ch));
}
curl_close($ch);
echo "HTTP {$httpCode}\n";
echo $response;
const host = "https://YOUR_LINER_API_HOST";
const token = "YOUR_API_TOKEN";
const orderId = Number(orderId);
// Important: include only the fields you want to update
const payload = {
code: code,
serviceTitle: serviceTitle,
title: title,
status: status,
sipEndpointIds: sipEndpointIds,
callSchedule: callSchedule,
callHolidayOverrides: callHolidayOverrides,
autoDialingEnabled: autoDialingEnabled != null ? Boolean(autoDialingEnabled) : undefined,
predictiveModeEnabled: predictiveModeEnabled != null ? Boolean(predictiveModeEnabled) : undefined,
aiDefaultLanguage: aiDefaultLanguage ?? undefined,
amdDetectionEnabled: amdDetectionEnabled != null ? Boolean(amdDetectionEnabled) : undefined,
callRecordRule: callRecordRule ?? undefined,
sipEndpointUsageScheme: sipEndpointUsageScheme ?? undefined,
agentUserIds: agentUserIds ?? undefined,
agentGroupIds: agentGroupIds ?? undefined,
showLeadContactsToAgent: showLeadContactsToAgent != null ? Boolean(showLeadContactsToAgent) : undefined,
callAttemptGroupId: callAttemptGroupId != null ? Number(callAttemptGroupId) : undefined,
qualifiedLeadsPerDayLimit: qualifiedLeadsPerDayLimit != null ? Number(qualifiedLeadsPerDayLimit) : undefined,
callScenarioId: callScenarioId != null ? Number(callScenarioId) : undefined,
leadTransformEnabled: leadTransformEnabled != null ? Boolean(leadTransformEnabled) : undefined,
speechRecognitionEnabled: speechRecognitionEnabled != null ? Boolean(speechRecognitionEnabled) : undefined,
ignoreLeadTimezone: ignoreLeadTimezone != null ? Boolean(ignoreLeadTimezone) : undefined,
customValues: {
[customFieldId]: customFieldValue != null ? customFieldValue : undefined,
},
transferNumbers: transferNumbers ?? undefined,
autoProcessCall: autoProcessCall != null ? Boolean(autoProcessCall) : undefined,
agentLeadCreationIsAllowed: agentLeadCreationIsAllowed != null ? Boolean(agentLeadCreationIsAllowed) : undefined,
agentLeadEditMode: agentLeadEditMode ?? undefined,
};
// Remove undefined fields
Object.keys(payload).forEach((k) => payload[k] === undefined && delete payload[k]);
const res = await fetch(`${host}/v2/order/update/${orderId}/`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": token
},
body: JSON.stringify(payload)
});
const data = await res.json();
console.log("HTTP", res.status, data);
Response example
Note
The structure of the data field is described above. For the overall API response format, see Request Schema