View Source StarkInfra.IssuingInvoice (starkinfra v0.0.1)

# IssuingInvoice struct

Link to this section Summary

Functions

The IssuingInvoice structs created in your Workspace load your Issuing balance when paid.

Same as create(), but it will unwrap the error tuple and raise in case of errors.

Send a list of IssuingInvoice structs for creation in the Stark Infra API

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Receive a single IssuingInvoice struct previously created in the Stark Infra API by its id

Same as page(), but it will unwrap the error tuple and raise in case of errors.

Receive a list of IssuingInvoices structs previously created in the Stark Infra API and the cursor to the next page.

Same as query(), but it will unwrap the error tuple and raise in case of errors.

Receive a stream of IssuingInvoices structs previously created in the Stark Infra API

Link to this section Types

@type t() :: %StarkInfra.IssuingInvoice{
  amount: term(),
  created: term(),
  id: term(),
  issuing_transaction_id: term(),
  name: term(),
  status: term(),
  tags: term(),
  tax_id: term(),
  updated: term()
}

Link to this section Functions

Link to this function

%StarkInfra.IssuingInvoice{}

View Source (struct)

The IssuingInvoice structs created in your Workspace load your Issuing balance when paid.

parameters-required

Parameters (required):

- `:amount` [integer]: IssuingInvoice value in cents. ex: 1234 (= R$ 12.34)

parameters-optional

Parameters (optional):

- `:tax_id` [string, default sub-issuer tax ID]: payer tax ID (CPF or CNPJ) with or without formatting. ex: "01234567890" or "20.018.183/0001-80"
- `:name` [string, default sub-issuer name]: payer name. ex: "Iron Bank S.A."
- `:tags` [list of strings, default []]: list of strings for tagging. ex: ["travel", "food"]

attributes-return-only

Attributes (return-only):

- `:id` [string]: unique id returned when IssuingInvoice is created. ex: "5656565656565656"
- `:status` [string]: current IssuingInvoice status. ex: "created", "expired", "overdue", "paid"
- `:issuing_transaction_id` [string]: ledger transaction ids linked to this IssuingInvoice. ex: "issuing-invoice/5656565656565656"
- `:updated` [DateTime]: latest update DateTime for the IssuingInvoice. ex: ~U[2020-3-10 10:30:0:0]
- `:created` [DateTime]: creation datetime for the IssuingInvoice. ex: ~U[2020-03-10 10:30:0:0]
Link to this function

create!(invoice, options \\ [])

View Source

Same as create(), but it will unwrap the error tuple and raise in case of errors.

Link to this function

create(invoice, options \\ [])

View Source

Send a list of IssuingInvoice structs for creation in the Stark Infra API

parameters-required

Parameters (required):

- `:invoice` [IssuingInvoice struct]: IssuingInvoice struct to be created in the API.

options

Options:

- `:user` [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

- IssuingInvoice struct with updated attributes

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Receive a single IssuingInvoice struct previously created in the Stark Infra API by its id

parameters-required

Parameters (required):

- `:id` [string]: struct unique id. ex: "5656565656565656"

options

Options:

- `:user` [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

- IssuingInvoice struct with updated attributes
@spec page!(
  cursor: binary() | nil,
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  tags: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: any()

Same as page(), but it will unwrap the error tuple and raise in case of errors.

@spec page(
  cursor: binary() | nil,
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  tags: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: {:ok, {binary(), [t()]}} | {:error, [StarkInfra.Error.t()]}

Receive a list of IssuingInvoices structs previously created in the Stark Infra API and the cursor to the next page.

options

Options:

- `:cursor` [string, default nil]: cursor returned on the previous page function call
- `:limit` [integer, default 100]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
- `:after` [Date or string, default nil]: date filter for structs created only after specified date. ex: ~D[2020-03-25]
- `:before` [Date or string, default nil]: date filter for structs created only before specified date. ex: ~D[2020-03-25]
- `:status` [list of strings, default nil]: filter for status of retrieved structs. ex: ["created", "expired", "overdue", "paid"]
- `:tags` [list of strings, default nil]: tags to filter retrieved structs. ex: ["tony", "stark"]
- `:user` [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

- list of IssuingInvoices structs with updated attributes
- cursor to retrieve the next page of IssuingInvoices structs
@spec query!(
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  tags: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: any()

Same as query(), but it will unwrap the error tuple and raise in case of errors.

@spec query(
  limit: integer() | nil,
  after: Date.t() | binary() | nil,
  before: Date.t() | binary() | nil,
  status: [binary()] | nil,
  tags: [binary()] | nil,
  user: StarkInfra.User.Organization.t() | StarkInfra.User.Project.t() | nil
) :: {:ok, {binary(), [t()]}} | {:error, [StarkInfra.Error.t()]}

Receive a stream of IssuingInvoices structs previously created in the Stark Infra API

options

Options:

- `:limit` [integer, default 100]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
- `:after` [Date or string, default nil]: date filter for structs created only after specified date. ex: ~D[2020-03-25]
- `:before` [Date or string, default nil]: date filter for structs created only before specified date. ex: ~D[2020-03-25]
- `:status` [list of strings, default nil]: filter for status of retrieved structs. ex: ["created", "expired", "overdue", "paid"]
- `:tags` [list of strings, default nil]: tags to filter retrieved structs. ex: ["tony", "stark"]
- `:user` [Organization/Project, default nil]: Organization or Project struct returned from StarkInfra.project(). Only necessary if default project or organization has not been set in configs.

return

Return:

- stream of IssuingInvoices structs with updated attributes