Patient Payments
Get Patient Balances
Fetch patient responsibility balances (PR buckets, paid, outstanding) and unallocated credits for a patient.
GET
/
api
/
patient-payments
/
balances
cURL
curl --request GET \
--url https://forecaster.cairhealth.com/api/patient-payments/balancesimport requests
url = "https://forecaster.cairhealth.com/api/patient-payments/balances"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://forecaster.cairhealth.com/api/patient-payments/balances', 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://forecaster.cairhealth.com/api/patient-payments/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://forecaster.cairhealth.com/api/patient-payments/balances"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://forecaster.cairhealth.com/api/patient-payments/balances")
.asString();require 'uri'
require 'net/http'
url = URI("https://forecaster.cairhealth.com/api/patient-payments/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"patientFhirId": "<string>",
"unallocatedCreditTotal": 123,
"unallocatedCredits": [
{}
],
"claims": [
{}
]
}
}Overview
Returns patient responsibility balances for a patient using the same PR bucket model as the patient balances UI (PR-1 deductible, PR-3 copay, PR-2 coinsurance, other PR), minus write-offs and paid amounts. Also returns unallocated patient credits.Authentication
JWT Bearer token from/api/token.
Query Parameters
string
required
FHIR Patient id.
Example
curl "https://forecaster.cairhealth.com/api/patient-payments/balances?patientFhirId=PatientId123" \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response
{
"success": true,
"data": {
"patientFhirId": "PatientId123",
"unallocatedCreditTotal": 25.0,
"unallocatedCredits": [
{
"id": "credit-uuid",
"paymentAmount": 25.0,
"paymentDate": "2024-01-15T00:00:00.000Z",
"paymentMethod": "Credit Card",
"paymentTraceId": "pi_123",
"notes": null,
"createdAt": "2024-01-15T12:00:00.000Z"
}
],
"claims": [
{
"claimId": "claim-uuid",
"claimFhirId": "fhir-claim-id",
"claimLifecycleId": "lifecycle-uuid",
"patientResponsibilityTotal": 100.0,
"prDeductible": 40.0,
"prCopay": 20.0,
"prCoinsurance": 30.0,
"prOther": 10.0,
"patientWriteOffTotal": 0,
"patientPaidAmount": 25.0,
"netOutstandingBalance": 75.0,
"paymentDetails": {
"paymentAmount": 25.0,
"paymentDate": "2024-01-10T00:00:00.000Z",
"paymentMethod": "Credit Card",
"paymentTraceId": "pi_abc",
"postedByEmail": "patient-payment-webhook"
}
}
]
}
}
⌘I
cURL
curl --request GET \
--url https://forecaster.cairhealth.com/api/patient-payments/balancesimport requests
url = "https://forecaster.cairhealth.com/api/patient-payments/balances"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://forecaster.cairhealth.com/api/patient-payments/balances', 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://forecaster.cairhealth.com/api/patient-payments/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://forecaster.cairhealth.com/api/patient-payments/balances"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://forecaster.cairhealth.com/api/patient-payments/balances")
.asString();require 'uri'
require 'net/http'
url = URI("https://forecaster.cairhealth.com/api/patient-payments/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"patientFhirId": "<string>",
"unallocatedCreditTotal": 123,
"unallocatedCredits": [
{}
],
"claims": [
{}
]
}
}
