When to use this endpoint

Use this after loading an invoice to display its payment-history tab. Always pass invoice_id for ordinary UI/integration use.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.

Users whose legacy crm_access mask contains bit 64 are denied. The handler performs no additional invoice-page, ownership, or department permission check.

Parameters

ParameterTypeRequiredDescription
invoice_idInteger-compatibleNoExact invoice ID filter. If the key is present, even blank/nonnumeric input becomes invoice_id=0. If omitted, payments for every invoice in the tenant are returned.
fieldsArray or JSON array stringNoAllowlisted fields: id, invoice_id, amt, user_id, cdate, type, meta. Unknown values are silently omitted. Missing/malformed/empty input defaults to id, invoice_id, cdate, amt.

Example request

$payments = FM_api('InvoicePayments_list', [
	'invoice_id' => 981,
	'fields' => json_encode(['cdate', 'amt', 'user_id', 'meta']),
]);

Example response

[
  {"cdate":"2026-10-02 14:30:00","amt":"25","user_id":"77","meta":"{}"}
]

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • The result is unpaginated and unordered. Payment meta remains JSON text.
  • The endpoint does not join or validate invoices, so payments remain queryable for missing or soft-deleted invoices.
  • Omitting invoice_id can return the tenant’s complete payment table.

See it in Fieldmotion

CRM1

Open an invoice’s History of Changes dialog and select Payments. CRM1 requests this route with invoice ID and the date/amount/user/metadata fields.

CRM2

Open an invoice Payment dialog. CRM2 caches the same invoice-scoped field selection after recording payments through Invoice_pay.

Related endpoints

  • Invoice_pay appends a positive payment and may mark the invoice Paid.
  • Invoice_get supplies current paid/total values.