Read custom data pulled from integrations via supplemental data configuration.
After configuring supplemental data via Codat.Platform.SupplementalData,
you can read the custom fields using the standard list/get endpoints —
they will appear in the supplementalData.content map on each record.
This module also provides access to raw custom data endpoints for integrations that support them (e.g. reading raw QuickBooks objects by their native type).
Example
# Read invoices — supplementalData is included automatically
{:ok, page} = Codat.Accounting.Invoices.list(client, company_id)
invoice = hd(page.results)
invoice["supplementalData"]["content"]["PONumber"] # => "PO-4521"
Summary
Functions
Returns a single custom data record by ID.
Returns a paginated list of custom data records for a company and data type.
Functions
@spec get( Codat.Client.t() | String.t(), String.t(), String.t(), String.t() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Returns a single custom data record by ID.
Example
{:ok, record} = Codat.Platform.CustomData.get(client, company_id, "CustomTransaction", "record-id")
@spec list( Codat.Client.t() | String.t(), String.t(), String.t() | keyword(), keyword() ) :: {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}
Returns a paginated list of custom data records for a company and data type.
This reads from the raw integration data pulled by Codat (not normalized).
Example
{:ok, page} = Codat.Platform.CustomData.list(client, company_id, "CustomTransaction")