# `MishkaPay.Providers.Stripe.Mapper`
[🔗](https://github.com/mishka-group/mishka_pay/blob/v0.0.1/lib/mishka_pay/providers/__stripe/mapper.ex#L5)

The only place that knows Stripe's field names: Mishka Pay's structs become Stripe's params, and
Stripe's JSON objects (API version `2026-10-28.endive`) become Mishka Pay's structs.

# `account_includes`

```elixir
@spec account_includes() :: [String.t()]
```

What a v2 account read includes: its configurations, requirements, defaults and identity.

# `account_link`

```elixir
@spec account_link(map(), MishkaPay.ConnectedAccount.Link.t()) ::
  {:ok, MishkaPay.ConnectedAccount.Link.t()} | {:error, Splode.Error.t()}
```

A Stripe account link or login link as the `MishkaPay.ConnectedAccount.Link` asked for, with its URL.

# `account_link_params`

```elixir
@spec account_link_params(MishkaPay.ConnectedAccount.Link.t(), :v2 | :v1) :: map()
```

Params of an account link: `POST /v2/core/account_links` (`:v2`), its use case with the two
pages; or `POST /v1/account_links` (`:v1`).

# `application_fee`

```elixir
@spec application_fee(map()) ::
  {:ok, MishkaPay.ApplicationFee.t()} | {:error, Splode.Error.t()}
```

A Stripe application fee as a `MishkaPay.ApplicationFee`.

# `balance`

```elixir
@spec balance(map()) :: {:ok, MishkaPay.Balance.t()} | {:error, Splode.Error.t()}
```

The Stripe balance as a `MishkaPay.Balance`: its payments balance, available and pending, one
money per currency, each below zero when Stripe's is.

# `balance_transaction`

```elixir
@spec balance_transaction(map()) ::
  {:ok, MishkaPay.Balance.Transaction.t()} | {:error, Splode.Error.t()}
```

A Stripe balance transaction as a `MishkaPay.Balance.Transaction`.

# `billing_mode`

```elixir
@spec billing_mode(map(), map()) :: map()
```

Stripe's `billing_mode` of a subscription made from `choice` (a checkout or a new schedule):
its own `:billing_mode`, else the tenant's (`settings`), else `flexible`, Stripe's recommended
mode; in the flexible mode, its `:proration_discounts`, else the tenant's, else `itemized`, the
way Stripe recommends.

# `billing_type`

```elixir
@spec billing_type(map(), map()) :: :flexible | :classic
```

The billing mode a subscription made from `choice` gets: its own `:billing_mode`, else the
tenant's (`settings`), else `:flexible`.

# `capture_params`

```elixir
@spec capture_params(Money.t() | nil) :: map()
```

Params of `POST /v1/payment_intents/:id/capture`: the part to take, or none for all that is
held.

# `change_params`

```elixir
@spec change_params(MishkaPay.Subscription.Change.t(), String.t()) :: map()
```

Params of `POST /v1/subscriptions/:id` for a change: the item with its new price and quantity,
and how the difference is billed; only what the change sets.

# `checkout`

```elixir
@spec checkout(map()) :: MishkaPay.Checkout.t()
```

A Checkout Session read back on its own: what Stripe filled in and the reference.

# `checkout`

```elixir
@spec checkout(map(), MishkaPay.Checkout.t()) :: MishkaPay.Checkout.t()
```

The checkout with Stripe's answer: its session id, page, status and payment.

# `checkout_params`

```elixir
@spec checkout_params(MishkaPay.Checkout.t(), map()) :: map()
```

Params of `POST /v1/checkout/sessions`: a one-time payment, a subscription with its trial, or
a setup that saves a payment method. The reference and the owner go on the payment, the
subscription or the setup too, so they come back on each.

# `confirm_params`

```elixir
@spec confirm_params(keyword()) :: map()
```

Params of an intent's `confirm`: the payment method and the page to come back to.

# `connected_account`

```elixir
@spec connected_account(map()) ::
  {:ok, MishkaPay.ConnectedAccount.t()} | {:error, Splode.Error.t()}
```

A Stripe connected account as a `MishkaPay.ConnectedAccount`, read with either API: a
`v2.core.account` with its configurations' capabilities and the requirements the seller must
meet, or a v1 `account` with its controller and capabilities.

# `connected_account_params`

```elixir
@spec connected_account_params(MishkaPay.ConnectedAccount.t(), :v2 | :v1) :: map()
```

Params of making a connected account: `POST /v2/core/accounts` (`:v2`), with its dashboard,
configurations and who collects fees and losses; or `POST /v1/accounts` (`:v1`), with the
matching `controller` and capabilities. Either keeps the reference in its metadata.

# `connected_account_update_params`

```elixir
@spec connected_account_update_params(MishkaPay.ConnectedAccount.t(), :v2 | :v1) ::
  map()
```

Params of changing a connected account (`POST /v2/core/accounts/:id` or `POST
/v1/accounts/:id`): only the details given, and the configurations and capabilities given
added to the account's.

# `coupon`

```elixir
@spec coupon(map()) :: {:ok, MishkaPay.Coupon.t()} | {:error, Splode.Error.t()}
```

A Stripe coupon as a `MishkaPay.Coupon`.

# `coupon_params`

```elixir
@spec coupon_params(MishkaPay.Coupon.t()) :: map()
```

Params of `POST /v1/coupons`: what it takes off, for how long, and its limits.

# `credit_note`

```elixir
@spec credit_note(map()) ::
  {:ok, MishkaPay.CreditNote.t()} | {:error, Splode.Error.t()}
```

A Stripe credit note (`object: "credit_note"`) as a `MishkaPay.CreditNote`, with its lines.

# `credit_note_line`

```elixir
@spec credit_note_line(map(), String.t()) ::
  {:ok, MishkaPay.CreditNote.Lines.t()} | {:error, Splode.Error.t()}
```

A Stripe credit note line item as a `MishkaPay.CreditNote.Lines`, in its note's `currency` (the
line carries none).

