cURL
curl --request POST \
--url https://api.example.com/v1/panel/offers \
--header 'Content-Type: application/json' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"titleRu": "<string>",
"titleEn": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termsRu": "<string>",
"termsEn": "<string>",
"startsAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/v1/panel/offers"
payload = {
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"titleRu": "<string>",
"titleEn": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termsRu": "<string>",
"termsEn": "<string>",
"startsAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
promotionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
titleRu: '<string>',
titleEn: '<string>',
expiresAt: '2023-11-07T05:31:56Z',
planId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
termsRu: '<string>',
termsEn: '<string>',
startsAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/v1/panel/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/panel/offers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'promotionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'titleRu' => '<string>',
'titleEn' => '<string>',
'expiresAt' => '2023-11-07T05:31:56Z',
'planId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'termsRu' => '<string>',
'termsEn' => '<string>',
'startsAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$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://api.example.com/v1/panel/offers"
payload := strings.NewReader("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"promotionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"titleRu\": \"<string>\",\n \"titleEn\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"planId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termsRu\": \"<string>\",\n \"termsEn\": \"<string>\",\n \"startsAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "application/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://api.example.com/v1/panel/offers")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"promotionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"titleRu\": \"<string>\",\n \"titleEn\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"planId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termsRu\": \"<string>\",\n \"termsEn\": \"<string>\",\n \"startsAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"promotionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"titleRu\": \"<string>\",\n \"titleEn\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"planId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termsRu\": \"<string>\",\n \"termsEn\": \"<string>\",\n \"startsAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"titleRu": "<string>",
"titleEn": "<string>",
"status": "active",
"startsAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termsRu": "<string>",
"termsEn": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resolvedAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}panel
Post v1paneloffers
Requires marketing.write. Both locales are required: an offer with copy in one language renders as a blank card for half the customer base.
POST
/
v1
/
panel
/
offers
cURL
curl --request POST \
--url https://api.example.com/v1/panel/offers \
--header 'Content-Type: application/json' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"titleRu": "<string>",
"titleEn": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termsRu": "<string>",
"termsEn": "<string>",
"startsAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/v1/panel/offers"
payload = {
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"titleRu": "<string>",
"titleEn": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termsRu": "<string>",
"termsEn": "<string>",
"startsAt": "2023-11-07T05:31:56Z"
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CSRF-Token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
promotionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
titleRu: '<string>',
titleEn: '<string>',
expiresAt: '2023-11-07T05:31:56Z',
planId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
termsRu: '<string>',
termsEn: '<string>',
startsAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/v1/panel/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/panel/offers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'promotionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'titleRu' => '<string>',
'titleEn' => '<string>',
'expiresAt' => '2023-11-07T05:31:56Z',
'planId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'termsRu' => '<string>',
'termsEn' => '<string>',
'startsAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CSRF-Token: <x-csrf-token>"
],
]);
$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://api.example.com/v1/panel/offers"
payload := strings.NewReader("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"promotionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"titleRu\": \"<string>\",\n \"titleEn\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"planId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termsRu\": \"<string>\",\n \"termsEn\": \"<string>\",\n \"startsAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Content-Type", "application/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://api.example.com/v1/panel/offers")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"promotionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"titleRu\": \"<string>\",\n \"titleEn\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"planId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termsRu\": \"<string>\",\n \"termsEn\": \"<string>\",\n \"startsAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/panel/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"promotionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"titleRu\": \"<string>\",\n \"titleEn\": \"<string>\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"planId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"termsRu\": \"<string>\",\n \"termsEn\": \"<string>\",\n \"startsAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"titleRu": "<string>",
"titleEn": "<string>",
"status": "active",
"startsAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"termsRu": "<string>",
"termsEn": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resolvedAt": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Headers
Echoes the token from the current session. Required on every unsafe method.
Body
application/json
Required string length:
1 - 120Required string length:
1 - 120Maximum string length:
1000Maximum string length:
1000Response
Offer created
Available options:
active, redeemed, dismissed, expired, revoked