Xero Accounting API – Contacts (customers and/or suppliers).
Key rules: Requests touching >100k contacts rejected (HTTP 400).
Use page:, where:, and summary_only: true for large orgs.
Summary
Functions
Adds a note to a contact's history.
Archives a contact.
Lists attachments on a contact.
Returns CIS settings for a contact (UK only).
Creates one or more contacts. Requires :name (unique per org).
Retrieves a single contact by ID or account number.
Returns audit history for a contact.
Lists contacts. Options: :page, :ids, :account_number, :summary_only,
:include_archived, :order, :where, :search_term, :if_modified_since
Lazy stream of all contacts.
Updates a contact.
Updates CIS settings for a contact (UK only).
Uploads an attachment to a contact.
Functions
@spec add_note(Xero.Auth.Token.t(), String.t(), String.t(), String.t()) :: {:ok, map()} | {:error, Xero.Error.t()}
Adds a note to a contact's history.
@spec archive(Xero.Auth.Token.t(), String.t(), String.t()) :: {:ok, map()} | {:error, Xero.Error.t()}
Archives a contact.
@spec attachments(Xero.Auth.Token.t(), String.t(), String.t()) :: {:ok, map()} | {:error, Xero.Error.t()}
Lists attachments on a contact.
@spec cis_settings(Xero.Auth.Token.t(), String.t(), String.t()) :: {:ok, map()} | {:error, Xero.Error.t()}
Returns CIS settings for a contact (UK only).
@spec create(Xero.Auth.Token.t(), String.t(), map() | [map()]) :: {:ok, map()} | {:error, Xero.Error.t()}
Creates one or more contacts. Requires :name (unique per org).
@spec get(Xero.Auth.Token.t(), String.t(), String.t()) :: {:ok, map()} | {:error, Xero.Error.t()}
Retrieves a single contact by ID or account number.
@spec history(Xero.Auth.Token.t(), String.t(), String.t()) :: {:ok, map()} | {:error, Xero.Error.t()}
Returns audit history for a contact.
@spec list(Xero.Auth.Token.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Xero.Error.t()}
Lists contacts. Options: :page, :ids, :account_number, :summary_only,
:include_archived, :order, :where, :search_term, :if_modified_since
@spec stream(Xero.Auth.Token.t(), String.t(), keyword()) :: Enumerable.t()
Lazy stream of all contacts.
@spec update(Xero.Auth.Token.t(), String.t(), String.t(), map()) :: {:ok, map()} | {:error, Xero.Error.t()}
Updates a contact.
@spec update_cis_settings(Xero.Auth.Token.t(), String.t(), String.t(), map()) :: {:ok, map()} | {:error, Xero.Error.t()}
Updates CIS settings for a contact (UK only).
@spec upload_attachment( Xero.Auth.Token.t(), String.t(), String.t(), String.t(), binary(), String.t() ) :: {:ok, map()} | {:error, Xero.Error.t()}
Uploads an attachment to a contact.