curl --request POST \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/bookings \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"code": "SUMMER20",
"description": "Summer promotion",
"active": true,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"max_uses": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"single_use": false,
"expires_at": "2026-12-31T23:59:59.000Z"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/bookings"
payload = {
"code": "SUMMER20",
"description": "Summer promotion",
"active": True,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"max_uses": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"single_use": False,
"expires_at": "2026-12-31T23:59:59.000Z"
}
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'SUMMER20',
description: 'Summer promotion',
active: true,
fixed_amount: 0,
percentage: 20,
min_amount: 0,
max_uses: 0,
event_id: 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
single_use: false,
expires_at: '2026-12-31T23:59:59.000Z'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/bookings', 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-alpha.fourvenues.com/integrations/discount-codes/bookings",
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([
'code' => 'SUMMER20',
'description' => 'Summer promotion',
'active' => true,
'fixed_amount' => 0,
'percentage' => 20,
'min_amount' => 0,
'max_uses' => 0,
'event_id' => 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
'single_use' => false,
'expires_at' => '2026-12-31T23:59:59.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"integration_id: <api-key>",
"secret: <api-key>",
"x-api-key: <api-key>"
],
]);
$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-alpha.fourvenues.com/integrations/discount-codes/bookings"
payload := strings.NewReader("{\n \"code\": \"SUMMER20\",\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"max_uses\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"single_use\": false,\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("integration_id", "<api-key>")
req.Header.Add("secret", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
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-alpha.fourvenues.com/integrations/discount-codes/bookings")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"SUMMER20\",\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"max_uses\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"single_use\": false,\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["integration_id"] = '<api-key>'
request["secret"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"SUMMER20\",\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"max_uses\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"single_use\": false,\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "dc4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"organization_id": "or4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"code": "SUMMER20",
"description": "Summer promotion",
"type": "tickets",
"active": true,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"min_quantity": 0,
"max_quantity": 0,
"max_uses": 0,
"max_products": 0,
"expires_at": "2026-12-31T23:59:59.000Z"
}
}Post discount codes bookings
Create a booking (reservas) discount code at organization or event level. Booking codes validate at event level only: no rate association and no quantity/sales limits.
curl --request POST \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/bookings \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"code": "SUMMER20",
"description": "Summer promotion",
"active": true,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"max_uses": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"single_use": false,
"expires_at": "2026-12-31T23:59:59.000Z"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/bookings"
payload = {
"code": "SUMMER20",
"description": "Summer promotion",
"active": True,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"max_uses": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"single_use": False,
"expires_at": "2026-12-31T23:59:59.000Z"
}
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'SUMMER20',
description: 'Summer promotion',
active: true,
fixed_amount: 0,
percentage: 20,
min_amount: 0,
max_uses: 0,
event_id: 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
single_use: false,
expires_at: '2026-12-31T23:59:59.000Z'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/bookings', 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-alpha.fourvenues.com/integrations/discount-codes/bookings",
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([
'code' => 'SUMMER20',
'description' => 'Summer promotion',
'active' => true,
'fixed_amount' => 0,
'percentage' => 20,
'min_amount' => 0,
'max_uses' => 0,
'event_id' => 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
'single_use' => false,
'expires_at' => '2026-12-31T23:59:59.000Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"integration_id: <api-key>",
"secret: <api-key>",
"x-api-key: <api-key>"
],
]);
$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-alpha.fourvenues.com/integrations/discount-codes/bookings"
payload := strings.NewReader("{\n \"code\": \"SUMMER20\",\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"max_uses\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"single_use\": false,\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("integration_id", "<api-key>")
req.Header.Add("secret", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
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-alpha.fourvenues.com/integrations/discount-codes/bookings")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"SUMMER20\",\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"max_uses\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"single_use\": false,\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/bookings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["integration_id"] = '<api-key>'
request["secret"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"SUMMER20\",\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"max_uses\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"single_use\": false,\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "dc4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"organization_id": "or4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"code": "SUMMER20",
"description": "Summer promotion",
"type": "tickets",
"active": true,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"min_quantity": 0,
"max_quantity": 0,
"max_uses": 0,
"max_products": 0,
"expires_at": "2026-12-31T23:59:59.000Z"
}
}Authorizations
Identifier of the integration (Auth v1)
Secret of the organization (Auth v1)
API key (Auth v2)
Body
Booking discount code to create.
Discount code value. Trimmed and normalized to uppercase before saving (codes are case-insensitive). Must not contain "/". Maximum 50 characters. Optional: when omitted, a unique code is auto-generated.
"SUMMER20"
Discount code description.
"Summer promotion"
Whether the discount code is active. Defaults to true.
true
Fixed discount amount. Defaults to 0.
0
Percentage discount between 0 and 100. Defaults to 0. Cannot be greater than 0 when fixed_amount is greater than 0.
0 <= x <= 10020
Minimum booking price required to apply the discount. Defaults to 0.
0
Maximum number of times (transactions) the discount code can be used. Defaults to 0.
0
Event identifier. When omitted, the discount code is created at organization level.
"el4gr63f00xkq01i1d8jh5ohuzaZhvoE"
Convenience flag. When true, forces max_uses to 1 (single redemption). Defaults to false.
false
Expiration date in ISO 8601 format. Must be a valid future date. Optional; when omitted the discount code does not expire.
"2026-12-31T23:59:59.000Z"