Get a pharmacy fill
curl --request GET \
--url https://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}"
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://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}', 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.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}",
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://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}"
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://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}")
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": {
"transactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medCaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medReferralId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"fillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "PAYMENT",
"amount": "<string>",
"transactionDate": "2023-12-25",
"payer": "<string>",
"reference": "<string>",
"reversesTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"note": "<string>",
"createdVia": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"totals": {
"billed": "<string>",
"paid": "<string>",
"adjustments": "<string>",
"computedBalance": "<string>",
"reported": {
"balance": "<string>",
"asOf": "2023-11-07T05:31:56Z",
"externalId": "<string>"
},
"difference": "<string>",
"fillCount": 123,
"transactionCount": 123
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medCaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medReferralId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"rxNumber": "<string>",
"fillDate": "2023-12-25",
"ndc": "<string>",
"drugName": "<string>",
"quantity": "<string>",
"daysSupply": 1825,
"prescriberName": "<string>",
"billedAmount": "<string>",
"prescriptionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"claimDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notes": "<string>",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "<string>",
"createdVia": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}MedEx Pharmacy
Get a pharmacy fill
Firm keys read their own cases; a provider key reads its own referral. Admin keys receive 403 wrong_scope. Restricted-access practices receive 403 restricted_access. Reads are allowed in any referral status. Includes the fill’s transactions and its own totals (billed, paid, adjustments, computedBalance).
GET
/
med-cases
/
{caseId}
/
referrals
/
{referralId}
/
pharmacy
/
fills
/
{fillId}
Get a pharmacy fill
curl --request GET \
--url https://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}"
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://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}', 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.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}",
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://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}"
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://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casexchange.com/api/public/v1/med-cases/{caseId}/referrals/{referralId}/pharmacy/fills/{fillId}")
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": {
"transactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medCaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medReferralId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"fillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "PAYMENT",
"amount": "<string>",
"transactionDate": "2023-12-25",
"payer": "<string>",
"reference": "<string>",
"reversesTransactionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"note": "<string>",
"createdVia": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"totals": {
"billed": "<string>",
"paid": "<string>",
"adjustments": "<string>",
"computedBalance": "<string>",
"reported": {
"balance": "<string>",
"asOf": "2023-11-07T05:31:56Z",
"externalId": "<string>"
},
"difference": "<string>",
"fillCount": 123,
"transactionCount": 123
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medCaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"medReferralId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"rxNumber": "<string>",
"fillDate": "2023-12-25",
"ndc": "<string>",
"drugName": "<string>",
"quantity": "<string>",
"daysSupply": 1825,
"prescriberName": "<string>",
"billedAmount": "<string>",
"prescriptionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"claimDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"notes": "<string>",
"voidedAt": "2023-11-07T05:31:56Z",
"voidReason": "<string>",
"createdVia": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "req_f2dbe1d3f6ad4a7bb5b4c9f2",
"timestamp": "2023-11-07T05:31:56Z"
}
}Authorizations
Public API key: cxp_<hex> (firm-scoped) or cxpp_<hex> (provider-scoped). Required on every request.
Path Parameters
Med case UUID: medCaseId in the referral.* webhook payload, or the id from GET /med-cases.
Med referral UUID: the referral of this case to your pharmacy practice. Find it with GET /med-cases/{id}/referrals, or take it from the referral.* webhook payload.
Pharmacy fill UUID

