cURL
curl --request POST \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/import \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"discount_code_ids": [
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"
],
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/import"
payload = {
"discount_code_ids": ["dc4gr63f00xkq01i1d8jh5ohuzaZhvoE", "dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"],
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE"
}
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({
discount_code_ids: ['dc4gr63f00xkq01i1d8jh5ohuzaZhvoE', 'dc4gr63f01xkq01i1d8jh5ohuzaZhvoF'],
event_id: 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/import', 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/import",
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([
'discount_code_ids' => [
'dc4gr63f00xkq01i1d8jh5ohuzaZhvoE',
'dc4gr63f01xkq01i1d8jh5ohuzaZhvoF'
],
'event_id' => 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE'
]),
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/import"
payload := strings.NewReader("{\n \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF\"\n ],\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\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/import")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF\"\n ],\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/import")
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 \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF\"\n ],\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"inserted_count": 2,
"inserted_ids": [
"dc4gr63f02xkq01i1d8jh5ohuzaZhvoG",
"dc4gr63f03xkq01i1d8jh5ohuzaZhvoH"
],
"skipped_ids": [
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"
]
}
}Discount Codes
Post discount codes import
Import organization-level discount codes into an event. All codes must belong to the organization and have a parent reference. Already imported codes are skipped. Duplicate IDs in the request are ignored. Fails when a code with the same value already exists in the target event.
POST
/
discount-codes
/
import
cURL
curl --request POST \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/import \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"discount_code_ids": [
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"
],
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/import"
payload = {
"discount_code_ids": ["dc4gr63f00xkq01i1d8jh5ohuzaZhvoE", "dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"],
"event_id": "el4gr63f00xkq01i1d8jh5ohuzaZhvoE"
}
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({
discount_code_ids: ['dc4gr63f00xkq01i1d8jh5ohuzaZhvoE', 'dc4gr63f01xkq01i1d8jh5ohuzaZhvoF'],
event_id: 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/import', 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/import",
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([
'discount_code_ids' => [
'dc4gr63f00xkq01i1d8jh5ohuzaZhvoE',
'dc4gr63f01xkq01i1d8jh5ohuzaZhvoF'
],
'event_id' => 'el4gr63f00xkq01i1d8jh5ohuzaZhvoE'
]),
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/import"
payload := strings.NewReader("{\n \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF\"\n ],\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\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/import")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF\"\n ],\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/import")
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 \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\",\n \"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF\"\n ],\n \"event_id\": \"el4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"inserted_count": 2,
"inserted_ids": [
"dc4gr63f02xkq01i1d8jh5ohuzaZhvoG",
"dc4gr63f03xkq01i1d8jh5ohuzaZhvoH"
],
"skipped_ids": [
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"
]
}
}Authorizations
Identifier of the integration (Auth v1)
Secret of the organization (Auth v1)
API key (Auth v2)
Body
application/json
Discount codes to import and target event.
Organization-level discount code identifiers to import. Between 1 and 100 items.
Required array length:
1 - 100 elementsExample:
[
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE",
"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"
]
Target event identifier.
Example:
"el4gr63f00xkq01i1d8jh5ohuzaZhvoE"