Search documentation of stripe_elixir

# StripeElixir.Services.CustomerBalanceTransactionService (stripe_elixir v0.1.0)

Copy Markdown View Source

CustomerBalanceTransaction

Each customer has a Balance value, which denotes a debit or credit that's automatically applied to their next invoice upon finalization. You may modify the value directly by using the update customer API, or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.

Related guide: Customer balance

## Summary

### Functions

create(client, customer, params \\ %{}, opts \\ [])

Create a customer balance transaction

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

List customer balance transactions

retrieve(client, customer, transaction, params \\ %{}, opts \\ [])

Retrieve a customer balance transaction

update(client, customer, transaction, params \\ %{}, opts \\ [])

Update a customer credit balance transaction

## Functions

# create(client, customer, params \\ %{}, opts \\ [])

    @spec create(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Create a customer balance transaction

Creates an immutable transaction that updates the customer’s credit balance.

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

    @spec list(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

List customer balance transactions

Returns a list of transactions that updated the customer’s balances.

# retrieve(client, customer, transaction, params \\ %{}, opts \\ [])

    @spec retrieve(StripeElixir.Client.t(), String.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Retrieve a customer balance transaction

Retrieves a specific customer balance transaction that updated the customer’s balances.

# update(client, customer, transaction, params \\ %{}, opts \\ [])

    @spec update(StripeElixir.Client.t(), String.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Update a customer credit balance transaction

Most credit balance transaction fields are immutable, but you may update its `description` and `metadata`.