Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl --request POST \
--url https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"items": [
{
"id": "110",
"name": "Promotion 110",
"useForAllCategories": true,
"useForAllProducts": true,
"locationIds": [
"295"
],
"categoryIds": [
"2"
],
"promotionValidities": [
{
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z",
"recurrence": {
"daysOfWeek": [
"Sunday"
],
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z"
}
}
],
"productIds": [
"1"
],
"promotionResults": [
{
"promotionType": "Amount",
"value": 10
}
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
items: [
{
id: '110',
name: 'Promotion 110',
useForAllCategories: true,
useForAllProducts: true,
locationIds: ['295'],
categoryIds: ['2'],
promotionValidities: [
{
startDate: '2023-12-19T13:18:44.512Z',
endDate: '2023-12-19T13:18:44.512Z',
recurrence: {
daysOfWeek: ['Sunday'],
startDate: '2023-12-19T13:18:44.512Z',
endDate: '2023-12-19T13:18:44.512Z'
}
}
],
productIds: ['1'],
promotionResults: [{promotionType: 'Amount', value: 10}]
}
]
})
};
fetch('https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions"
payload = { "items": [
{
"id": "110",
"name": "Promotion 110",
"useForAllCategories": True,
"useForAllProducts": True,
"locationIds": ["295"],
"categoryIds": ["2"],
"promotionValidities": [
{
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z",
"recurrence": {
"daysOfWeek": ["Sunday"],
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z"
}
}
],
"productIds": ["1"],
"promotionResults": [
{
"promotionType": "Amount",
"value": 10
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\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://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\n}")
.asString();{
"data": {
"status": "<string>",
"createdCount": 123,
"updatedCount": 123,
"errors": [
{
"entityId": "<string>",
"rowNumber": 123,
"errorMessage": "<string>",
"errorDetails": "<string>"
}
],
"warnings": [
{
"entityId": "<string>",
"rowNumber": 123,
"message": "<string>",
"details": "<string>"
}
]
}
}curl --request POST \
--url https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"items": [
{
"id": "110",
"name": "Promotion 110",
"useForAllCategories": true,
"useForAllProducts": true,
"locationIds": [
"295"
],
"categoryIds": [
"2"
],
"promotionValidities": [
{
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z",
"recurrence": {
"daysOfWeek": [
"Sunday"
],
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z"
}
}
],
"productIds": [
"1"
],
"promotionResults": [
{
"promotionType": "Amount",
"value": 10
}
]
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
items: [
{
id: '110',
name: 'Promotion 110',
useForAllCategories: true,
useForAllProducts: true,
locationIds: ['295'],
categoryIds: ['2'],
promotionValidities: [
{
startDate: '2023-12-19T13:18:44.512Z',
endDate: '2023-12-19T13:18:44.512Z',
recurrence: {
daysOfWeek: ['Sunday'],
startDate: '2023-12-19T13:18:44.512Z',
endDate: '2023-12-19T13:18:44.512Z'
}
}
],
productIds: ['1'],
promotionResults: [{promotionType: 'Amount', value: 10}]
}
]
})
};
fetch('https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions"
payload = { "items": [
{
"id": "110",
"name": "Promotion 110",
"useForAllCategories": True,
"useForAllProducts": True,
"locationIds": ["295"],
"categoryIds": ["2"],
"promotionValidities": [
{
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z",
"recurrence": {
"daysOfWeek": ["Sunday"],
"startDate": "2023-12-19T13:18:44.512Z",
"endDate": "2023-12-19T13:18:44.512Z"
}
}
],
"productIds": ["1"],
"promotionResults": [
{
"promotionType": "Amount",
"value": 10
}
]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\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://public-api-demo.clearline.me/pos/{posSystemId}/company/{posCompanyId}/import/promotions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"items\": [\n {\n \"id\": \"110\",\n \"name\": \"Promotion 110\",\n \"useForAllCategories\": true,\n \"useForAllProducts\": true,\n \"locationIds\": [\n \"295\"\n ],\n \"categoryIds\": [\n \"2\"\n ],\n \"promotionValidities\": [\n {\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\",\n \"recurrence\": {\n \"daysOfWeek\": [\n \"Sunday\"\n ],\n \"startDate\": \"2023-12-19T13:18:44.512Z\",\n \"endDate\": \"2023-12-19T13:18:44.512Z\"\n }\n }\n ],\n \"productIds\": [\n \"1\"\n ],\n \"promotionResults\": [\n {\n \"promotionType\": \"Amount\",\n \"value\": 10\n }\n ]\n }\n ]\n}")
.asString();{
"data": {
"status": "<string>",
"createdCount": 123,
"updatedCount": 123,
"errors": [
{
"entityId": "<string>",
"rowNumber": 123,
"errorMessage": "<string>",
"errorDetails": "<string>"
}
],
"warnings": [
{
"entityId": "<string>",
"rowNumber": 123,
"message": "<string>",
"details": "<string>"
}
]
}
}JWT Authorization header using the Bearer scheme.
Enter JWT Bearer token only in the text input below.
Represents promotions items import category request for POS
Items to add
Show child attributes
Success
Results of import
Show child attributes