cURL
curl --request GET \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code} \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}"
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {integration_id: '<api-key>', secret: '<api-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}', 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/by-code/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("integration_id", "<api-key>")
req.Header.Add("secret", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["integration_id"] = '<api-key>'
request["secret"] = '<api-key>'
request["x-api-key"] = '<api-key>'
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"
}
}Discount Codes
Get discount code by code
Get a single discount code by its code. Same scope as the list: without event_id it looks up the organization-level code; with event_id it looks up the code scoped to that event. If not found in the event but the code exists at organization level, returns 404 with a body { reason: "DISCOUNT_CODE_NOT_ASSOCIATED_TO_EVENT", organization_level: true, discount_code_id, discount_code }. Returns a plain 404 if no code matches at all.
GET
/
discount-codes
/
by-code
/
{code}
cURL
curl --request GET \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code} \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}"
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {integration_id: '<api-key>', secret: '<api-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}', 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/by-code/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("integration_id", "<api-key>")
req.Header.Add("secret", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/by-code/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["integration_id"] = '<api-key>'
request["secret"] = '<api-key>'
request["x-api-key"] = '<api-key>'
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
The discount code string
Query Parameters
Event id. With it, only the event-scoped code is returned; without it, the organization-level one.