Request a pre-authorization
curl --request POST \
--url https://api.heyrafiki.space/v1/preauthorizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"eligibility_check_id": "<string>",
"booking_id": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({eligibility_check_id: '<string>', booking_id: '<string>'})
};
fetch('https://api.heyrafiki.space/v1/preauthorizations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heyrafiki.space/v1/preauthorizations"
payload = {
"eligibility_check_id": "<string>",
"booking_id": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heyrafiki.space/v1/preauthorizations"
payload := strings.NewReader("{\n \"eligibility_check_id\": \"<string>\",\n \"booking_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}{
"id": "<string>",
"object": "preauthorization",
"eligibility_check_id": "<string>",
"booking_id": "<string>",
"status": "pending",
"reason_codes": [
"<string>"
],
"amount": {
"requested": 2,
"approved": 2,
"currency": "<string>"
},
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"decision": {
"id": "<string>",
"object": "preauthorization_decision",
"version": 2,
"outcome": "approved",
"reason_codes": [
"<string>"
],
"policy": {
"reference": "<string>",
"version": "<string>"
},
"authority_reference": "<string>",
"evidence_references": [
"<string>"
],
"decided_at": "2023-11-07T05:31:56Z"
}
}{
"id": "<string>",
"object": "preauthorization",
"eligibility_check_id": "<string>",
"booking_id": "<string>",
"status": "pending",
"reason_codes": [
"<string>"
],
"amount": {
"requested": 2,
"approved": 2,
"currency": "<string>"
},
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"decision": {
"id": "<string>",
"object": "preauthorization_decision",
"version": 2,
"outcome": "approved",
"reason_codes": [
"<string>"
],
"policy": {
"reference": "<string>",
"version": "<string>"
},
"authority_reference": "<string>",
"evidence_references": [
"<string>"
],
"decided_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}Request a pre-authorization
Opens a pending synthetic pre-authorization for an eligible covered Booking. Requires benefits:write.
POST
/
preauthorizations
Request a pre-authorization
curl --request POST \
--url https://api.heyrafiki.space/v1/preauthorizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"eligibility_check_id": "<string>",
"booking_id": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({eligibility_check_id: '<string>', booking_id: '<string>'})
};
fetch('https://api.heyrafiki.space/v1/preauthorizations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heyrafiki.space/v1/preauthorizations"
payload = {
"eligibility_check_id": "<string>",
"booking_id": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heyrafiki.space/v1/preauthorizations"
payload := strings.NewReader("{\n \"eligibility_check_id\": \"<string>\",\n \"booking_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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))
}{
"id": "<string>",
"object": "preauthorization",
"eligibility_check_id": "<string>",
"booking_id": "<string>",
"status": "pending",
"reason_codes": [
"<string>"
],
"amount": {
"requested": 2,
"approved": 2,
"currency": "<string>"
},
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"decision": {
"id": "<string>",
"object": "preauthorization_decision",
"version": 2,
"outcome": "approved",
"reason_codes": [
"<string>"
],
"policy": {
"reference": "<string>",
"version": "<string>"
},
"authority_reference": "<string>",
"evidence_references": [
"<string>"
],
"decided_at": "2023-11-07T05:31:56Z"
}
}{
"id": "<string>",
"object": "preauthorization",
"eligibility_check_id": "<string>",
"booking_id": "<string>",
"status": "pending",
"reason_codes": [
"<string>"
],
"amount": {
"requested": 2,
"approved": 2,
"currency": "<string>"
},
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"decision": {
"id": "<string>",
"object": "preauthorization_decision",
"version": 2,
"outcome": "approved",
"reason_codes": [
"<string>"
],
"policy": {
"reference": "<string>",
"version": "<string>"
},
"authority_reference": "<string>",
"evidence_references": [
"<string>"
],
"decided_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}Authorizations
bearerAuthapiKeyAuth
A sandbox or production secret key.
Headers
A caller-owned key for safely retrying one write.
Required string length:
8 - 255Body
application/json
Response
The original pre-authorization for an idempotent replay
Maximum string length:
100Pattern:
^preauth_[A-Za-z0-9_-]+$Allowed value:
"preauthorization"Maximum string length:
100Pattern:
^elig_[A-Za-z0-9_-]+$Maximum string length:
100Pattern:
^bkg_[A-Za-z0-9_-]+$Available options:
pending, approved, denied, expired, cancelled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Last modified on August 10, 2026
Was this page helpful?

