<!--
This file was generated by Spark. Do not edit it by hand.
-->
# AshBilling.Subscription

A Spark DSL extension for Ash resources storing subscriptions in the database.

Provider subscription IDs are unique within this resource and its Ash tenant.
Each scope must use one provider/account/environment. PostgreSQL consumers must
generate and apply a migration for the injected identity, resolving existing duplicates first.

The local model represents one recurring item/price per subscription. Multi-item
nonterminal snapshots are rejected, retaining the last supported snapshot and
returning a retryable error. Terminal events still revoke access without choosing
a price. This is not multi-item entitlement support; consumers must remediate
unsupported external subscriptions and decide access pending remediation.

Billing state is not implicitly accepted by wildcard create/update actions.
Explicitly named inputs remain an application authorization decision. Internal
webhook writes retain actions, policies, validations and tenant scope.

## Usage

    defmodule MyApp.Billing.Subscription do
      use Ash.Resource,
        domain: MyApp.Billing,
        extensions: [AshBilling.Subscription]

      billing_subscription do
        customer_relationship :user
        provider AshBilling.Providers.Stripe
      end
    end


## billing_subscription
Configuration for billing subscription resources.






### Options

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`provider`](#billing_subscription-provider){: #billing_subscription-provider } | `module` | `AshBilling.Providers.Stripe` | The billing provider module. |
| [`customer_relationship`](#billing_subscription-customer_relationship){: #billing_subscription-customer_relationship } | `atom` |  | The relationship linking to the customer resource. |







<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>
