Update Portal Offer
curl --request PATCH \
--url https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_updated_at": 1,
"name": "<string>",
"description": "<string>",
"price_in_cents": 1,
"percent_price": {
"percent": 50
},
"compare_at_price_in_cents": 1,
"image_url": "<string>",
"image_attribution": {
"source": "unsplash",
"photographerName": "<string>",
"photographerUrl": "<string>",
"photoUrl": "<string>"
},
"background_hex": "<string>",
"category": "<string>",
"link_url": "<string>",
"link_label": "<string>",
"highlights": [
"<string>"
],
"availability": {
"visibleFrom": 1,
"visibleUntil": 1,
"bookableFrom": 1,
"bookableUntil": 1
},
"targeting": {
"stayWindow": {},
"bookingChannels": [
"<string>"
],
"sources": [
"<string>"
],
"minNights": 1,
"maxNights": 1,
"minVacantNightsBeforeArrival": 1,
"minVacantNightsAfterDeparture": 1,
"listingIds": [
"<string>"
],
"listingGroupIds": [
"<string>"
],
"inboxTypeIds": [
"<string>"
]
},
"stripe_connection_id": "<string>",
"charge_every_night": true,
"max_per_order": 10,
"questions": [
{
"label": "<string>",
"required": true,
"id": "<string>"
}
],
"option_groups": [
{
"label": "<string>",
"required": true,
"options": [
{
"title": "<string>",
"price_in_cents": 123,
"id": "<string>",
"subtitle": "<string>",
"time_slot": "<string>"
}
],
"id": "<string>",
"blocks_adjacent_night": true,
"max_count": 123
}
],
"combinations_enabled": true,
"variants": [
{
"values": [
{
"group_id": "<string>",
"option_id": "<string>"
}
],
"price_in_cents": 1,
"active": true,
"image_url": "<string>",
"sort_order": 123
}
]
}
'import requests
url = "https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}"
payload = {
"expected_updated_at": 1,
"name": "<string>",
"description": "<string>",
"price_in_cents": 1,
"percent_price": { "percent": 50 },
"compare_at_price_in_cents": 1,
"image_url": "<string>",
"image_attribution": {
"source": "unsplash",
"photographerName": "<string>",
"photographerUrl": "<string>",
"photoUrl": "<string>"
},
"background_hex": "<string>",
"category": "<string>",
"link_url": "<string>",
"link_label": "<string>",
"highlights": ["<string>"],
"availability": {
"visibleFrom": 1,
"visibleUntil": 1,
"bookableFrom": 1,
"bookableUntil": 1
},
"targeting": {
"stayWindow": {},
"bookingChannels": ["<string>"],
"sources": ["<string>"],
"minNights": 1,
"maxNights": 1,
"minVacantNightsBeforeArrival": 1,
"minVacantNightsAfterDeparture": 1,
"listingIds": ["<string>"],
"listingGroupIds": ["<string>"],
"inboxTypeIds": ["<string>"]
},
"stripe_connection_id": "<string>",
"charge_every_night": True,
"max_per_order": 10,
"questions": [
{
"label": "<string>",
"required": True,
"id": "<string>"
}
],
"option_groups": [
{
"label": "<string>",
"required": True,
"options": [
{
"title": "<string>",
"price_in_cents": 123,
"id": "<string>",
"subtitle": "<string>",
"time_slot": "<string>"
}
],
"id": "<string>",
"blocks_adjacent_night": True,
"max_count": 123
}
],
"combinations_enabled": True,
"variants": [
{
"values": [
{
"group_id": "<string>",
"option_id": "<string>"
}
],
"price_in_cents": 1,
"active": True,
"image_url": "<string>",
"sort_order": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_updated_at: 1,
name: '<string>',
description: '<string>',
price_in_cents: 1,
percent_price: {percent: 50},
compare_at_price_in_cents: 1,
image_url: '<string>',
image_attribution: {
source: 'unsplash',
photographerName: '<string>',
photographerUrl: '<string>',
photoUrl: '<string>'
},
background_hex: '<string>',
category: '<string>',
link_url: '<string>',
link_label: '<string>',
highlights: ['<string>'],
availability: {visibleFrom: 1, visibleUntil: 1, bookableFrom: 1, bookableUntil: 1},
targeting: {
stayWindow: {},
bookingChannels: ['<string>'],
sources: ['<string>'],
minNights: 1,
maxNights: 1,
minVacantNightsBeforeArrival: 1,
minVacantNightsAfterDeparture: 1,
listingIds: ['<string>'],
listingGroupIds: ['<string>'],
inboxTypeIds: ['<string>']
},
stripe_connection_id: '<string>',
charge_every_night: true,
max_per_order: 10,
questions: [{label: '<string>', required: true, id: '<string>'}],
option_groups: [
{
label: '<string>',
required: true,
options: [
{
title: '<string>',
price_in_cents: 123,
id: '<string>',
subtitle: '<string>',
time_slot: '<string>'
}
],
id: '<string>',
blocks_adjacent_night: true,
max_count: 123
}
],
combinations_enabled: true,
variants: [
{
values: [{group_id: '<string>', option_id: '<string>'}],
price_in_cents: 1,
active: true,
image_url: '<string>',
sort_order: 123
}
]
})
};
fetch('https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}', 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.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_updated_at' => 1,
'name' => '<string>',
'description' => '<string>',
'price_in_cents' => 1,
'percent_price' => [
'percent' => 50
],
'compare_at_price_in_cents' => 1,
'image_url' => '<string>',
'image_attribution' => [
'source' => 'unsplash',
'photographerName' => '<string>',
'photographerUrl' => '<string>',
'photoUrl' => '<string>'
],
'background_hex' => '<string>',
'category' => '<string>',
'link_url' => '<string>',
'link_label' => '<string>',
'highlights' => [
'<string>'
],
'availability' => [
'visibleFrom' => 1,
'visibleUntil' => 1,
'bookableFrom' => 1,
'bookableUntil' => 1
],
'targeting' => [
'stayWindow' => [
],
'bookingChannels' => [
'<string>'
],
'sources' => [
'<string>'
],
'minNights' => 1,
'maxNights' => 1,
'minVacantNightsBeforeArrival' => 1,
'minVacantNightsAfterDeparture' => 1,
'listingIds' => [
'<string>'
],
'listingGroupIds' => [
'<string>'
],
'inboxTypeIds' => [
'<string>'
]
],
'stripe_connection_id' => '<string>',
'charge_every_night' => true,
'max_per_order' => 10,
'questions' => [
[
'label' => '<string>',
'required' => true,
'id' => '<string>'
]
],
'option_groups' => [
[
'label' => '<string>',
'required' => true,
'options' => [
[
'title' => '<string>',
'price_in_cents' => 123,
'id' => '<string>',
'subtitle' => '<string>',
'time_slot' => '<string>'
]
],
'id' => '<string>',
'blocks_adjacent_night' => true,
'max_count' => 123
]
],
'combinations_enabled' => true,
'variants' => [
[
'values' => [
[
'group_id' => '<string>',
'option_id' => '<string>'
]
],
'price_in_cents' => 1,
'active' => true,
'image_url' => '<string>',
'sort_order' => 123
]
]
]),
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.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}"
payload := strings.NewReader("{\n \"expected_updated_at\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price_in_cents\": 1,\n \"percent_price\": {\n \"percent\": 50\n },\n \"compare_at_price_in_cents\": 1,\n \"image_url\": \"<string>\",\n \"image_attribution\": {\n \"source\": \"unsplash\",\n \"photographerName\": \"<string>\",\n \"photographerUrl\": \"<string>\",\n \"photoUrl\": \"<string>\"\n },\n \"background_hex\": \"<string>\",\n \"category\": \"<string>\",\n \"link_url\": \"<string>\",\n \"link_label\": \"<string>\",\n \"highlights\": [\n \"<string>\"\n ],\n \"availability\": {\n \"visibleFrom\": 1,\n \"visibleUntil\": 1,\n \"bookableFrom\": 1,\n \"bookableUntil\": 1\n },\n \"targeting\": {\n \"stayWindow\": {},\n \"bookingChannels\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ],\n \"minNights\": 1,\n \"maxNights\": 1,\n \"minVacantNightsBeforeArrival\": 1,\n \"minVacantNightsAfterDeparture\": 1,\n \"listingIds\": [\n \"<string>\"\n ],\n \"listingGroupIds\": [\n \"<string>\"\n ],\n \"inboxTypeIds\": [\n \"<string>\"\n ]\n },\n \"stripe_connection_id\": \"<string>\",\n \"charge_every_night\": true,\n \"max_per_order\": 10,\n \"questions\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"id\": \"<string>\"\n }\n ],\n \"option_groups\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"options\": [\n {\n \"title\": \"<string>\",\n \"price_in_cents\": 123,\n \"id\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"time_slot\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"blocks_adjacent_night\": true,\n \"max_count\": 123\n }\n ],\n \"combinations_enabled\": true,\n \"variants\": [\n {\n \"values\": [\n {\n \"group_id\": \"<string>\",\n \"option_id\": \"<string>\"\n }\n ],\n \"price_in_cents\": 1,\n \"active\": true,\n \"image_url\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_updated_at\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price_in_cents\": 1,\n \"percent_price\": {\n \"percent\": 50\n },\n \"compare_at_price_in_cents\": 1,\n \"image_url\": \"<string>\",\n \"image_attribution\": {\n \"source\": \"unsplash\",\n \"photographerName\": \"<string>\",\n \"photographerUrl\": \"<string>\",\n \"photoUrl\": \"<string>\"\n },\n \"background_hex\": \"<string>\",\n \"category\": \"<string>\",\n \"link_url\": \"<string>\",\n \"link_label\": \"<string>\",\n \"highlights\": [\n \"<string>\"\n ],\n \"availability\": {\n \"visibleFrom\": 1,\n \"visibleUntil\": 1,\n \"bookableFrom\": 1,\n \"bookableUntil\": 1\n },\n \"targeting\": {\n \"stayWindow\": {},\n \"bookingChannels\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ],\n \"minNights\": 1,\n \"maxNights\": 1,\n \"minVacantNightsBeforeArrival\": 1,\n \"minVacantNightsAfterDeparture\": 1,\n \"listingIds\": [\n \"<string>\"\n ],\n \"listingGroupIds\": [\n \"<string>\"\n ],\n \"inboxTypeIds\": [\n \"<string>\"\n ]\n },\n \"stripe_connection_id\": \"<string>\",\n \"charge_every_night\": true,\n \"max_per_order\": 10,\n \"questions\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"id\": \"<string>\"\n }\n ],\n \"option_groups\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"options\": [\n {\n \"title\": \"<string>\",\n \"price_in_cents\": 123,\n \"id\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"time_slot\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"blocks_adjacent_night\": true,\n \"max_count\": 123\n }\n ],\n \"combinations_enabled\": true,\n \"variants\": [\n {\n \"values\": [\n {\n \"group_id\": \"<string>\",\n \"option_id\": \"<string>\"\n }\n ],\n \"price_in_cents\": 1,\n \"active\": true,\n \"image_url\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_updated_at\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price_in_cents\": 1,\n \"percent_price\": {\n \"percent\": 50\n },\n \"compare_at_price_in_cents\": 1,\n \"image_url\": \"<string>\",\n \"image_attribution\": {\n \"source\": \"unsplash\",\n \"photographerName\": \"<string>\",\n \"photographerUrl\": \"<string>\",\n \"photoUrl\": \"<string>\"\n },\n \"background_hex\": \"<string>\",\n \"category\": \"<string>\",\n \"link_url\": \"<string>\",\n \"link_label\": \"<string>\",\n \"highlights\": [\n \"<string>\"\n ],\n \"availability\": {\n \"visibleFrom\": 1,\n \"visibleUntil\": 1,\n \"bookableFrom\": 1,\n \"bookableUntil\": 1\n },\n \"targeting\": {\n \"stayWindow\": {},\n \"bookingChannels\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ],\n \"minNights\": 1,\n \"maxNights\": 1,\n \"minVacantNightsBeforeArrival\": 1,\n \"minVacantNightsAfterDeparture\": 1,\n \"listingIds\": [\n \"<string>\"\n ],\n \"listingGroupIds\": [\n \"<string>\"\n ],\n \"inboxTypeIds\": [\n \"<string>\"\n ]\n },\n \"stripe_connection_id\": \"<string>\",\n \"charge_every_night\": true,\n \"max_per_order\": 10,\n \"questions\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"id\": \"<string>\"\n }\n ],\n \"option_groups\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"options\": [\n {\n \"title\": \"<string>\",\n \"price_in_cents\": 123,\n \"id\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"time_slot\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"blocks_adjacent_night\": true,\n \"max_count\": 123\n }\n ],\n \"combinations_enabled\": true,\n \"variants\": [\n {\n \"values\": [\n {\n \"group_id\": \"<string>\",\n \"option_id\": \"<string>\"\n }\n ],\n \"price_in_cents\": 1,\n \"active\": true,\n \"image_url\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"workspace_id": "<string>",
"name": "<string>",
"description": "<string>",
"price_in_cents": 123,
"currency": "<string>",
"active": true,
"created_at": 123,
"updated_at": 123,
"percent_price": {
"percent": 50,
"of": "totalPrice"
},
"compare_at_price_in_cents": 123,
"image_url": "<string>",
"image_attribution": {
"source": "unsplash",
"photographerName": "<string>",
"photographerUrl": "<string>",
"photoUrl": "<string>"
},
"background_hex": "<string>",
"category": "<string>",
"kind": "purchase",
"option_groups": [
{
"id": "<string>",
"label": "<string>",
"type": "single",
"required": true,
"options": [
{
"id": "<string>",
"title": "<string>",
"price_in_cents": 123,
"subtitle": "<string>",
"percent_price": {
"percent": 50,
"of": "totalPrice"
},
"time_slot": "<string>"
}
],
"input_type": "text",
"reservation_action": "check_in",
"blocks_adjacent_night": true,
"max_count": 123
}
],
"combinations_enabled": true,
"variants": [
{
"values": [
{
"group_id": "<string>",
"option_id": "<string>"
}
],
"price_in_cents": 1,
"active": true,
"id": "<string>",
"image_url": "<string>",
"sort_order": 123
}
],
"price_unit": "per_stay",
"charge_every_night": true,
"date_selection": "single",
"max_per_order": 123,
"questions": [
{
"id": "<string>",
"label": "<string>",
"required": true
}
],
"stripe_connection_id": "<string>",
"link_url": "<string>",
"link_label": "<string>",
"highlights": [
"<string>"
],
"availability": {
"visibleFrom": 1,
"visibleUntil": 1,
"bookableFrom": 1,
"bookableUntil": 1
},
"targeting": {
"stayWindow": {
"start": {
"amount": 1,
"unit": "hours",
"anchor": "checkIn"
},
"end": {
"amount": 1,
"unit": "hours",
"anchor": "checkIn"
}
},
"bookingChannels": [
"<string>"
],
"bookingChannelMode": "include",
"sources": [
"<string>"
],
"sourceMode": "include",
"minNights": 1,
"maxNights": 1,
"minVacantNightsBeforeArrival": 1,
"minVacantNightsAfterDeparture": 1,
"listingIds": [
"<string>"
],
"listingGroupIds": [
"<string>"
],
"inboxTypeIds": [
"<string>"
],
"inboxMode": "include",
"customAttributeConditions": {
"combinator": "all",
"conditions": [
{
"attributeId": "<string>",
"operator": "has_value"
}
]
}
},
"sku": "<string>"
}
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}Offers
Update Portal Offer
Update a portal offer definition’s name, description, pricing, availability, or targeting.
PATCH
/
v1
/
workspaces
/
{workspace_id}
/
portal-offers
/
{id}
Update Portal Offer
curl --request PATCH \
--url https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_updated_at": 1,
"name": "<string>",
"description": "<string>",
"price_in_cents": 1,
"percent_price": {
"percent": 50
},
"compare_at_price_in_cents": 1,
"image_url": "<string>",
"image_attribution": {
"source": "unsplash",
"photographerName": "<string>",
"photographerUrl": "<string>",
"photoUrl": "<string>"
},
"background_hex": "<string>",
"category": "<string>",
"link_url": "<string>",
"link_label": "<string>",
"highlights": [
"<string>"
],
"availability": {
"visibleFrom": 1,
"visibleUntil": 1,
"bookableFrom": 1,
"bookableUntil": 1
},
"targeting": {
"stayWindow": {},
"bookingChannels": [
"<string>"
],
"sources": [
"<string>"
],
"minNights": 1,
"maxNights": 1,
"minVacantNightsBeforeArrival": 1,
"minVacantNightsAfterDeparture": 1,
"listingIds": [
"<string>"
],
"listingGroupIds": [
"<string>"
],
"inboxTypeIds": [
"<string>"
]
},
"stripe_connection_id": "<string>",
"charge_every_night": true,
"max_per_order": 10,
"questions": [
{
"label": "<string>",
"required": true,
"id": "<string>"
}
],
"option_groups": [
{
"label": "<string>",
"required": true,
"options": [
{
"title": "<string>",
"price_in_cents": 123,
"id": "<string>",
"subtitle": "<string>",
"time_slot": "<string>"
}
],
"id": "<string>",
"blocks_adjacent_night": true,
"max_count": 123
}
],
"combinations_enabled": true,
"variants": [
{
"values": [
{
"group_id": "<string>",
"option_id": "<string>"
}
],
"price_in_cents": 1,
"active": true,
"image_url": "<string>",
"sort_order": 123
}
]
}
'import requests
url = "https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}"
payload = {
"expected_updated_at": 1,
"name": "<string>",
"description": "<string>",
"price_in_cents": 1,
"percent_price": { "percent": 50 },
"compare_at_price_in_cents": 1,
"image_url": "<string>",
"image_attribution": {
"source": "unsplash",
"photographerName": "<string>",
"photographerUrl": "<string>",
"photoUrl": "<string>"
},
"background_hex": "<string>",
"category": "<string>",
"link_url": "<string>",
"link_label": "<string>",
"highlights": ["<string>"],
"availability": {
"visibleFrom": 1,
"visibleUntil": 1,
"bookableFrom": 1,
"bookableUntil": 1
},
"targeting": {
"stayWindow": {},
"bookingChannels": ["<string>"],
"sources": ["<string>"],
"minNights": 1,
"maxNights": 1,
"minVacantNightsBeforeArrival": 1,
"minVacantNightsAfterDeparture": 1,
"listingIds": ["<string>"],
"listingGroupIds": ["<string>"],
"inboxTypeIds": ["<string>"]
},
"stripe_connection_id": "<string>",
"charge_every_night": True,
"max_per_order": 10,
"questions": [
{
"label": "<string>",
"required": True,
"id": "<string>"
}
],
"option_groups": [
{
"label": "<string>",
"required": True,
"options": [
{
"title": "<string>",
"price_in_cents": 123,
"id": "<string>",
"subtitle": "<string>",
"time_slot": "<string>"
}
],
"id": "<string>",
"blocks_adjacent_night": True,
"max_count": 123
}
],
"combinations_enabled": True,
"variants": [
{
"values": [
{
"group_id": "<string>",
"option_id": "<string>"
}
],
"price_in_cents": 1,
"active": True,
"image_url": "<string>",
"sort_order": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_updated_at: 1,
name: '<string>',
description: '<string>',
price_in_cents: 1,
percent_price: {percent: 50},
compare_at_price_in_cents: 1,
image_url: '<string>',
image_attribution: {
source: 'unsplash',
photographerName: '<string>',
photographerUrl: '<string>',
photoUrl: '<string>'
},
background_hex: '<string>',
category: '<string>',
link_url: '<string>',
link_label: '<string>',
highlights: ['<string>'],
availability: {visibleFrom: 1, visibleUntil: 1, bookableFrom: 1, bookableUntil: 1},
targeting: {
stayWindow: {},
bookingChannels: ['<string>'],
sources: ['<string>'],
minNights: 1,
maxNights: 1,
minVacantNightsBeforeArrival: 1,
minVacantNightsAfterDeparture: 1,
listingIds: ['<string>'],
listingGroupIds: ['<string>'],
inboxTypeIds: ['<string>']
},
stripe_connection_id: '<string>',
charge_every_night: true,
max_per_order: 10,
questions: [{label: '<string>', required: true, id: '<string>'}],
option_groups: [
{
label: '<string>',
required: true,
options: [
{
title: '<string>',
price_in_cents: 123,
id: '<string>',
subtitle: '<string>',
time_slot: '<string>'
}
],
id: '<string>',
blocks_adjacent_night: true,
max_count: 123
}
],
combinations_enabled: true,
variants: [
{
values: [{group_id: '<string>', option_id: '<string>'}],
price_in_cents: 1,
active: true,
image_url: '<string>',
sort_order: 123
}
]
})
};
fetch('https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}', 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.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_updated_at' => 1,
'name' => '<string>',
'description' => '<string>',
'price_in_cents' => 1,
'percent_price' => [
'percent' => 50
],
'compare_at_price_in_cents' => 1,
'image_url' => '<string>',
'image_attribution' => [
'source' => 'unsplash',
'photographerName' => '<string>',
'photographerUrl' => '<string>',
'photoUrl' => '<string>'
],
'background_hex' => '<string>',
'category' => '<string>',
'link_url' => '<string>',
'link_label' => '<string>',
'highlights' => [
'<string>'
],
'availability' => [
'visibleFrom' => 1,
'visibleUntil' => 1,
'bookableFrom' => 1,
'bookableUntil' => 1
],
'targeting' => [
'stayWindow' => [
],
'bookingChannels' => [
'<string>'
],
'sources' => [
'<string>'
],
'minNights' => 1,
'maxNights' => 1,
'minVacantNightsBeforeArrival' => 1,
'minVacantNightsAfterDeparture' => 1,
'listingIds' => [
'<string>'
],
'listingGroupIds' => [
'<string>'
],
'inboxTypeIds' => [
'<string>'
]
],
'stripe_connection_id' => '<string>',
'charge_every_night' => true,
'max_per_order' => 10,
'questions' => [
[
'label' => '<string>',
'required' => true,
'id' => '<string>'
]
],
'option_groups' => [
[
'label' => '<string>',
'required' => true,
'options' => [
[
'title' => '<string>',
'price_in_cents' => 123,
'id' => '<string>',
'subtitle' => '<string>',
'time_slot' => '<string>'
]
],
'id' => '<string>',
'blocks_adjacent_night' => true,
'max_count' => 123
]
],
'combinations_enabled' => true,
'variants' => [
[
'values' => [
[
'group_id' => '<string>',
'option_id' => '<string>'
]
],
'price_in_cents' => 1,
'active' => true,
'image_url' => '<string>',
'sort_order' => 123
]
]
]),
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.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}"
payload := strings.NewReader("{\n \"expected_updated_at\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price_in_cents\": 1,\n \"percent_price\": {\n \"percent\": 50\n },\n \"compare_at_price_in_cents\": 1,\n \"image_url\": \"<string>\",\n \"image_attribution\": {\n \"source\": \"unsplash\",\n \"photographerName\": \"<string>\",\n \"photographerUrl\": \"<string>\",\n \"photoUrl\": \"<string>\"\n },\n \"background_hex\": \"<string>\",\n \"category\": \"<string>\",\n \"link_url\": \"<string>\",\n \"link_label\": \"<string>\",\n \"highlights\": [\n \"<string>\"\n ],\n \"availability\": {\n \"visibleFrom\": 1,\n \"visibleUntil\": 1,\n \"bookableFrom\": 1,\n \"bookableUntil\": 1\n },\n \"targeting\": {\n \"stayWindow\": {},\n \"bookingChannels\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ],\n \"minNights\": 1,\n \"maxNights\": 1,\n \"minVacantNightsBeforeArrival\": 1,\n \"minVacantNightsAfterDeparture\": 1,\n \"listingIds\": [\n \"<string>\"\n ],\n \"listingGroupIds\": [\n \"<string>\"\n ],\n \"inboxTypeIds\": [\n \"<string>\"\n ]\n },\n \"stripe_connection_id\": \"<string>\",\n \"charge_every_night\": true,\n \"max_per_order\": 10,\n \"questions\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"id\": \"<string>\"\n }\n ],\n \"option_groups\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"options\": [\n {\n \"title\": \"<string>\",\n \"price_in_cents\": 123,\n \"id\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"time_slot\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"blocks_adjacent_night\": true,\n \"max_count\": 123\n }\n ],\n \"combinations_enabled\": true,\n \"variants\": [\n {\n \"values\": [\n {\n \"group_id\": \"<string>\",\n \"option_id\": \"<string>\"\n }\n ],\n \"price_in_cents\": 1,\n \"active\": true,\n \"image_url\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_updated_at\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price_in_cents\": 1,\n \"percent_price\": {\n \"percent\": 50\n },\n \"compare_at_price_in_cents\": 1,\n \"image_url\": \"<string>\",\n \"image_attribution\": {\n \"source\": \"unsplash\",\n \"photographerName\": \"<string>\",\n \"photographerUrl\": \"<string>\",\n \"photoUrl\": \"<string>\"\n },\n \"background_hex\": \"<string>\",\n \"category\": \"<string>\",\n \"link_url\": \"<string>\",\n \"link_label\": \"<string>\",\n \"highlights\": [\n \"<string>\"\n ],\n \"availability\": {\n \"visibleFrom\": 1,\n \"visibleUntil\": 1,\n \"bookableFrom\": 1,\n \"bookableUntil\": 1\n },\n \"targeting\": {\n \"stayWindow\": {},\n \"bookingChannels\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ],\n \"minNights\": 1,\n \"maxNights\": 1,\n \"minVacantNightsBeforeArrival\": 1,\n \"minVacantNightsAfterDeparture\": 1,\n \"listingIds\": [\n \"<string>\"\n ],\n \"listingGroupIds\": [\n \"<string>\"\n ],\n \"inboxTypeIds\": [\n \"<string>\"\n ]\n },\n \"stripe_connection_id\": \"<string>\",\n \"charge_every_night\": true,\n \"max_per_order\": 10,\n \"questions\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"id\": \"<string>\"\n }\n ],\n \"option_groups\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"options\": [\n {\n \"title\": \"<string>\",\n \"price_in_cents\": 123,\n \"id\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"time_slot\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"blocks_adjacent_night\": true,\n \"max_count\": 123\n }\n ],\n \"combinations_enabled\": true,\n \"variants\": [\n {\n \"values\": [\n {\n \"group_id\": \"<string>\",\n \"option_id\": \"<string>\"\n }\n ],\n \"price_in_cents\": 1,\n \"active\": true,\n \"image_url\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conduit.ai/v1/workspaces/{workspace_id}/portal-offers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_updated_at\": 1,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price_in_cents\": 1,\n \"percent_price\": {\n \"percent\": 50\n },\n \"compare_at_price_in_cents\": 1,\n \"image_url\": \"<string>\",\n \"image_attribution\": {\n \"source\": \"unsplash\",\n \"photographerName\": \"<string>\",\n \"photographerUrl\": \"<string>\",\n \"photoUrl\": \"<string>\"\n },\n \"background_hex\": \"<string>\",\n \"category\": \"<string>\",\n \"link_url\": \"<string>\",\n \"link_label\": \"<string>\",\n \"highlights\": [\n \"<string>\"\n ],\n \"availability\": {\n \"visibleFrom\": 1,\n \"visibleUntil\": 1,\n \"bookableFrom\": 1,\n \"bookableUntil\": 1\n },\n \"targeting\": {\n \"stayWindow\": {},\n \"bookingChannels\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ],\n \"minNights\": 1,\n \"maxNights\": 1,\n \"minVacantNightsBeforeArrival\": 1,\n \"minVacantNightsAfterDeparture\": 1,\n \"listingIds\": [\n \"<string>\"\n ],\n \"listingGroupIds\": [\n \"<string>\"\n ],\n \"inboxTypeIds\": [\n \"<string>\"\n ]\n },\n \"stripe_connection_id\": \"<string>\",\n \"charge_every_night\": true,\n \"max_per_order\": 10,\n \"questions\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"id\": \"<string>\"\n }\n ],\n \"option_groups\": [\n {\n \"label\": \"<string>\",\n \"required\": true,\n \"options\": [\n {\n \"title\": \"<string>\",\n \"price_in_cents\": 123,\n \"id\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"time_slot\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"blocks_adjacent_night\": true,\n \"max_count\": 123\n }\n ],\n \"combinations_enabled\": true,\n \"variants\": [\n {\n \"values\": [\n {\n \"group_id\": \"<string>\",\n \"option_id\": \"<string>\"\n }\n ],\n \"price_in_cents\": 1,\n \"active\": true,\n \"image_url\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"workspace_id": "<string>",
"name": "<string>",
"description": "<string>",
"price_in_cents": 123,
"currency": "<string>",
"active": true,
"created_at": 123,
"updated_at": 123,
"percent_price": {
"percent": 50,
"of": "totalPrice"
},
"compare_at_price_in_cents": 123,
"image_url": "<string>",
"image_attribution": {
"source": "unsplash",
"photographerName": "<string>",
"photographerUrl": "<string>",
"photoUrl": "<string>"
},
"background_hex": "<string>",
"category": "<string>",
"kind": "purchase",
"option_groups": [
{
"id": "<string>",
"label": "<string>",
"type": "single",
"required": true,
"options": [
{
"id": "<string>",
"title": "<string>",
"price_in_cents": 123,
"subtitle": "<string>",
"percent_price": {
"percent": 50,
"of": "totalPrice"
},
"time_slot": "<string>"
}
],
"input_type": "text",
"reservation_action": "check_in",
"blocks_adjacent_night": true,
"max_count": 123
}
],
"combinations_enabled": true,
"variants": [
{
"values": [
{
"group_id": "<string>",
"option_id": "<string>"
}
],
"price_in_cents": 1,
"active": true,
"id": "<string>",
"image_url": "<string>",
"sort_order": 123
}
],
"price_unit": "per_stay",
"charge_every_night": true,
"date_selection": "single",
"max_per_order": 123,
"questions": [
{
"id": "<string>",
"label": "<string>",
"required": true
}
],
"stripe_connection_id": "<string>",
"link_url": "<string>",
"link_label": "<string>",
"highlights": [
"<string>"
],
"availability": {
"visibleFrom": 1,
"visibleUntil": 1,
"bookableFrom": 1,
"bookableUntil": 1
},
"targeting": {
"stayWindow": {
"start": {
"amount": 1,
"unit": "hours",
"anchor": "checkIn"
},
"end": {
"amount": 1,
"unit": "hours",
"anchor": "checkIn"
}
},
"bookingChannels": [
"<string>"
],
"bookingChannelMode": "include",
"sources": [
"<string>"
],
"sourceMode": "include",
"minNights": 1,
"maxNights": 1,
"minVacantNightsBeforeArrival": 1,
"minVacantNightsAfterDeparture": 1,
"listingIds": [
"<string>"
],
"listingGroupIds": [
"<string>"
],
"inboxTypeIds": [
"<string>"
],
"inboxMode": "include",
"customAttributeConditions": {
"combinator": "all",
"conditions": [
{
"attributeId": "<string>",
"operator": "has_value"
}
]
}
},
"sku": "<string>"
}
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}{
"error": "Invalid workspace id"
}Authorizations
Path Parameters
Body
application/json
Was this page helpful?