# `credit_note_params`

```elixir
@spec credit_note_params(MishkaPay.CreditNote.t()) :: map()
```

Params of `POST /v1/credit_notes` (and of its preview): the bill, the amount or the lines, where
the money goes, and the reference in its metadata.

# `customer`

```elixir
@spec customer(map(), :v2 | :v1) ::
  {:ok, MishkaPay.Customer.t()} | {:error, Splode.Error.t()}
```

A Stripe customer as a `MishkaPay.Customer`: a `v2.core.account` with the customer
configuration, or a v1 `customer`. A deleted Customer or a closed account is a rejection with
code `"customer_deleted"`, and an account without the customer configuration one with
`"resource_missing"`. `view` is the API the tenant names its customers by: on `:v2` a Customer
that Stripe links to an account (one made on Accounts v2, read through `/v1/customers`)
answers the account's id.

# `customer_balance_params`

```elixir
@spec customer_balance_params(MishkaPay.Customer.BalanceTransaction.t()) :: map()
```

Params of `POST /v1/customers/:id/balance_transactions`: the signed amount in Stripe's places
(below zero is credit), why, and the reference in its metadata.

# `customer_balance_transaction`

```elixir
@spec customer_balance_transaction(map()) ::
  {:ok, MishkaPay.Customer.BalanceTransaction.t()} | {:error, Splode.Error.t()}
```

A Stripe customer balance transaction as a `MishkaPay.Customer.BalanceTransaction`.

# `customer_includes`

```elixir
@spec customer_includes() :: [String.t()]
```

What a v2 customer read includes: its customer configuration and identity.

# `customer_param`

```elixir
@spec customer_param(String.t() | nil) :: {String.t(), String.t() | nil}
```

The parameter that names a customer at Stripe, with its id: `customer_account` for an account
with the customer configuration (Accounts v2, `acct_...`), `customer` for a Customer
(`cus_...`). Stripe takes either on every v1 call that names a customer.

# `customer_params`

```elixir
@spec customer_params(MishkaPay.Customer.t(), :v2 | :v1) :: map()
```

Params of making or changing a customer. `:v1`: `POST /v1/customers` (and its update), the
fields set, the address, the invoice default and the reference in the metadata. `:v2`: `POST
/v2/core/accounts` (and its update), an account with the customer configuration: the email as
`contact_email`, the name as `display_name`, the phone and address under the identity's
individual, the invoice default under the configuration's billing, and the reference in the
metadata. A field left out is not sent, so an update changes only what it names.

# `digits`

