Create or replace an offer
curl --request POST \
--url https://api.wondeya.com/v1/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": {
"amount": 123
},
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}
'import requests
url = "https://api.wondeya.com/v1/offers"
payload = {
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": { "amount": 123 },
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": True,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}
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({
key: '<string>',
name: {es: '<string>', en: '<string>'},
description: '<string>',
agentId: {},
price: {amount: 123},
features: [{es: '<string>', en: '<string>'}],
highlight: true,
ctaLinkId: {},
ctaLabel: {es: '<string>', en: '<string>'}
})
};
fetch('https://api.wondeya.com/v1/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.wondeya.com/v1/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([
'key' => '<string>',
'name' => [
'es' => '<string>',
'en' => '<string>'
],
'description' => '<string>',
'agentId' => [
],
'price' => [
'amount' => 123
],
'features' => [
[
'es' => '<string>',
'en' => '<string>'
]
],
'highlight' => true,
'ctaLinkId' => [
],
'ctaLabel' => [
'es' => '<string>',
'en' => '<string>'
]
]),
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://api.wondeya.com/v1/offers"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\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://api.wondeya.com/v1/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/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 \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": {},
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"status": "active",
"createdAt": "<string>",
"updatedAt": "<string>",
"price": {
"amount": 123,
"currency": "USD",
"period": "month"
},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}Offers
Create or replace an offer
Upserts by key. The agent never writes a price; it lives here and the server formats it.
POST
/
v1
/
offers
Create or replace an offer
curl --request POST \
--url https://api.wondeya.com/v1/offers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": {
"amount": 123
},
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}
'import requests
url = "https://api.wondeya.com/v1/offers"
payload = {
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"agentId": {},
"price": { "amount": 123 },
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": True,
"ctaLinkId": {},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}
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({
key: '<string>',
name: {es: '<string>', en: '<string>'},
description: '<string>',
agentId: {},
price: {amount: 123},
features: [{es: '<string>', en: '<string>'}],
highlight: true,
ctaLinkId: {},
ctaLabel: {es: '<string>', en: '<string>'}
})
};
fetch('https://api.wondeya.com/v1/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.wondeya.com/v1/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([
'key' => '<string>',
'name' => [
'es' => '<string>',
'en' => '<string>'
],
'description' => '<string>',
'agentId' => [
],
'price' => [
'amount' => 123
],
'features' => [
[
'es' => '<string>',
'en' => '<string>'
]
],
'highlight' => true,
'ctaLinkId' => [
],
'ctaLabel' => [
'es' => '<string>',
'en' => '<string>'
]
]),
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://api.wondeya.com/v1/offers"
payload := strings.NewReader("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\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://api.wondeya.com/v1/offers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wondeya.com/v1/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 \"key\": \"<string>\",\n \"name\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"agentId\": {},\n \"price\": {\n \"amount\": 123\n },\n \"features\": [\n {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n ],\n \"highlight\": true,\n \"ctaLinkId\": {},\n \"ctaLabel\": {\n \"es\": \"<string>\",\n \"en\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": {},
"key": "<string>",
"name": {
"es": "<string>",
"en": "<string>"
},
"description": "<string>",
"features": [
{
"es": "<string>",
"en": "<string>"
}
],
"highlight": true,
"ctaLinkId": {},
"status": "active",
"createdAt": "<string>",
"updatedAt": "<string>",
"price": {
"amount": 123,
"currency": "USD",
"period": "month"
},
"ctaLabel": {
"es": "<string>",
"en": "<string>"
}
}Authorizations
A workspace API key: wdy_live_… / wdy_test_…. Created at POST /workspaces/{tenantId}/keys and shown exactly once.
Body
application/json
The kebab-case id the model emits.
Show child attributes
Show child attributes
ENGLISH, prompt-facing: when to offer it.
Maximum string length:
600The agent this offer belongs to; null = the workspace pool.
Show child attributes
Show child attributes
Maximum array length:
6Show child attributes
Show child attributes
A link id from the agent, where the button leads.
Localized CTA button text. The principal language is required; automatic target translations may arrive later.
Show child attributes
Show child attributes
Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
active, archived Show child attributes
Show child attributes
Show child attributes
Show child attributes