SDK
import { createAdminClient } from "@voyant-travel/admin-client";
const client = createAdminClient({ baseUrl: "https://app.example.com", auth: { type: "apiKey", apiKey: process.env.VOYANT_ADMIN_TOKEN } });
const payment = await client.finance.payments.record({ id: "<id>" }, {
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
});curl --request POST \
--url https://app.example.com/v1/admin/finance/invoices/<id>/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
}'const response = await fetch("https://app.example.com/v1/admin/finance/invoices/<id>/payments", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://app.example.com/v1/admin/finance/invoices/<id>/payments",
headers={
"Authorization": "Bearer <token>"
},
json={
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{operatorDomain}/v1/admin/finance/invoices/{id}/payments",
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([
'amountCents' => 1,
'currency' => '<string>',
'paidAt' => '2023-11-07T05:31:56Z',
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{operatorDomain}/v1/admin/finance/invoices/{id}/payments"
payload := strings.NewReader("{\n \"amountCents\": 1,\n \"currency\": \"<string>\",\n \"paidAt\": \"2023-11-07T05:31:56Z\",\n \"reference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{operatorDomain}/v1/admin/finance/invoices/{id}/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountCents\": 1,\n \"currency\": \"<string>\",\n \"paidAt\": \"2023-11-07T05:31:56Z\",\n \"reference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{operatorDomain}/v1/admin/finance/invoices/{id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCents\": 1,\n \"currency\": \"<string>\",\n \"paidAt\": \"2023-11-07T05:31:56Z\",\n \"reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "pay_01HZX...",
"status": "completed",
"amountCents": 119000,
"currency": "EUR",
"invoiceId": "<string>",
"bookingId": "<string>",
"method": "bank_transfer",
"paidAt": "2023-11-07T05:31:56Z",
"reference": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}Finance
Record a payment on an invoice
Record a manual or external payment against an invoice.
POST
/
v1
/
admin
/
finance
/
invoices
/
{id}
/
payments
SDK
import { createAdminClient } from "@voyant-travel/admin-client";
const client = createAdminClient({ baseUrl: "https://app.example.com", auth: { type: "apiKey", apiKey: process.env.VOYANT_ADMIN_TOKEN } });
const payment = await client.finance.payments.record({ id: "<id>" }, {
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
});curl --request POST \
--url https://app.example.com/v1/admin/finance/invoices/<id>/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
}'const response = await fetch("https://app.example.com/v1/admin/finance/invoices/<id>/payments", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://app.example.com/v1/admin/finance/invoices/<id>/payments",
headers={
"Authorization": "Bearer <token>"
},
json={
"method": "card",
"amountCents": 123,
"currency": "<string>",
"paidAt": "<string>",
"reference": "<string>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{operatorDomain}/v1/admin/finance/invoices/{id}/payments",
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([
'amountCents' => 1,
'currency' => '<string>',
'paidAt' => '2023-11-07T05:31:56Z',
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{operatorDomain}/v1/admin/finance/invoices/{id}/payments"
payload := strings.NewReader("{\n \"amountCents\": 1,\n \"currency\": \"<string>\",\n \"paidAt\": \"2023-11-07T05:31:56Z\",\n \"reference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{operatorDomain}/v1/admin/finance/invoices/{id}/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountCents\": 1,\n \"currency\": \"<string>\",\n \"paidAt\": \"2023-11-07T05:31:56Z\",\n \"reference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{operatorDomain}/v1/admin/finance/invoices/{id}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCents\": 1,\n \"currency\": \"<string>\",\n \"paidAt\": \"2023-11-07T05:31:56Z\",\n \"reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "pay_01HZX...",
"status": "completed",
"amountCents": 119000,
"currency": "EUR",
"invoiceId": "<string>",
"bookingId": "<string>",
"method": "bank_transfer",
"paidAt": "2023-11-07T05:31:56Z",
"reference": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"details": {}
}Authorizations
Staff session or API token issued by your Voyant app.
Path Parameters
Body
application/json
Response
Created payment
Show child attributes
Show child attributes
⌘I