```elixir
@spec digits(atom()) :: non_neg_integer() | nil
```

The decimal places Stripe counts `currency` in when they differ from ISO 4217 (ISK and UGX: 2,
MGA: 0), or `nil` for the ISO ones.

# `dispute`

```elixir
@spec dispute(map()) :: {:ok, MishkaPay.Dispute.t()} | {:error, Splode.Error.t()}
```

A Stripe dispute as a `MishkaPay.Dispute`.

# `entitlement`

```elixir
@spec entitlement(map()) ::
  {:ok, MishkaPay.Feature.Entitlement.t()} | {:error, Splode.Error.t()}
```

A Stripe active entitlement as a `MishkaPay.Feature.Entitlement`.

# `event`

```elixir
@spec event(map()) :: {:ok, MishkaPay.Event.t()} | {:error, Splode.Error.t()}
```

A Stripe event as a `MishkaPay.Event`, with what it is about: a snapshot event (`object:
"event"`), or a thin one (`object: "v2.core.event"`, as an event destination sends API v2's
events), whose related object is what it is about and whose `context`, else the account it is
about, is its `:account`, and whose type is `event_type/1`'s; one a customer made on Accounts v2
sends (`v2.core.account.updated`, `.closed`, `[identity].updated`,
`[configuration.customer].*`) names that account as its `:customer_id` too. A saved payment method's or a
setup's event is about the customer it names (a detached payment method names it in
`previous_attributes`), since that customer is what changes.

# `event_type`

```elixir
@spec event_type(String.t()) :: String.t()
```

The type a Stripe event's `MishkaPay.Event` carries: a thin event of a v1 resource is named as
its snapshot event (`v1.invoice.paid` is `invoice.paid`, `v1.invoice.overpaid` is
`invoice.overpaid`), so a listener takes either kind by one name; API v2's own events keep
Stripe's names (`v2.core.account.updated`).

# `evidence_files`

```elixir
@spec evidence_files() :: [String.t()]
```

The dispute evidence fields that take a file id (`file_...`) instead of text.

# `feature`

```elixir
@spec feature(map()) :: {:ok, MishkaPay.Feature.t()} | {:error, Splode.Error.t()}
```

A Stripe feature as a `MishkaPay.Feature`; a product feature answers the feature it attached.

# `feature_params`

```elixir
@spec feature_params(MishkaPay.Feature.t()) :: map()
```

Params of `POST /v1/entitlements/features`.

# `file`

```elixir
@spec file(map()) :: {:ok, MishkaPay.File.t()} | {:error, Splode.Error.t()}
```

A Stripe file as a `MishkaPay.File`.

# `file_link`

```elixir
@spec file_link(map()) :: {:ok, MishkaPay.File.Link.t()} | {:error, Splode.Error.t()}
```

A Stripe file link as a `MishkaPay.File.Link`.

# `file_link_params`

```elixir
@spec file_link_params(String.t(), keyword()) :: map()
```

Params of `POST /v1/file_links`: the file, and when the link ends.

# `file_params`

```elixir
@spec file_params(MishkaPay.File.Upload.t()) :: [{String.t(), term()}]
```

Params of `POST /v1/files`, as multipart parts: the purpose, and the file with its name and
content type.

# `fraud_review`

```elixir
@spec fraud_review(map()) ::
  {:ok, MishkaPay.Payment.FraudReview.t()} | {:error, Splode.Error.t()}
```

A Stripe Radar review as a `MishkaPay.Payment.FraudReview`.

# `fraud_warning`

```elixir
@spec fraud_warning(map()) ::
  {:ok, MishkaPay.Payment.FraudWarning.t()} | {:error, Splode.Error.t()}
```

A Stripe Radar early fraud warning as a `MishkaPay.Payment.FraudWarning`.

# `invoice`

```elixir
@spec invoice(map()) :: {:ok, MishkaPay.Invoice.t()} | {:error, Splode.Error.t()}
```

An Invoice as a `MishkaPay.Invoice`.

# `invoice_item`

```elixir
@spec invoice_item(map()) ::
  {:ok, MishkaPay.Invoice.Item.t()} | {:error, Splode.Error.t()}
```

A Stripe invoice item (`object: "invoiceitem"`) as a `MishkaPay.Invoice.Item`.

# `invoice_item_params`

