Create and track bill payments through the Bill Pay API.
Payments are written to the customer's accounting platform, marking bills as (partially) paid and creating the corresponding payment record.
Example
# Create a bill payment
{:ok, push_op} = Codat.BillPay.Payments.create(
client, company_id, connection_id,
%{
date: "2024-01-20",
supplierRef: %{id: "supplier-id"},
lines: [
%{
amount: 5000.00,
links: [
%{type: "Bill", id: "bill-id", amount: -5000.00}
]
}
],
accountRef: %{id: "bank-account-id"}
}
)
# Wait for confirmation
{:ok, done} = Codat.Platform.PushOperations.poll_until_done(
client, company_id, push_op["pushOperationKey"]
)
Summary
Functions
Creates a new billPayments (async). Returns a push operation.
Deletes a billPayments by ID (async).
Fetches all billPayments across all pages concurrently.
Fetches a single billPayments by ID.
Returns the push model for creating billPayments.
Returns a paginated list of billPayments.
Returns a lazy Stream of all results.
Functions
@spec create( Codat.Client.t() | String.t(), String.t(), String.t() | map(), map() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Creates a new billPayments (async). Returns a push operation.
@spec delete(Codat.Client.t() | String.t(), String.t(), String.t() | keyword()) :: {:ok, nil} | {:error, Codat.Error.t()}
Deletes a billPayments by ID (async).
@spec fetch_all(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) :: {:ok, [map()]} | {:error, Codat.Error.t()}
Fetches all billPayments across all pages concurrently.
@spec get(Codat.Client.t() | String.t(), String.t(), String.t() | keyword()) :: {:ok, map()} | {:error, Codat.Error.t()}
Fetches a single billPayments by ID.
@spec get_create_model(Codat.Client.t() | String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Codat.Error.t()}
Returns the push model for creating billPayments.
@spec list(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) :: {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}
Returns a paginated list of billPayments.
@spec stream(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) :: Enumerable.t()
Returns a lazy Stream of all results.