curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"price": 1,
"is_subscription": true,
"subscription_period": {
"amount": 2
},
"public_name": "<string>",
"landing_text": "<string>",
"landing_button": "<string>",
"link_text": "<string>",
"offerables": [
{
"id": 123
}
],
"payment_system_ids": [
123
],
"settings": {}
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/offers"
payload = {
"name": "<string>",
"price": 1,
"is_subscription": True,
"subscription_period": { "amount": 2 },
"public_name": "<string>",
"landing_text": "<string>",
"landing_button": "<string>",
"link_text": "<string>",
"offerables": [{ "id": 123 }],
"payment_system_ids": [123],
"settings": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
price: 1,
is_subscription: true,
subscription_period: {amount: 2},
public_name: '<string>',
landing_text: '<string>',
landing_button: '<string>',
link_text: '<string>',
offerables: [{id: 123}],
payment_system_ids: [123],
settings: {}
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/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://app.zenedu.io/api/v1/bot/{bot}/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([
'name' => '<string>',
'price' => 1,
'is_subscription' => true,
'subscription_period' => [
'amount' => 2
],
'public_name' => '<string>',
'landing_text' => '<string>',
'landing_button' => '<string>',
'link_text' => '<string>',
'offerables' => [
[
'id' => 123
]
],
'payment_system_ids' => [
123
],
'settings' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.zenedu.io/api/v1/bot/{bot}/offers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"price\": 1,\n \"is_subscription\": true,\n \"subscription_period\": {\n \"amount\": 2\n },\n \"public_name\": \"<string>\",\n \"landing_text\": \"<string>\",\n \"landing_button\": \"<string>\",\n \"link_text\": \"<string>\",\n \"offerables\": [\n {\n \"id\": 123\n }\n ],\n \"payment_system_ids\": [\n 123\n ],\n \"settings\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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://app.zenedu.io/api/v1/bot/{bot}/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"price\": 1,\n \"is_subscription\": true,\n \"subscription_period\": {\n \"amount\": 2\n },\n \"public_name\": \"<string>\",\n \"landing_text\": \"<string>\",\n \"landing_button\": \"<string>\",\n \"link_text\": \"<string>\",\n \"offerables\": [\n {\n \"id\": 123\n }\n ],\n \"payment_system_ids\": [\n 123\n ],\n \"settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/offers")
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'
request.body = "{\n \"name\": \"<string>\",\n \"price\": 1,\n \"is_subscription\": true,\n \"subscription_period\": {\n \"amount\": 2\n },\n \"public_name\": \"<string>\",\n \"landing_text\": \"<string>\",\n \"landing_button\": \"<string>\",\n \"link_text\": \"<string>\",\n \"offerables\": [\n {\n \"id\": 123\n }\n ],\n \"payment_system_ids\": [\n 123\n ],\n \"settings\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"name": "<string>",
"price": 123,
"currency": "<string>",
"is_active": true,
"is_subscription": true,
"accesses_count": 123,
"description": "<string>",
"landing_name": "<string>",
"landing_description": "<string>",
"cover_url": "<string>",
"bot_image_url": "<string>",
"thankyou_image_url": "<string>",
"request_contacts": true,
"time_limit_enabled": true,
"usage_limit_enabled": true,
"access_limit_enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"bot_slug": "<string>",
"landing_slug": "<string>",
"link": "<string>",
"landing_link": "<string>",
"direct_payment_links": [
{
"name": "<string>",
"link": "<string>"
}
]
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Створити тариф
Створює тариф
curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"price": 1,
"is_subscription": true,
"subscription_period": {
"amount": 2
},
"public_name": "<string>",
"landing_text": "<string>",
"landing_button": "<string>",
"link_text": "<string>",
"offerables": [
{
"id": 123
}
],
"payment_system_ids": [
123
],
"settings": {}
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/offers"
payload = {
"name": "<string>",
"price": 1,
"is_subscription": True,
"subscription_period": { "amount": 2 },
"public_name": "<string>",
"landing_text": "<string>",
"landing_button": "<string>",
"link_text": "<string>",
"offerables": [{ "id": 123 }],
"payment_system_ids": [123],
"settings": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
price: 1,
is_subscription: true,
subscription_period: {amount: 2},
public_name: '<string>',
landing_text: '<string>',
landing_button: '<string>',
link_text: '<string>',
offerables: [{id: 123}],
payment_system_ids: [123],
settings: {}
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/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://app.zenedu.io/api/v1/bot/{bot}/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([
'name' => '<string>',
'price' => 1,
'is_subscription' => true,
'subscription_period' => [
'amount' => 2
],
'public_name' => '<string>',
'landing_text' => '<string>',
'landing_button' => '<string>',
'link_text' => '<string>',
'offerables' => [
[
'id' => 123
]
],
'payment_system_ids' => [
123
],
'settings' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.zenedu.io/api/v1/bot/{bot}/offers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"price\": 1,\n \"is_subscription\": true,\n \"subscription_period\": {\n \"amount\": 2\n },\n \"public_name\": \"<string>\",\n \"landing_text\": \"<string>\",\n \"landing_button\": \"<string>\",\n \"link_text\": \"<string>\",\n \"offerables\": [\n {\n \"id\": 123\n }\n ],\n \"payment_system_ids\": [\n 123\n ],\n \"settings\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <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://app.zenedu.io/api/v1/bot/{bot}/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"price\": 1,\n \"is_subscription\": true,\n \"subscription_period\": {\n \"amount\": 2\n },\n \"public_name\": \"<string>\",\n \"landing_text\": \"<string>\",\n \"landing_button\": \"<string>\",\n \"link_text\": \"<string>\",\n \"offerables\": [\n {\n \"id\": 123\n }\n ],\n \"payment_system_ids\": [\n 123\n ],\n \"settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/offers")
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'
request.body = "{\n \"name\": \"<string>\",\n \"price\": 1,\n \"is_subscription\": true,\n \"subscription_period\": {\n \"amount\": 2\n },\n \"public_name\": \"<string>\",\n \"landing_text\": \"<string>\",\n \"landing_button\": \"<string>\",\n \"link_text\": \"<string>\",\n \"offerables\": [\n {\n \"id\": 123\n }\n ],\n \"payment_system_ids\": [\n 123\n ],\n \"settings\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"name": "<string>",
"price": 123,
"currency": "<string>",
"is_active": true,
"is_subscription": true,
"accesses_count": 123,
"description": "<string>",
"landing_name": "<string>",
"landing_description": "<string>",
"cover_url": "<string>",
"bot_image_url": "<string>",
"thankyou_image_url": "<string>",
"request_contacts": true,
"time_limit_enabled": true,
"usage_limit_enabled": true,
"access_limit_enabled": true,
"created_at": "2023-11-07T05:31:56Z",
"bot_slug": "<string>",
"landing_slug": "<string>",
"link": "<string>",
"landing_link": "<string>",
"direct_payment_links": [
{
"name": "<string>",
"link": "<string>"
}
]
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Авторизації
API token from the Zenedu dashboard
Параметри шляху
Bot ID
Тіло
Offer name
250Price in main currency units, for example 10.00. 0 creates a free offer
x >= 0Currency code
USD, EUR, UAH, PLN, KZT, CNY, CHF, CZK, GBP, SGD, ILS, CAD, JPY, HKD, AUD, MDL, BGN, TRY, KGS, MXN, RON Whether this is a recurring subscription
Billing period of a subscription
Show child attributes
Show child attributes
Name shown on the payment page
250Payment page description
Payment page button text
250Offer description
Products and resources included in the offer, in display order. When passed on update, replaces the current list
Show child attributes
Show child attributes
Payment system IDs attached to the offer. When passed on update, replaces the current list
Offer settings grouped by key: access, timeLimit, usageLimit, paymentNotification, subscriptionNotification, paymentReminder, removeFromProducts, request_contacts, landingRequestContacts, appRequestContacts, subscriptionPaymentAttempts, landingPaymentEmail, subscriptionRenewalReminder, landingPaymentReminder, delete_steps, landingSettings, botMessage, paidTrial, appDisplay
Відповідь
Offer created
Show child attributes
Show child attributes