Stripe.Invoiceitem (stripity_stripe v2.17.2) View Source

Work with Stripe invoiceitem objects.

Stripe API reference: https://stripe.com/docs/api#invoiceitems

Note: this module is named Invoiceitem and not InvoiceItem on purpose, to match the Stripe terminology of invoiceitem.

Link to this section Summary

Functions

Create an invoiceitem.

Delete and invoiceitem

List all invoiceitems.

Retrieve an invoiceitem.

Update an invoiceitem.

Link to this section Types

Specs

t() :: %Stripe.Invoiceitem{
  amount: integer(),
  currency: String.t(),
  customer: Stripe.id() | Stripe.Customer.t(),
  date: Stripe.timestamp(),
  deleted: boolean() | nil,
  description: String.t(),
  discountable: boolean(),
  discounts: [String.t()],
  id: Stripe.id(),
  invoice: Stripe.id() | Stripe.Invoice.t(),
  livemode: boolean(),
  metadata: Stripe.Types.metadata(),
  object: String.t(),
  period: %{start: Stripe.timestamp(), end: Stripe.timestamp()},
  plan: Stripe.Plan.t() | nil,
  price: Stripe.Price.t() | nil,
  proration: boolean(),
  quantity: integer(),
  subscription: Stripe.id() | Stripe.Subscription.t() | nil,
  tax_rates: [Stripe.TaxRate.t()],
  unit_amount: integer(),
  unit_amount_decimal: String.t()
}

Link to this section Functions

Link to this function

create(params, opts \\ [])

View Source

Specs

create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
when params:
       %{
         optional(:amount) => integer(),
         :currency => String.t(),
         :customer => Stripe.id() | Stripe.Customer.t(),
         optional(:description) => String.t(),
         optional(:discountable) => boolean(),
         optional(:invoice) => Stripe.id() | Stripe.Invoice.t(),
         optional(:metadata) => Stripe.Types.metadata(),
         optional(:price) => Stripe.id() | Stripe.Price.t(),
         optional(:quantity) => integer(),
         optional(:subscription) => Stripe.id() | Stripe.Subscription.t(),
         optional(:tax_rates) => [String.t()],
         optional(:unit_amount) => integer(),
         optional(:unit_amount_decimal) => String.t()
       }
       | %{}

Create an invoiceitem.

Specs

delete(Stripe.id() | t(), Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}

Delete and invoiceitem

Takes the id of the invoiceitem to delete.

Link to this function

list(params \\ %{}, opts \\ [])

View Source

Specs

list(params, Stripe.options()) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()}
when params:
       %{
         optional(:created) => Stripe.timestamp(),
         optional(:customer) => Stripe.id() | Stripe.Customer.t(),
         optional(:ending_before) => t() | Stripe.id(),
         optional(:invoice) => Stripe.id() | Stripe.Invoice.t(),
         optional(:limit) => 1..100,
         optional(:starting_after) => t() | Stripe.id()
       }
       | %{}

List all invoiceitems.

Link to this function

retrieve(id, opts \\ [])

View Source

Specs

retrieve(Stripe.id() | t(), Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}

Retrieve an invoiceitem.

Link to this function

update(id, params, opts \\ [])

View Source

Specs

update(Stripe.id() | t(), params, Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}
when params:
       %{
         optional(:amount) => integer(),
         optional(:description) => String.t(),
         optional(:discountable) => boolean(),
         optional(:metadata) => Stripe.Types.metadata(),
         optional(:price) => Stripe.id() | Stripe.Price.t(),
         optional(:quantity) => integer(),
         optional(:tax_rates) => [String.t()],
         optional(:unit_amount) => integer(),
         optional(:unit_amount_decimal) => String.t()
       }
       | %{}

Update an invoiceitem.

Takes the id and a map of changes.