Get refund rules for a booking
curl --request GET \
--url https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules \
--header 'x-api-key: <api-key>'import requests
url = "https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules', 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://staging.api.prexsell.com/v2/bookings/{id}/refund-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"refundRules": [
{
"orderId": "ord_abc",
"rules": [
{
"id": "rule_1",
"hours": 24,
"amount": 800
},
{
"id": "rule_2",
"hours": 6,
"amount": 400
}
]
},
{
"orderId": "ord_def",
"rules": [
{
"id": "rule_3",
"hours": 24,
"amount": 800
}
]
}
]
}
}{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}{
"errors": [
{
"message": "RESOURCE_NOT_FOUND",
"errorCode": "NOT_FOUND"
}
]
}Bookings
Get refund rules for a booking
Returns refund rules for each partner-owned order within a booking. Authenticated via the api-key header; data scoped to the callerโs partner. Returns 404 when the booking does not exist or does not belong to the actorโs partner. Fixes legacy defect 3 (IDOR) and defect 4 (500 on unknown ID).
GET
/
v2
/
bookings
/
{id}
/
refund-rules
Get refund rules for a booking
curl --request GET \
--url https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules \
--header 'x-api-key: <api-key>'import requests
url = "https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules', 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://staging.api.prexsell.com/v2/bookings/{id}/refund-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.prexsell.com/v2/bookings/{id}/refund-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"refundRules": [
{
"orderId": "ord_abc",
"rules": [
{
"id": "rule_1",
"hours": 24,
"amount": 800
},
{
"id": "rule_2",
"hours": 6,
"amount": 400
}
]
},
{
"orderId": "ord_def",
"rules": [
{
"id": "rule_3",
"hours": 24,
"amount": 800
}
]
}
]
}
}{
"errors": [
{
"message": "AUTH_INVALID_CREDENTIALS",
"errorCode": "UNAUTHORIZED"
}
]
}{
"errors": [
{
"message": "RESOURCE_NOT_FOUND",
"errorCode": "NOT_FOUND"
}
]
}Authorizations
Partner API key, sent in the x-api-key request header. Required for bookable offer search and all booking operations. To obtain a key, register as a PREXSELL partner in the backoffice (backoffice.prexsell.com, or staging.backoffice.prexsell.com for staging) and contact support if you need help.
Path Parameters
Booking identifier.
Example:
"bkg_1"
Response
Refund rules for a booking.
Booking refund rules result.
Show child attributes
Show child attributes
โI