```elixir
@spec invoice_item_params(MishkaPay.Invoice.Item.t()) :: map()
```

Params of `POST /v1/invoiceitems` for a `MishkaPay.Invoice.Item` made on its own: the line a
draft's item sends (`invoice_item_params/3`), with the reference in its metadata.

# `invoice_item_params`

```elixir
@spec invoice_item_params(MishkaPay.Price.t(), String.t() | nil, String.t()) :: map()
```

Params of `POST /v1/invoiceitems` for one item of a draft, on `invoice_id`, or for one kept on
its own (`invoice_id` nil: it waits for the customer's next bill).

# `invoice_item_update_params`

```elixir
@spec invoice_item_update_params(MishkaPay.Invoice.Item.t()) :: map()
```

Params of `POST /v1/invoiceitems/:id`: only what the change sets. Stripe keeps the item's
currency, so the amount is sent in its places without one.

# `invoice_params`

```elixir
@spec invoice_params(MishkaPay.Invoice.Draft.t()) :: map()
```

Params of `POST /v1/invoices` for a draft: its customer, how it is collected, and the reference
in its metadata. Its items are added after, each on its own (`invoice_item_params/3`).

# `merchant_of_record`

```elixir
@spec merchant_of_record(MishkaPay.Checkout.t() | MishkaPay.PaymentLink.t(), map()) ::
  boolean() | nil
```

Whether a checkout sells with Stripe as the merchant of record: its own choice, else the
tenant's setting, else `nil`, the Stripe account's default.

# `meter`

```elixir
@spec meter(map()) :: {:ok, MishkaPay.Meter.t()} | {:error, Splode.Error.t()}
```

A Stripe billing meter as a `MishkaPay.Meter`.

# `meter_params`

```elixir
@spec meter_params(MishkaPay.Meter.t()) :: map()
```

Params of `POST /v1/billing/meters`: its name (the event name when it has none), the event name
and how usage adds up. A report names its customer and value under Stripe's default payload
keys, `stripe_customer_id` and `value`.

# `minor`

```elixir
@spec minor(Money.t()) :: integer()
```

Stripe's integer `amount` for `money`, in the places Stripe counts its currency in.

# `part_params`

```elixir
@spec part_params(Money.t() | nil, String.t()) :: [{String.t(), String.t()}]
```

Params of a part given back (a transfer reversal, an application fee refund): the amount in
Stripe's places, or none for all of it, and the object it belongs to expanded in the answer.

# `payment`

```elixir
@spec payment(map()) :: {:ok, MishkaPay.Payment.t()} | {:error, Splode.Error.t()}
```

A PaymentIntent, with its latest charge, the charge's refunds and the customer expanded, as a
`MishkaPay.Payment`.

# `payment_intent`

```elixir
@spec payment_intent(map()) ::
  {:ok, MishkaPay.PaymentIntent.t()} | {:error, Splode.Error.t()}
```

A Stripe PaymentIntent as a `MishkaPay.PaymentIntent`, for a page with Stripe Elements.

# `payment_intent_params`

```elixir
@spec payment_intent_params(MishkaPay.PaymentIntent.t()) :: map()
```

Params of `POST /v1/payment_intents` and `POST /v1/payment_intents/:id`: the fields set, the
amount in Stripe's units with its currency, and the reference and owner in the metadata.

# `payment_link`

```elixir
@spec payment_link(map()) ::
  {:ok, MishkaPay.PaymentLink.t()} | {:error, Splode.Error.t()}
```

A Stripe payment link as a `MishkaPay.PaymentLink`, with its line items when expanded.

# `payment_link_params`

```elixir
@spec payment_link_params(MishkaPay.PaymentLink.t(), map()) :: map()
```

Params of `POST /v1/payment_links`: its prices, where the buyer goes after paying, and the
options a checkout has; the tenant's automatic tax when the link does not say.

# `payment_link_update_params`

```elixir
@spec payment_link_update_params(MishkaPay.PaymentLink.t()) :: map()
```

Params of `POST /v1/payment_links/:id`: every option set on the link, on or off, its limits and
messages; its prices and trial stay as made.

# `payment_method`

```elixir
@spec payment_method(map()) ::
  {:ok, MishkaPay.Customer.PaymentMethod.t()} | {:error, Splode.Error.t()}
```

A Stripe PaymentMethod as a `MishkaPay.Customer.PaymentMethod`, with its card when it is one.

# `payout`

```elixir
@spec payout(map()) ::
  {:ok, MishkaPay.Balance.Payout.t()} | {:error, Splode.Error.t()}
```

A Stripe Payout as a `MishkaPay.Balance.Payout`.

# `portal_configuration`

```elixir
@spec portal_configuration(map()) ::
  {:ok, MishkaPay.PortalSession.Configuration.t()} | {:error, Splode.Error.t()}
```

A Stripe portal configuration (`billing_portal.configuration`) as a `MishkaPay.PortalSession.Configuration`.

# `portal_configuration_params`

```elixir
@spec portal_configuration_params(MishkaPay.PortalSession.Configuration.t()) :: map()
```

Params of `POST /v1/billing_portal/configurations` (and its update): only what is set. A list
of choices turns its feature on with them, or off when empty.

# `portal_flow`

```elixir
@spec portal_flow(MishkaPay.PortalSession.t()) :: map() | nil
```

The `flow_data` of a portal session: the one task it opens on, then back to the site.

# `preview_params`

```elixir
@spec preview_params(MishkaPay.Subscription.Change.t(), String.t()) :: map()
```

Params of `POST /v1/invoices/create_preview` for the same change, without making it.

# `price`

```elixir
@spec price(map()) :: {:ok, MishkaPay.Price.t()} | {:error, Splode.Error.t()}
```

A Stripe price as a catalog `MishkaPay.Price`: named after its product when the product is
expanded, else its nickname.

# `price_params`

```elixir
@spec price_params(MishkaPay.Price.t()) :: map()
```

Params of `POST /v1/prices`: the product, the amount, and the schedule of a plan.

# `product`

```elixir
@spec product(map()) :: {:ok, MishkaPay.Product.t()} | {:error, Splode.Error.t()}
```

A Stripe product as a `MishkaPay.Product`.

# `product_params`

```elixir
@spec product_params(MishkaPay.Product.t()) :: map()
```

Params of `POST /v1/products` (and its update): only the fields set.

# `promotion_code`

```elixir
@spec promotion_code(map()) ::
  {:ok, MishkaPay.Coupon.PromotionCode.t()} | {:error, Splode.Error.t()}
```

A Stripe promotion code as a `MishkaPay.Coupon.PromotionCode`.

# `promotion_code_params`

```elixir
@spec promotion_code_params(MishkaPay.Coupon.PromotionCode.t()) :: map()
```

Params of `POST /v1/promotion_codes`: the coupon it applies (as Stripe's `promotion`), the code
and its own limits.

# `promotion_code_update_params`

```elixir
@spec promotion_code_update_params(MishkaPay.Coupon.PromotionCode.t()) :: map()
```

Params of `POST /v1/promotion_codes/:id`: only whether it is active, and its metadata.

# `refund`

```elixir
@spec refund(map()) :: {:ok, MishkaPay.Refund.t()} | {:error, Splode.Error.t()}
```

A Stripe refund read on its own, as a `MishkaPay.Refund`; its payment is the PaymentIntent, or
the charge for a refund of a payment made without one.

# `refund`

```elixir
@spec refund(map(), MishkaPay.Refund.t()) ::
  {:ok, MishkaPay.Refund.t()} | {:error, Splode.Error.t()}
```

The refund with Stripe's answer: its id, status, amount and time.

# `refund_params`

```elixir
@spec refund_params(MishkaPay.Refund.t()) :: map()
```

Params of `POST /v1/refunds`: the payment, and the amount when it is not the whole.

# `setup_intent`

```elixir
@spec setup_intent(map()) ::
  {:ok, MishkaPay.SetupIntent.t()} | {:error, Splode.Error.t()}
```

A Stripe SetupIntent as a `MishkaPay.SetupIntent`, for a page with Stripe Elements.

# `setup_intent_params`

```elixir
@spec setup_intent_params(MishkaPay.SetupIntent.t()) :: map()
```

Params of `POST /v1/setup_intents`: the fields set, and the reference in the metadata.

# `shipping_rate`

```elixir
@spec shipping_rate(map()) ::
  {:ok, MishkaPay.ShippingRate.t()} | {:error, Splode.Error.t()}
```

A Stripe shipping rate as a `MishkaPay.ShippingRate`.

# `shipping_rate_params`

```elixir
@spec shipping_rate_params(MishkaPay.ShippingRate.t()) :: map()
```

Params of `POST /v1/shipping_rates` (and of a checkout's `shipping_rate_data`): a fixed amount
for the order, with its delivery estimate in business days.

# `sold`

```elixir
@spec sold(map() | nil) :: [MishkaPay.Price.t()]
```

What a checkout sold, from its line items (asked for with `expand[]=line_items`): each a
`MishkaPay.Price` with its price and product ids, name, unit amount and quantity.

# `subscription`

```elixir
@spec subscription(map()) ::
  {:ok, MishkaPay.Subscription.t()} | {:error, Splode.Error.t()}
```

A Subscription, with its customer and its items' products expanded, as a
`MishkaPay.Subscription`. The period comes from its items (Stripe moved it there), or from the
subscription itself on older answers.

# `subscription_schedule`

```elixir
@spec subscription_schedule(map()) ::
  {:ok, MishkaPay.Subscription.Schedule.t()} | {:error, Splode.Error.t()}
```

A Stripe subscription schedule as a `MishkaPay.Subscription.Schedule`: its phases with their
dates, and which of them runs now.

# `subscription_schedule_params`

```elixir
@spec subscription_schedule_params(MishkaPay.Subscription.Schedule.t(), map()) ::
  map()
```

Params of `POST /v1/subscription_schedules`: `from_subscription` alone (Stripe takes nothing
else with it, metadata and billing mode neither), or the customer, its start (now unless
given), the phases and what happens after them, its billing mode (`billing_mode/2`, with the
tenant's `settings`), with the reference in its metadata.

# `subscription_schedule_update_params`

```elixir
@spec subscription_schedule_update_params(MishkaPay.Subscription.Schedule.t()) ::
  map()
```

Params of `POST /v1/subscription_schedules/:id`: only what the change sets.

# `tax_calculation`

```elixir
@spec tax_calculation(map()) ::
  {:ok, MishkaPay.TaxCalculation.t()} | {:error, Splode.Error.t()}
```

A Stripe Tax Calculation (`tax.calculation`) as a `MishkaPay.TaxCalculation`.

# `tax_calculation_params`

```elixir
@spec tax_calculation_params(MishkaPay.TaxCalculation.t()) :: map()
```

Params of `POST /v1/tax/calculations`: the lines (each its whole amount), the buyer's address
or customer, the shipping cost, and the lines asked back with their tax.

# `tax_id`

```elixir
@spec tax_id(map()) ::
  {:ok, MishkaPay.Customer.TaxId.t()} | {:error, Splode.Error.t()}
```

A Stripe tax id (`object: "tax_id"`) as a `MishkaPay.Customer.TaxId`, with its register check.

# `tax_id_params`

```elixir
@spec tax_id_params(MishkaPay.Customer.TaxId.t()) :: map()
```

Params of `POST /v1/customers/:id/tax_ids`: its kind and its number.

# `tax_rate`

```elixir
@spec tax_rate(map()) :: {:ok, MishkaPay.TaxRate.t()} | {:error, Splode.Error.t()}
```

A Stripe Tax Rate as a `MishkaPay.TaxRate`.

# `tax_rate_params`

```elixir
@spec tax_rate_params(MishkaPay.TaxRate.t()) :: map()
```

Params of `POST /v1/tax_rates` and `POST /v1/tax_rates/:id`: the fields set, with the reference
in the metadata. A change never sets the percentage or whether it is inclusive.

# `tax_registration`

```elixir
@spec tax_registration(map()) ::
  {:ok, MishkaPay.TaxSettings.Registration.t()} | {:error, Splode.Error.t()}
```

A Stripe Tax Registration as a `MishkaPay.TaxSettings.Registration`.

# `tax_registration_params`

```elixir
@spec tax_registration_params(MishkaPay.TaxSettings.Registration.t()) :: map()
```

Params of `POST /v1/tax/registrations`: the country, and its kind (and state or province, or
a standard registration's place of supply scheme) under the country's own `country_options`;
it starts now unless `:active_from` says when.

# `tax_settings`

```elixir
@spec tax_settings(map()) ::
  {:ok, MishkaPay.TaxSettings.t()} | {:error, Splode.Error.t()}
```

Stripe Tax's settings (`tax.settings`) as a `MishkaPay.TaxSettings`.

# `tax_settings_params`

```elixir
@spec tax_settings_params(MishkaPay.TaxSettings.t()) :: map()
```

Params of `POST /v1/tax/settings`: only the head office and defaults given.

# `tax_transaction`

```elixir
@spec tax_transaction(map(), String.t()) ::
  {:ok, MishkaPay.TaxCalculation.Transaction.t()} | {:error, Splode.Error.t()}
```

A Stripe Tax Transaction as a `MishkaPay.TaxCalculation.Transaction`, made from `calculation_id`.

# `thin_event`

```elixir
@spec thin_event(map(), map() | nil, map() | nil) ::
  {:ok, MishkaPay.Event.t()} | {:error, Splode.Error.t()}
```

A thin event of a v1 resource (`v1.invoice.paid`) as the `MishkaPay.Event` its snapshot event
gives, with its own id, time and `context` (its `:account`) and the snapshot event's type
(`event_type/1`): its ids are read from
`object`, the related object as Stripe answers it now, or, left `nil`, from the related object's
id and type alone; `before` is the full event's `changes.before`, where a detached payment
method still names its customer.

# `transfer`

```elixir
@spec transfer(map()) :: {:ok, MishkaPay.Transfer.t()} | {:error, Splode.Error.t()}
```

A Stripe Transfer as a `MishkaPay.Transfer`, with what was taken back of it.

# `transfer_params`

```elixir
@spec transfer_params(MishkaPay.Transfer.t()) :: map()
```

Params of `POST /v1/transfers`: the amount in Stripe's places, the connected account, the sale
it pays out of, its group and the reference in its metadata.

# `usage`

```elixir
@spec usage(map(), MishkaPay.Usage.t()) :: MishkaPay.Usage.t()
```

The usage with Stripe's answer: its `identifier` as the report's id.

# `usage_cancellation`

```elixir
@spec usage_cancellation(map(), MishkaPay.Usage.Cancellation.t()) ::
  {:ok, MishkaPay.Usage.Cancellation.t()}
```

The cancel with Stripe's answer: the adjustment's `status`.

# `usage_cancellation_params`

```elixir
@spec usage_cancellation_params(MishkaPay.Usage.Cancellation.t()) :: map()
```

Params of `POST /v1/billing/meter_event_adjustments`: cancel the report by its identifier.

# `usage_event`

```elixir
@spec usage_event(MishkaPay.Usage.t(), String.t()) :: map()
```

One event of `POST /v2/billing/meter_event_stream` (JSON): the customer and the value in its
payload, its `identifier`, and when it happened as an ISO 8601 time.

# `usage_params`

```elixir
@spec usage_params(MishkaPay.Usage.t(), String.t() | nil) :: map()
```

Params of `POST /v1/billing/meter_events`: the customer and the value in its payload, when it
happened, and `identifier`, Stripe's id of the report, which never counts twice.

# `usage_size`

```elixir
@spec usage_size(integer() | Decimal.t()) :: {non_neg_integer(), non_neg_integer()}
```

How long a usage value is as Stripe reads it: `{digits, places}`, its digits without leading
zeros and those after the decimal point, of the value as it is sent (trailing zeros after the
point dropped).

# `usage_summary`

```elixir
@spec usage_summary(map(), String.t(), String.t(), [{String.t(), String.t()}]) ::
  {:ok, MishkaPay.Usage.Summary.t()} | {:error, Splode.Error.t()}
```

Stripe's summaries of a window as one `MishkaPay.Usage.Summary`. Asked for without grouping,
Stripe answers one summary for the whole window, or none when nothing was reported.

# `usage_summary_params`

```elixir
@spec usage_summary_params(String.t(), DateTime.t(), DateTime.t()) :: [
  {String.t(), String.t()}
]
```

Params of `GET /v1/billing/meters/:id/event_summaries` for one customer: Stripe counts from and
to whole minutes, so the window widens to them, `to` rounded up.

# `with_checkout`

```elixir
@spec with_checkout(MishkaPay.Payment.t(), map() | nil) :: MishkaPay.Payment.t()
```

The payment with the checkout that took it and what it sold, from Stripe's list of sessions.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
