The Mercury Customers API — accounts-receivable customers.
Summary
Functions
Creates a new customer. POST /customers
Deletes a customer. This action is irreversible. DELETE /customers/{id}
Returns a single customer by ID. GET /customers/{id}
Returns one page of customers. GET /customers
A lazy, auto-paginating stream of every customer.
Updates a customer. PUT /customers/{id}
Functions
@spec create(client :: Mercury.Client.t(), attrs :: map() | keyword()) :: {:ok, Mercury.Customer.t()} | {:error, Exception.t()}
Creates a new customer. POST /customers
@spec create!(client :: Mercury.Client.t(), attrs :: map() | keyword()) :: Mercury.Customer.t()
@spec delete(client :: Mercury.Client.t(), customer_id :: String.t()) :: :ok | {:error, Exception.t()}
Deletes a customer. This action is irreversible. DELETE /customers/{id}
@spec delete!(client :: Mercury.Client.t(), customer_id :: String.t()) :: :ok
@spec get(client :: Mercury.Client.t(), customer_id :: String.t()) :: {:ok, Mercury.Customer.t()} | {:error, Exception.t()}
Returns a single customer by ID. GET /customers/{id}
@spec get!(client :: Mercury.Client.t(), customer_id :: String.t()) :: Mercury.Customer.t()
@spec list(client :: Mercury.Client.t(), opts :: keyword()) :: {:ok, Mercury.Page.t(Mercury.Customer.t())} | {:error, Exception.t()}
Returns one page of customers. GET /customers
@spec list!(client :: Mercury.Client.t(), opts :: keyword()) :: Mercury.Page.t(Mercury.Customer.t())
@spec stream(client :: Mercury.Client.t(), opts :: keyword()) :: Enumerable.t()
A lazy, auto-paginating stream of every customer.
@spec update( client :: Mercury.Client.t(), customer_id :: String.t(), attrs :: map() | keyword() ) :: {:ok, Mercury.Customer.t()} | {:error, Exception.t()}
Updates a customer. PUT /customers/{id}
@spec update!( client :: Mercury.Client.t(), customer_id :: String.t(), attrs :: map() | keyword() ) :: Mercury.Customer.t()