cURL
curl --request POST \
--url https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"transaction_type": "payment",
"amount": 50,
"method": "cash",
"payment_method_slug": "visa",
"description": "External payment"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction"
payload = {
"transaction_type": "payment",
"amount": 50,
"method": "cash",
"payment_method_slug": "visa",
"description": "External payment"
}
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({
transaction_type: 'payment',
amount: 50,
method: 'cash',
payment_method_slug: 'visa',
description: 'External payment'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction', 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}/external-transaction",
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([
'transaction_type' => 'payment',
'amount' => 50,
'method' => 'cash',
'payment_method_slug' => 'visa',
'description' => 'External payment'
]),
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}/external-transaction"
payload := strings.NewReader("{\n \"transaction_type\": \"payment\",\n \"amount\": 50,\n \"method\": \"cash\",\n \"payment_method_slug\": \"visa\",\n \"description\": \"External payment\"\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/bookings/{bookingId}/external-transaction")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_type\": \"payment\",\n \"amount\": 50,\n \"method\": \"cash\",\n \"payment_method_slug\": \"visa\",\n \"description\": \"External payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction")
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 \"transaction_type\": \"payment\",\n \"amount\": 50,\n \"method\": \"cash\",\n \"payment_method_slug\": \"visa\",\n \"description\": \"External payment\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "ld9o8tpo7tyld79qxdk6sgikl5i4xjpj",
"booking_id": "gxwts76a2qpoxf2rdtxy35etfk6xyd1m",
"transaction_type": "payment",
"amount": 50,
"currency": "EUR",
"method": "cash",
"payment_method_slug": "visa",
"description": "External payment",
"original_external_payment_id": null
}
}Bookings
Post booking external transaction
Create an external payment for a booking
POST
/
bookings
/
{bookingId}
/
external-transaction
cURL
curl --request POST \
--url https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction \
--header 'Content-Type: application/json' \
--header 'integration_id: <api-key>' \
--header 'secret: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"transaction_type": "payment",
"amount": 50,
"method": "cash",
"payment_method_slug": "visa",
"description": "External payment"
}
'import requests
url = "https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction"
payload = {
"transaction_type": "payment",
"amount": 50,
"method": "cash",
"payment_method_slug": "visa",
"description": "External payment"
}
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({
transaction_type: 'payment',
amount: 50,
method: 'cash',
payment_method_slug: 'visa',
description: 'External payment'
})
};
fetch('https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction', 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}/external-transaction",
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([
'transaction_type' => 'payment',
'amount' => 50,
'method' => 'cash',
'payment_method_slug' => 'visa',
'description' => 'External payment'
]),
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}/external-transaction"
payload := strings.NewReader("{\n \"transaction_type\": \"payment\",\n \"amount\": 50,\n \"method\": \"cash\",\n \"payment_method_slug\": \"visa\",\n \"description\": \"External payment\"\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/bookings/{bookingId}/external-transaction")
.header("integration_id", "<api-key>")
.header("secret", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_type\": \"payment\",\n \"amount\": 50,\n \"method\": \"cash\",\n \"payment_method_slug\": \"visa\",\n \"description\": \"External payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-alpha.fourvenues.com/integrations/bookings/{bookingId}/external-transaction")
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 \"transaction_type\": \"payment\",\n \"amount\": 50,\n \"method\": \"cash\",\n \"payment_method_slug\": \"visa\",\n \"description\": \"External payment\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "ld9o8tpo7tyld79qxdk6sgikl5i4xjpj",
"booking_id": "gxwts76a2qpoxf2rdtxy35etfk6xyd1m",
"transaction_type": "payment",
"amount": 50,
"currency": "EUR",
"method": "cash",
"payment_method_slug": "visa",
"description": "External payment",
"original_external_payment_id": null
}
}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
Available options:
payment Example:
"payment"
Example:
50
Available options:
transfer, cash, external-card, external-online, check, other Example:
"cash"
Available options:
visa, mastercard, amex Example:
"visa"
Example:
"External payment"
⌘I