API reference › Finance › Invoices

Get payment history by client ID

GET /v1/finance/invoices/payment-history/by-client/{client_id}

Scope
finance:read
Roles
admin, scheduler

Fetches a paginated list of payment history for a specific client.

Parameters

Path parameters

NameTypeDescription
client_id requiredstring

Client ID

Example CLT-12345.

Query parameters

NameTypeDescription
searchstring

Search query

statusstring

Filter by payment status

Example paid.

startDatestring (date)

Filter from this date (YYYY-MM-DD)

endDatestring (date)

Filter until this date (YYYY-MM-DD)

sortBystring

Sort by field

Example payment_date.

sortOrderstring

Sort order

One of: asc, desc. Example desc.

perPageinteger

Items per page

Example 10.

Every call also sends Authorization and X-Tenant-ID; see Getting started.

Example request

Shell
curl "https://api.fetchfido.ai/v1/finance/invoices/payment-history/by-client/{client_id}" \
  -H "Authorization: Bearer $FIDO_API_KEY" \
  -H "X-Tenant-ID: $FIDO_TENANT_ID"

Try it

Responses

200 Payment history retrieved successfully

Payment history retrieved successfully.

JSON
{
  "success": true,
  "data": [
    {
      "id": 42,
      "paymentDate": "01/20/2025",
      "amount": 250,
      "assignment": "N/A",
      "assignmentId": "INV-QKPWQ9",
      "invoiceId": "INV-QKPWQ9",
      "status": "Completed",
      "paymentMethod": "Bank Transfer",
      "transactionId": "txn_1A2B3C",
      "notes": "string"
    }
  ],
  "meta": {
    "currentPage": 1,
    "lastPage": 4,
    "perPage": 10,
    "total": 37
  }
}
Response fields (17)
FieldTypeDescription
successboolean

Example true.

dataarray of object
data[].idinteger

Example 42.

data[].paymentDatestring or null

Formatted with the organization's date format.

Example 01/20/2025.

data[].amountnumber (float)

Example 250.

data[].assignmentstring

Title of the first work item on the invoice, or N/A.

Example N/A.

data[].assignmentIdstring

Carries the invoice id, or N/A.

Example INV-QKPWQ9.

data[].invoiceIdstring

Example INV-QKPWQ9.

data[].statusstring

Example Completed.

data[].paymentMethodstring

Title-cased, or N/A when none is recorded.

Example Bank Transfer.

data[].transactionIdstring or null

Example txn_1A2B3C.

data[].notesstring or null
metaobject
meta.currentPageinteger

Example 1.

meta.lastPageinteger

Example 4.

meta.perPageinteger

Example 10.

meta.totalinteger

Example 37.

401 Not signed in

Missing, invalid or expired API key.

JSON
{
  "success": false,
  "message": "Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for.",
  "errors": null,
  "code": "API_KEY_MISSING"
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example Invalid API key. Org and user tier keys must send an X-Tenant-ID header naming the organization the key was issued for..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: API_KEY_MISSING, API_KEY_INVALID, API_KEY_EXPIRED. Example API_KEY_MISSING.

403 Not allowed

Scope, tenant, IP allow-list or RBAC check failed.

JSON
{
  "success": false,
  "message": "You don't have permission to access this endpoint. This API key is missing the 'finance:read' scope.",
  "errors": null,
  "code": ""
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You don't have permission to access this endpoint. This API key is missing the 'finance:read' scope..

errorsany or null

Null on this status.

codestring

Always empty on this status.

Example .

429 Too many requests

Rate limit exceeded. See Retry-After.

JSON
{
  "success": false,
  "message": "You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds.",
  "errors": null,
  "code": "RATE_LIMITED"
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example You've exceeded this API key's rate limit of 120 requests per minute. Try again in 37 seconds..

errorsany or null

Null on this status.

codestring

Machine-readable reason, for branching on in client code.

One of: RATE_LIMITED. Example RATE_LIMITED.

500 Server error

Server error

JSON
{
  "success": false,
  "message": "An unexpected error occurred — please try again.",
  "errors": null,
  "code": ""
}
Response fields (4)
FieldTypeDescription
successboolean

Example false.

messagestring

Example An unexpected error occurred — please try again..

errorsstring or null

Null in production. The exception message only when the application runs with debug on, so nothing is leaked to an integrator.

codestring

Always empty: the server-error response carries no error code.

Example .