Update a ticket product
Update a ticket product
此页面暂无中文版本。显示默认语言(English)。
Update a ticket product
PUT
https://api.cekat.ai/api/tickets/products/{id}Changes the quantity or price of a product on a ticket. Changing the quantity adjusts the product’s stock by the difference.
Authorization
api_keystringheaderrequired
Your Cekat API key, from Settings → Developers & API in the Cekat dashboard.
Authorizationstringheader
Alternative to api_key: send the same key as Bearer YOUR_API_KEY.
Path parameters
idstring<uuid>required
The ticket product ID.
Body application/jsonrequired
quantityinteger
min:
1adjusted_pricenumber
min:
0Response
202
400
401
404
429
Product updated.
messagestring
dataobject
quantity or adjusted_price is invalid.
successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring
Request ID. Include it when contacting Cekat support.
The API key is missing or invalid.
successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring
Request ID. Include it when contacting Cekat support.
The ticket product was not found.
successboolean
messagestring
statusCodeinteger
errorobject
Show child attributes
messagestring
correlationIdstring
Request ID. Include it when contacting Cekat support.
Rate limit exceeded. Wait and retry.
messagestring
PUT/api/tickets/products/{id}
cURL
JavaScript
Python
PHP
curl --request PUT \
--url 'https://api.cekat.ai/api/tickets/products/3c90c3cc-0d44-4b50-8888-8dd25736052a' \
--header 'api_key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"quantity": 1,
"adjusted_price": 0
}'
const response = await fetch('https://api.cekat.ai/api/tickets/products/3c90c3cc-0d44-4b50-8888-8dd25736052a', {
method: 'PUT',
headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"quantity": 1,
"adjusted_price": 0
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.cekat.ai/api/tickets/products/3c90c3cc-0d44-4b50-8888-8dd25736052a"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
"quantity": 1,
"adjusted_price": 0
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.cekat.ai/api/tickets/products/3c90c3cc-0d44-4b50-8888-8dd25736052a',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'quantity' => 1,
'adjusted_price' => 0
]),
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
202
400
401
404
429
{
"message": "<string>",
"data": {}
}
{
"success": true,
"message": "<string>",
"statusCode": 1,
"error": {
"message": "<string>"
},
"correlationId": "<string>"
}
{
"success": true,
"message": "<string>",
"statusCode": 1,
"error": {
"message": "<string>"
},
"correlationId": "<string>"
}
{
"success": true,
"message": "<string>",
"statusCode": 1,
"error": {
"message": "<string>"
},
"correlationId": "<string>"
}
{
"message": "<string>"
}