cURL
curl --request DELETE \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/ \
--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"
]
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/"
payload = { "discount_code_ids": ["dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"] }
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({discount_code_ids: ['dc4gr63f00xkq01i1d8jh5ohuzaZhvoE']})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/', 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/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'discount_code_ids' => [
'dc4gr63f00xkq01i1d8jh5ohuzaZhvoE'
]
]),
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/"
payload := strings.NewReader("{\n \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api-alpha.fourvenues.com/integrations/discount-codes/")
.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 ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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 ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"deleted_count": 1,
"deleted_ids": [
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"
],
"not_found_ids": [
"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"
]
}
}Discount Codes
Delete discount codes
Delete one or more discount codes by id (scoped to the organization). Already-deleted or non-existing ids are ignored. The codes are also detached from any rate that references them.
DELETE
/
discount-codes
/
cURL
curl --request DELETE \
--url https://api-alpha.fourvenues.com/integrations/discount-codes/ \
--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"
]
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/discount-codes/"
payload = { "discount_code_ids": ["dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"] }
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({discount_code_ids: ['dc4gr63f00xkq01i1d8jh5ohuzaZhvoE']})
};
fetch('https://api-alpha.fourvenues.com/integrations/discount-codes/', 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/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'discount_code_ids' => [
'dc4gr63f00xkq01i1d8jh5ohuzaZhvoE'
]
]),
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/"
payload := strings.NewReader("{\n \"discount_code_ids\": [\n \"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE\"\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api-alpha.fourvenues.com/integrations/discount-codes/")
.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 ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/discount-codes/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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 ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"deleted_count": 1,
"deleted_ids": [
"dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"
],
"not_found_ids": [
"dc4gr63f01xkq01i1d8jh5ohuzaZhvoF"
]
}
}Authorizations
Identifier of the integration (Auth v1)
Secret of the organization (Auth v1)
API key (Auth v2)
Body
application/json
Discount code ids to delete.
Discount code ids to delete. Between 1 and 100 items.
Required array length:
1 - 100 elementsExample:
["dc4gr63f00xkq01i1d8jh5ohuzaZhvoE"]