Add a product to a ticket

이 페이지는 아직 한국어 언어로 제공되지 않습니다. 기본 언어(English)로 표시합니다.

Add a product to a ticket

POSThttps://api.cekat.ai/api/tickets/products

Adds a product to a ticket and lowers the product’s stock by the quantity.

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.

Body application/jsonrequired

product_idstring<uuid>required
ticket_idstring<uuid>required
quantityintegerrequired
min: 1
adjusted_pricenumberrequired

The price for this ticket.

min: 0

Response

201
400
401
429

Product added.

messagestring
dataobject[]

A field is missing or invalid, or the ticket belongs to another business.

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.

Rate limit exceeded. Wait and retry.

messagestring
POST/api/tickets/products
cURL
JavaScript
Python
PHP
curl --request POST \
  --url 'https://api.cekat.ai/api/tickets/products' \
  --header 'api_key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "quantity": 1,
  "adjusted_price": 0
}'
const response = await fetch('https://api.cekat.ai/api/tickets/products', {
  method: 'POST',
  headers: { 'api_key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "quantity": 1,
    "adjusted_price": 0
  })
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.cekat.ai/api/tickets/products"
headers = {"api_key": "YOUR_API_KEY"}
payload = {
    "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "quantity": 1,
    "adjusted_price": 0
}

response = requests.post(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',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['api_key: YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'product_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'ticket_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'quantity' => 1,
    'adjusted_price' => 0
  ]),
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
201
400
401
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>"
}
{
  "message": "<string>"
}