cURL
curl --request PUT \
--url https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"products": [
{
"_id": "ylgla79ll0000fosz51sl31g5q09Adij",
"amount": 2,
"name": "VIP Bottle 70cl",
"total_price": 200,
"unit_price": 100
}
],
"payments": [
{
"amount": 100,
"type": "cash"
}
],
"ticket_total": 100,
"pos_total_service_charge": 200,
"pos_total_tips": 50
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products"
payload = {
"products": [
{
"_id": "ylgla79ll0000fosz51sl31g5q09Adij",
"amount": 2,
"name": "VIP Bottle 70cl",
"total_price": 200,
"unit_price": 100
}
],
"payments": [
{
"amount": 100,
"type": "cash"
}
],
"ticket_total": 100,
"pos_total_service_charge": 200,
"pos_total_tips": 50
}
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
products: [
{
_id: 'ylgla79ll0000fosz51sl31g5q09Adij',
amount: 2,
name: 'VIP Bottle 70cl',
total_price: 200,
unit_price: 100
}
],
payments: [{amount: 100, type: 'cash'}],
ticket_total: 100,
pos_total_service_charge: 200,
pos_total_tips: 50
})
};
fetch('https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products', 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/bookings/{bookingId}/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'products' => [
[
'_id' => 'ylgla79ll0000fosz51sl31g5q09Adij',
'amount' => 2,
'name' => 'VIP Bottle 70cl',
'total_price' => 200,
'unit_price' => 100
]
],
'payments' => [
[
'amount' => 100,
'type' => 'cash'
]
],
'ticket_total' => 100,
'pos_total_service_charge' => 200,
'pos_total_tips' => 50
]),
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/bookings/{bookingId}/products"
payload := strings.NewReader("{\n \"products\": [\n {\n \"_id\": \"ylgla79ll0000fosz51sl31g5q09Adij\",\n \"amount\": 2,\n \"name\": \"VIP Bottle 70cl\",\n \"total_price\": 200,\n \"unit_price\": 100\n }\n ],\n \"payments\": [\n {\n \"amount\": 100,\n \"type\": \"cash\"\n }\n ],\n \"ticket_total\": 100,\n \"pos_total_service_charge\": 200,\n \"pos_total_tips\": 50\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"_id\": \"ylgla79ll0000fosz51sl31g5q09Adij\",\n \"amount\": 2,\n \"name\": \"VIP Bottle 70cl\",\n \"total_price\": 200,\n \"unit_price\": 100\n }\n ],\n \"payments\": [\n {\n \"amount\": 100,\n \"type\": \"cash\"\n }\n ],\n \"ticket_total\": 100,\n \"pos_total_service_charge\": 200,\n \"pos_total_tips\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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 \"products\": [\n {\n \"_id\": \"ylgla79ll0000fosz51sl31g5q09Adij\",\n \"amount\": 2,\n \"name\": \"VIP Bottle 70cl\",\n \"total_price\": 200,\n \"unit_price\": 100\n }\n ],\n \"payments\": [\n {\n \"amount\": 100,\n \"type\": \"cash\"\n }\n ],\n \"ticket_total\": 100,\n \"pos_total_service_charge\": 200,\n \"pos_total_tips\": 50\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Bookings
Put bookings products
Update the products of a booking
PUT
/
bookings
/
{bookingId}
/
products
cURL
curl --request PUT \
--url https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"products": [
{
"_id": "ylgla79ll0000fosz51sl31g5q09Adij",
"amount": 2,
"name": "VIP Bottle 70cl",
"total_price": 200,
"unit_price": 100
}
],
"payments": [
{
"amount": 100,
"type": "cash"
}
],
"ticket_total": 100,
"pos_total_service_charge": 200,
"pos_total_tips": 50
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products"
payload = {
"products": [
{
"_id": "ylgla79ll0000fosz51sl31g5q09Adij",
"amount": 2,
"name": "VIP Bottle 70cl",
"total_price": 200,
"unit_price": 100
}
],
"payments": [
{
"amount": 100,
"type": "cash"
}
],
"ticket_total": 100,
"pos_total_service_charge": 200,
"pos_total_tips": 50
}
headers = {
"integration_id": "<api-key>",
"secret": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
integration_id: '<api-key>',
secret: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
products: [
{
_id: 'ylgla79ll0000fosz51sl31g5q09Adij',
amount: 2,
name: 'VIP Bottle 70cl',
total_price: 200,
unit_price: 100
}
],
payments: [{amount: 100, type: 'cash'}],
ticket_total: 100,
pos_total_service_charge: 200,
pos_total_tips: 50
})
};
fetch('https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products', 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/bookings/{bookingId}/products",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'products' => [
[
'_id' => 'ylgla79ll0000fosz51sl31g5q09Adij',
'amount' => 2,
'name' => 'VIP Bottle 70cl',
'total_price' => 200,
'unit_price' => 100
]
],
'payments' => [
[
'amount' => 100,
'type' => 'cash'
]
],
'ticket_total' => 100,
'pos_total_service_charge' => 200,
'pos_total_tips' => 50
]),
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/bookings/{bookingId}/products"
payload := strings.NewReader("{\n \"products\": [\n {\n \"_id\": \"ylgla79ll0000fosz51sl31g5q09Adij\",\n \"amount\": 2,\n \"name\": \"VIP Bottle 70cl\",\n \"total_price\": 200,\n \"unit_price\": 100\n }\n ],\n \"payments\": [\n {\n \"amount\": 100,\n \"type\": \"cash\"\n }\n ],\n \"ticket_total\": 100,\n \"pos_total_service_charge\": 200,\n \"pos_total_tips\": 50\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"products\": [\n {\n \"_id\": \"ylgla79ll0000fosz51sl31g5q09Adij\",\n \"amount\": 2,\n \"name\": \"VIP Bottle 70cl\",\n \"total_price\": 200,\n \"unit_price\": 100\n }\n ],\n \"payments\": [\n {\n \"amount\": 100,\n \"type\": \"cash\"\n }\n ],\n \"ticket_total\": 100,\n \"pos_total_service_charge\": 200,\n \"pos_total_tips\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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 \"products\": [\n {\n \"_id\": \"ylgla79ll0000fosz51sl31g5q09Adij\",\n \"amount\": 2,\n \"name\": \"VIP Bottle 70cl\",\n \"total_price\": 200,\n \"unit_price\": 100\n }\n ],\n \"payments\": [\n {\n \"amount\": 100,\n \"type\": \"cash\"\n }\n ],\n \"ticket_total\": 100,\n \"pos_total_service_charge\": 200,\n \"pos_total_tips\": 50\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
Identifier of the integration (Auth v1)
Secret of the organization (Auth v1)
API key (Auth v2)
Path Parameters
Id of the booking
Body
application/json
Body of the request
Response
HTTP OK
Example:
true
⌘I