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.
Summary
Functions
What a v2 account read includes: its configurations, requirements, defaults and identity.
A Stripe account link or login link as the MishkaPay.ConnectedAccount.Link asked for, with its URL.
Params of an account link: POST /v2/core/account_links (:v2), its use case with the two
pages; or POST /v1/account_links (:v1).
A Stripe application fee as a MishkaPay.ApplicationFee.
The Stripe balance as a MishkaPay.Balance: its payments balance, available and pending, one
money per currency, each below zero when Stripe's is.
A Stripe balance transaction as a MishkaPay.Balance.Transaction.
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.
The billing mode a subscription made from choice gets: its own :billing_mode, else the
tenant's (settings), else :flexible.
Params of POST /v1/payment_intents/:id/capture: the part to take, or none for all that is
held.
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.
A Checkout Session read back on its own: what Stripe filled in and the reference.
The checkout with Stripe's answer: its session id, page, status and payment.
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.
Params of an intent's confirm: the payment method and the page to come back to.
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.
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.
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.
A Stripe coupon as a MishkaPay.Coupon.
Params of POST /v1/coupons: what it takes off, for how long, and its limits.
A Stripe credit note (object: "credit_note") as a MishkaPay.CreditNote, with its lines.
A Stripe credit note line item as a MishkaPay.CreditNote.Lines, in its note's currency (the
line carries none).
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.
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.
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.
A Stripe customer balance transaction as a MishkaPay.Customer.BalanceTransaction.
What a v2 customer read includes: its customer configuration and identity.
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.
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.
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.
A Stripe dispute as a MishkaPay.Dispute.
A Stripe active entitlement as a MishkaPay.Feature.Entitlement.
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.
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).
The dispute evidence fields that take a file id (file_...) instead of text.
A Stripe feature as a MishkaPay.Feature; a product feature answers the feature it attached.
Params of POST /v1/entitlements/features.
A Stripe file as a MishkaPay.File.
A Stripe file link as a MishkaPay.File.Link.
Params of POST /v1/file_links: the file, and when the link ends.
Params of POST /v1/files, as multipart parts: the purpose, and the file with its name and
content type.
A Stripe Radar review as a MishkaPay.Payment.FraudReview.
A Stripe Radar early fraud warning as a MishkaPay.Payment.FraudWarning.
An Invoice as a MishkaPay.Invoice.
A Stripe invoice item (object: "invoiceitem") as a MishkaPay.Invoice.Item.
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.
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).
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.
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).
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.
A Stripe billing meter as a MishkaPay.Meter.
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.
Stripe's integer amount for money, in the places Stripe counts its currency in.
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.
A PaymentIntent, with its latest charge, the charge's refunds and the customer expanded, as a
MishkaPay.Payment.
A Stripe PaymentIntent as a MishkaPay.PaymentIntent, for a page with Stripe Elements.
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.
A Stripe payment link as a MishkaPay.PaymentLink, with its line items when expanded.
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.
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.
A Stripe PaymentMethod as a MishkaPay.Customer.PaymentMethod, with its card when it is one.
A Stripe Payout as a MishkaPay.Balance.Payout.
A Stripe portal configuration (billing_portal.configuration) as a MishkaPay.PortalSession.Configuration.
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.
The flow_data of a portal session: the one task it opens on, then back to the site.
Params of POST /v1/invoices/create_preview for the same change, without making it.
A Stripe price as a catalog MishkaPay.Price: named after its product when the product is
expanded, else its nickname.
Params of POST /v1/prices: the product, the amount, and the schedule of a plan.
A Stripe product as a MishkaPay.Product.
Params of POST /v1/products (and its update): only the fields set.
A Stripe promotion code as a MishkaPay.Coupon.PromotionCode.
Params of POST /v1/promotion_codes: the coupon it applies (as Stripe's promotion), the code
and its own limits.
Params of POST /v1/promotion_codes/:id: only whether it is active, and its metadata.
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.
The refund with Stripe's answer: its id, status, amount and time.
Params of POST /v1/refunds: the payment, and the amount when it is not the whole.
A Stripe SetupIntent as a MishkaPay.SetupIntent, for a page with Stripe Elements.
Params of POST /v1/setup_intents: the fields set, and the reference in the metadata.
A Stripe shipping rate as a MishkaPay.ShippingRate.
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.
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.
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.
A Stripe subscription schedule as a MishkaPay.Subscription.Schedule: its phases with their
dates, and which of them runs now.
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.
Params of POST /v1/subscription_schedules/:id: only what the change sets.
A Stripe Tax Calculation (tax.calculation) as a MishkaPay.TaxCalculation.
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.
A Stripe tax id (object: "tax_id") as a MishkaPay.Customer.TaxId, with its register check.
Params of POST /v1/customers/:id/tax_ids: its kind and its number.
A Stripe Tax Rate as a MishkaPay.TaxRate.
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.
A Stripe Tax Registration as a MishkaPay.TaxSettings.Registration.
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.
Stripe Tax's settings (tax.settings) as a MishkaPay.TaxSettings.
Params of POST /v1/tax/settings: only the head office and defaults given.
A Stripe Tax Transaction as a MishkaPay.TaxCalculation.Transaction, made from calculation_id.
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.
A Stripe Transfer as a MishkaPay.Transfer, with what was taken back of it.
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.
The usage with Stripe's answer: its identifier as the report's id.
The cancel with Stripe's answer: the adjustment's status.
Params of POST /v1/billing/meter_event_adjustments: cancel the report by its identifier.
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.
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.
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).
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.
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.
The payment with the checkout that took it and what it sold, from Stripe's list of sessions.
Functions
@spec account_includes() :: [String.t()]
What a v2 account read includes: its configurations, requirements, defaults and identity.
@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.
@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).
@spec application_fee(map()) :: {:ok, MishkaPay.ApplicationFee.t()} | {:error, Splode.Error.t()}
A Stripe application fee as a MishkaPay.ApplicationFee.
@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.
@spec balance_transaction(map()) :: {:ok, MishkaPay.Balance.Transaction.t()} | {:error, Splode.Error.t()}
A Stripe balance transaction as a MishkaPay.Balance.Transaction.
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.
The billing mode a subscription made from choice gets: its own :billing_mode, else the
tenant's (settings), else :flexible.
Params of POST /v1/payment_intents/:id/capture: the part to take, or none for all that is
held.
@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.
@spec checkout(map()) :: MishkaPay.Checkout.t()
A Checkout Session read back on its own: what Stripe filled in and the reference.
@spec checkout(map(), MishkaPay.Checkout.t()) :: MishkaPay.Checkout.t()
The checkout with Stripe's answer: its session id, page, status and payment.
@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.
Params of an intent's confirm: the payment method and the page to come back to.
@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.
@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.
@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.
@spec coupon(map()) :: {:ok, MishkaPay.Coupon.t()} | {:error, Splode.Error.t()}
A Stripe coupon as a MishkaPay.Coupon.
@spec coupon_params(MishkaPay.Coupon.t()) :: map()
Params of POST /v1/coupons: what it takes off, for how long, and its limits.
@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.
@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).
@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.
@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.
@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.
@spec customer_balance_transaction(map()) :: {:ok, MishkaPay.Customer.BalanceTransaction.t()} | {:error, Splode.Error.t()}
A Stripe customer balance transaction as a MishkaPay.Customer.BalanceTransaction.
@spec customer_includes() :: [String.t()]
What a v2 customer read includes: its customer configuration and identity.
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.
@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.
@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.
@spec dispute(map()) :: {:ok, MishkaPay.Dispute.t()} | {:error, Splode.Error.t()}
A Stripe dispute as a MishkaPay.Dispute.
@spec entitlement(map()) :: {:ok, MishkaPay.Feature.Entitlement.t()} | {:error, Splode.Error.t()}
A Stripe active entitlement as a MishkaPay.Feature.Entitlement.
@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.
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).
@spec evidence_files() :: [String.t()]
The dispute evidence fields that take a file id (file_...) instead of text.
@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.
@spec feature_params(MishkaPay.Feature.t()) :: map()
Params of POST /v1/entitlements/features.
@spec file(map()) :: {:ok, MishkaPay.File.t()} | {:error, Splode.Error.t()}
A Stripe file as a MishkaPay.File.
@spec file_link(map()) :: {:ok, MishkaPay.File.Link.t()} | {:error, Splode.Error.t()}
A Stripe file link as a MishkaPay.File.Link.
Params of POST /v1/file_links: the file, and when the link ends.
@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.
@spec fraud_review(map()) :: {:ok, MishkaPay.Payment.FraudReview.t()} | {:error, Splode.Error.t()}
A Stripe Radar review as a MishkaPay.Payment.FraudReview.
@spec fraud_warning(map()) :: {:ok, MishkaPay.Payment.FraudWarning.t()} | {:error, Splode.Error.t()}
A Stripe Radar early fraud warning as a MishkaPay.Payment.FraudWarning.
@spec invoice(map()) :: {:ok, MishkaPay.Invoice.t()} | {:error, Splode.Error.t()}
An Invoice as a MishkaPay.Invoice.
@spec invoice_item(map()) :: {:ok, MishkaPay.Invoice.Item.t()} | {:error, Splode.Error.t()}
A Stripe invoice item (object: "invoiceitem") as a MishkaPay.Invoice.Item.
@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.
@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).
@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.
@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).
@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.
@spec meter(map()) :: {:ok, MishkaPay.Meter.t()} | {:error, Splode.Error.t()}
A Stripe billing meter as a MishkaPay.Meter.
@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.
Stripe's integer amount for money, in the places Stripe counts its currency in.
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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@spec payout(map()) :: {:ok, MishkaPay.Balance.Payout.t()} | {:error, Splode.Error.t()}
A Stripe Payout as a MishkaPay.Balance.Payout.
@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.
@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.
@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.
@spec preview_params(MishkaPay.Subscription.Change.t(), String.t()) :: map()
Params of POST /v1/invoices/create_preview for the same change, without making it.
@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.
@spec price_params(MishkaPay.Price.t()) :: map()
Params of POST /v1/prices: the product, the amount, and the schedule of a plan.
@spec product(map()) :: {:ok, MishkaPay.Product.t()} | {:error, Splode.Error.t()}
A Stripe product as a MishkaPay.Product.
@spec product_params(MishkaPay.Product.t()) :: map()
Params of POST /v1/products (and its update): only the fields set.
@spec promotion_code(map()) :: {:ok, MishkaPay.Coupon.PromotionCode.t()} | {:error, Splode.Error.t()}
A Stripe promotion code as a MishkaPay.Coupon.PromotionCode.
@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.
@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.
@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.
@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.
@spec refund_params(MishkaPay.Refund.t()) :: map()
Params of POST /v1/refunds: the payment, and the amount when it is not the whole.
@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.
@spec setup_intent_params(MishkaPay.SetupIntent.t()) :: map()
Params of POST /v1/setup_intents: the fields set, and the reference in the metadata.
@spec shipping_rate(map()) :: {:ok, MishkaPay.ShippingRate.t()} | {:error, Splode.Error.t()}
A Stripe shipping rate as a MishkaPay.ShippingRate.
@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.
@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.
@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.
@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.
@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.
@spec subscription_schedule_update_params(MishkaPay.Subscription.Schedule.t()) :: map()
Params of POST /v1/subscription_schedules/:id: only what the change sets.
@spec tax_calculation(map()) :: {:ok, MishkaPay.TaxCalculation.t()} | {:error, Splode.Error.t()}
A Stripe Tax Calculation (tax.calculation) as a MishkaPay.TaxCalculation.
@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.
@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.
@spec tax_id_params(MishkaPay.Customer.TaxId.t()) :: map()
Params of POST /v1/customers/:id/tax_ids: its kind and its number.
@spec tax_rate(map()) :: {:ok, MishkaPay.TaxRate.t()} | {:error, Splode.Error.t()}
A Stripe Tax Rate as a MishkaPay.TaxRate.
@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.
@spec tax_registration(map()) :: {:ok, MishkaPay.TaxSettings.Registration.t()} | {:error, Splode.Error.t()}
A Stripe Tax Registration as a MishkaPay.TaxSettings.Registration.
@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.
@spec tax_settings(map()) :: {:ok, MishkaPay.TaxSettings.t()} | {:error, Splode.Error.t()}
Stripe Tax's settings (tax.settings) as a MishkaPay.TaxSettings.
@spec tax_settings_params(MishkaPay.TaxSettings.t()) :: map()
Params of POST /v1/tax/settings: only the head office and defaults given.
@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.
@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.
@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.
@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.
@spec usage(map(), MishkaPay.Usage.t()) :: MishkaPay.Usage.t()
The usage with Stripe's answer: its identifier as the report's id.
@spec usage_cancellation(map(), MishkaPay.Usage.Cancellation.t()) :: {:ok, MishkaPay.Usage.Cancellation.t()}
The cancel with Stripe's answer: the adjustment's status.
@spec usage_cancellation_params(MishkaPay.Usage.Cancellation.t()) :: map()
Params of POST /v1/billing/meter_event_adjustments: cancel the report by its identifier.
@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.
@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.
@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).
@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.
@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.
@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.