Ramp.Bills (ramp v1.0.0)

Copy Markdown View Source

The Bills (accounts payable) resource: creating, listing, updating, and voiding bills owed to vendors.

Bills created via the API are auto-approved, skipping the draft phase.

Summary

Functions

Creates a bill owed to vendor_id for amount. Bills created via the API are auto-approved (they skip the draft phase).

Fetches a single bill by ID.

Returns a lazily auto-paginating Stream of Ramp.Bills.Bills.

Fetches a single page of bills. See Ramp.Page.

Updates a bill's memo, due date, invoice number, and/or payment method.

Permanently cancels (voids) a bill.

Types

create_line_item()

@type create_line_item() :: %{
  :amount => Ramp.Money.t(),
  optional(:description) => String.t()
}

create_opt()

@type create_opt() ::
  {:due_at, DateTime.t()}
  | {:invoice_date, DateTime.t()}
  | {:invoice_number, String.t()}
  | {:memo, String.t()}
  | {:payment_method, String.t()}
  | {:line_items, [create_line_item()]}

list_opt()

@type list_opt() ::
  {:start, String.t()}
  | {:page_size, pos_integer()}
  | {:vendor_id, String.t()}
  | {:status, String.t()}
  | {:from_due_date, DateTime.t()}
  | {:to_due_date, DateTime.t()}

update_opt()

@type update_opt() ::
  {:memo, String.t()}
  | {:due_at, DateTime.t()}
  | {:invoice_number, String.t()}
  | {:payment_method, String.t()}

Functions

create(client, vendor_id, amount, opts \\ [])

@spec create(Ramp.Client.t(), String.t(), Ramp.Money.t(), [create_opt()]) ::
  {:ok, Ramp.Bills.Bill.t()} | {:error, Ramp.Error.t()}

Creates a bill owed to vendor_id for amount. Bills created via the API are auto-approved (they skip the draft phase).

get(client, bill_id)

@spec get(Ramp.Client.t(), String.t()) ::
  {:ok, Ramp.Bills.Bill.t()} | {:error, Ramp.Error.t()}

Fetches a single bill by ID.

list(client, opts \\ [])

Returns a lazily auto-paginating Stream of Ramp.Bills.Bills.

list_page(client, opts \\ [])

@spec list_page(Ramp.Client.t(), [list_opt()]) ::
  {:ok, Ramp.Page.t(Ramp.Bills.Bill.t())} | {:error, Ramp.Error.t()}

Fetches a single page of bills. See Ramp.Page.

update(client, bill_id, opts)

@spec update(Ramp.Client.t(), String.t(), [update_opt()]) ::
  {:ok, Ramp.Bills.Bill.t()} | {:error, Ramp.Error.t()}

Updates a bill's memo, due date, invoice number, and/or payment method.

void(client, bill_id)

@spec void(Ramp.Client.t(), String.t()) :: :ok | {:error, Ramp.Error.t()}

Permanently cancels (voids) a bill.