List Payments
GET
/api/v1/users/me/paymentsLists the authenticated patient's case payments. Optionally filtered by case. Soft-deleted payments are excluded. Cursor-paginated by createdAt descending.
cv-api-key + Bearer accessToken
Production
https://api.care360-next.carevalidate.com/api/v1/users/me/paymentsStaging
https://api-staging.care360-next.carevalidate.com/api/v1/users/me/paymentsHeaders
Headers
cv-api-keystringrequiredYour unique API key for authentication.
AuthorizationstringrequiredBearer access token from /verify-otp.
Example:
Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...Query Parameters
Query Parameters
caseIdstringoptionalUUID. Restrict the list to a single case owned by the patient. Verified via ensurePatientOwnsCase — if the case does not belong to the patient or to the calling org, returns 403.
Example:
550e8400-e29b-41d4-a716-446655440000limitintegeroptionalPage size. 1–100. Defaults to 20.
Example:
20afterstringoptionalCursor — the last id from the previous page. The server skips this row and returns the next page.
Example:
550e8400-e29b-41d4-a716-446655440000Behavior
- If
caseIdis provided,ensurePatientOwnsCaseconfirms the case exists, thesubmitterId === userId, and theorganizationIdmatches the calling org. Otherwise →403 VALIDATION_ERROR"You do not have access to this case". - If
caseIdis omitted, the server resolves the patient's own case ids in this org. - The DB query returns
CasePaymentrows scoped to those case ids withisDeleted = false, ordered bycreatedAtdescending. The associatedCasePaymentFeesrow, if any, is embedded underfees(otherwisefeesisnull). - The server takes
limit + 1rows to detect end-of-results, drops the extra, and emits its id asnextCursor. When no more rows exist,nextCursorisnull.
If the patient has no cases (or no payments), data.payments is [] and data.nextCursor is null.
Response Shape
See Payments Overview › Payment for the per-row field list. The response is:
{ "status": 200, "success": true, "data": { "payments": [ "..." ], "nextCursor": "<id> | null" } }
Example Request
- cURL — all
- cURL — paginated
- JavaScript
- Python
curl -X GET '<BASE_URL>/api/v1/users/me/payments' \
-H 'cv-api-key: <redacted>' \
-H 'Authorization: Bearer <accessToken>'
curl -X GET '<BASE_URL>/api/v1/users/me/payments?caseId=<CASE_ID>&limit=20&after=<LAST_ID>' \
-H 'cv-api-key: <redacted>' \
-H 'Authorization: Bearer <accessToken>'
const url = new URL('<BASE_URL>/api/v1/users/me/payments');
url.searchParams.set('caseId', '<CASE_ID>');
url.searchParams.set('limit', '20');
const response = await fetch(url, {
method: 'GET',
headers: {
'cv-api-key': '<redacted>',
'Authorization': 'Bearer <accessToken>',
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'<BASE_URL>/api/v1/users/me/payments',
headers={
'cv-api-key': '<redacted>',
'Authorization': 'Bearer <accessToken>',
},
params={'caseId': '<CASE_ID>', 'limit': 20},
)
print(response.json())
Responses
▶200SuccessReturns the patient's payments matching the filters.
{
"status": 200,
"success": true,
"data": {
"payments": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"description": "Initial consultation",
"amount": 150,
"discountedAmount": 120,
"status": "PAID",
"paymentDate": "2026-04-15T12:34:56.000Z",
"dueDate": "2026-04-10T00:00:00.000Z",
"caseId": "550e8400-e29b-41d4-a716-446655440111",
"createdAt": "2026-04-15T12:30:00.000Z",
"fees": {
"consultFee": 100,
"convenienceFee": 5,
"paymentProcessingFee": 4.5,
"pharmacyFee": 0,
"shippingFee": 10.5
}
}
],
"nextCursor": "550e8400-e29b-41d4-a716-446655440000"
}
}
▶400Validation errorcv-api-key missing, caseId / after not a UUID, or limit out of range.
{
"status": 400,
"success": false,
"error": "Validation failed",
"code": "VALIDATION_ERROR"
}
▶401Authentication failureAuth-middleware rejection (any cause is collapsed into this generic response).
{
"status": 401,
"success": false,
"error": "Invalid or expired token",
"code": "VALIDATION_ERROR"
}
▶403Case not ownedcaseId does not belong to the patient or to the calling org.
{
"status": 403,
"success": false,
"error": "You do not have access to this case",
"code": "VALIDATION_ERROR"
}
Try It Out
Try itAPI Playground
▶