curl --request PATCH \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId} \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"description": "Summer promotion",
"active": true,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"min_quantity": 0,
"max_quantity": 0,
"max_uses": 0,
"max_products": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"rate_ids": [
"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE"
],
"expires_at": "2026-12-31T23:59:59.000Z"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId}"
payload = {
"description": "Summer promotion",
"active": True,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"min_quantity": 0,
"max_quantity": 0,
"max_uses": 0,
"max_products": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"rate_ids": ["tr4gr63f00xkq01i1d8jh5ohuzaZhvoE"],
"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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Summer promotion',
active: true,
fixed_amount: 0,
percentage: 20,
min_amount: 0,
min_quantity: 0,
max_quantity: 0,
max_uses: 0,
max_products: 0,
event_id: 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
rate_ids: ['tr4gr63f00xkq01i1d8jh5ohuzaZhvoE'],
expires_at: '2026-12-31T23:59:59.000Z'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId}', 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/tickets/{discountCodeId}",
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([
'description' => 'Summer promotion',
'active' => true,
'fixed_amount' => 0,
'percentage' => 20,
'min_amount' => 0,
'min_quantity' => 0,
'max_quantity' => 0,
'max_uses' => 0,
'max_products' => 0,
'event_id' => 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
'rate_ids' => [
'tr4gr63f00xkq01i1d8jh5ohuzaZhvoE'
],
'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/tickets/{discountCodeId}"
payload := strings.NewReader("{\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"min_quantity\": 0,\n \"max_quantity\": 0,\n \"max_uses\": 0,\n \"max_products\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"rate_ids\": [\n \"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ],\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId}")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"min_quantity\": 0,\n \"max_quantity\": 0,\n \"max_uses\": 0,\n \"max_products\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"rate_ids\": [\n \"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ],\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/tickets/{discountCodeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"min_quantity\": 0,\n \"max_quantity\": 0,\n \"max_uses\": 0,\n \"max_products\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"rate_ids\": [\n \"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ],\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"
}
}Patch discount codes tickets
Update an existing ticket (entradas) discount code by id. The code type and the code value are fixed at creation: the id must belong to a ticket code. rate_ids can only be updated on event-scoped codes and requires event_id.
curl --request PATCH \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId} \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"description": "Summer promotion",
"active": true,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"min_quantity": 0,
"max_quantity": 0,
"max_uses": 0,
"max_products": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"rate_ids": [
"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE"
],
"expires_at": "2026-12-31T23:59:59.000Z"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId}"
payload = {
"description": "Summer promotion",
"active": True,
"fixed_amount": 0,
"percentage": 20,
"min_amount": 0,
"min_quantity": 0,
"max_quantity": 0,
"max_uses": 0,
"max_products": 0,
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"rate_ids": ["tr4gr63f00xkq01i1d8jh5ohuzaZhvoE"],
"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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
description: 'Summer promotion',
active: true,
fixed_amount: 0,
percentage: 20,
min_amount: 0,
min_quantity: 0,
max_quantity: 0,
max_uses: 0,
max_products: 0,
event_id: 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
rate_ids: ['tr4gr63f00xkq01i1d8jh5ohuzaZhvoE'],
expires_at: '2026-12-31T23:59:59.000Z'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId}', 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/tickets/{discountCodeId}",
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([
'description' => 'Summer promotion',
'active' => true,
'fixed_amount' => 0,
'percentage' => 20,
'min_amount' => 0,
'min_quantity' => 0,
'max_quantity' => 0,
'max_uses' => 0,
'max_products' => 0,
'event_id' => 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE',
'rate_ids' => [
'tr4gr63f00xkq01i1d8jh5ohuzaZhvoE'
],
'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/tickets/{discountCodeId}"
payload := strings.NewReader("{\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"min_quantity\": 0,\n \"max_quantity\": 0,\n \"max_uses\": 0,\n \"max_products\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"rate_ids\": [\n \"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ],\n \"expires_at\": \"2026-12-31T23:59:59.000Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api-alpha.fourvenues.com/integrations/discount-codes/tickets/{discountCodeId}")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"min_quantity\": 0,\n \"max_quantity\": 0,\n \"max_uses\": 0,\n \"max_products\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"rate_ids\": [\n \"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ],\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/tickets/{discountCodeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 \"description\": \"Summer promotion\",\n \"active\": true,\n \"fixed_amount\": 0,\n \"percentage\": 20,\n \"min_amount\": 0,\n \"min_quantity\": 0,\n \"max_quantity\": 0,\n \"max_uses\": 0,\n \"max_products\": 0,\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"rate_ids\": [\n \"tr4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ],\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)
Path Parameters
Discount code identifier.
Body
Fields to update. At least one field is required.
Discount code description.
"Summer promotion"
Whether the discount code is active.
true
Fixed discount amount.
0
Percentage discount between 0 and 100. Cannot be greater than 0 when fixed_amount is greater than 0.
0 <= x <= 10020
Minimum amount constraint.
0
Minimum quantity constraint.
0
Maximum quantity constraint. Must be greater than or equal to min_quantity when both are provided.
0
Maximum number of times (transactions) the discount code can be used.
0
Maximum number of products that can be discounted with this code across all purchases.
0
Event identifier of the discount code. Required when updating rate_ids on event-scoped codes.
"el4gr63f00xkq01i1d8jh5ohuzaZhvoE"
Ticket rate identifiers to associate. Replaces current associations. Requires event_id and an event-scoped discount code.
100["tr4gr63f00xkq01i1d8jh5ohuzaZhvoE"]
Expiration date in ISO 8601 format. Must be a valid future date.
"2026-12-31T23:59:59.000Z"