com.atiproto.subscription

recordcom.atiproto

Record Schema

NameTypeRequiredDescription
subjectunionoptionalReference to the entity being subscribed to. Either a `com.atproto.repo.strongRef` (a specific record, e.g. a paid feed) or a `#userRef` (a thin wrapper carrying a did string for the user being subscribed to). Absent when marked as private.
amountintegerrequiredPer-period subscription amount in the smallest unit of the cart's `currency` (0 for free).(min: 0)
intervalunionrequiredBilling cadence. Mirrors `network.attested.payment.initiate#interval`: either `network.attested.payment.initiate#namedInterval` (weekly / monthly / yearly) or `network.attested.payment.initiate#customInterval` (`{ days: integer >= 1 }`).
statusstringrequiredSubscription lifecycle state. Open to extension via `knownValues`; PoS continues to interpret these values for subscription-specific flows (renewal, dunning, etc.).
billingStartDatestring (datetime)requiredFirst billing period; can be used to derive recurrence.
cancelledAtstring (datetime)optional
accessUntilstring (datetime)optionalDate until which the subscriber retains access after cancellation.
createdAtstring (datetime)required
signaturesarray<network.attested.signature | com.atproto.repo.strongRef>requiredPoS + recipient AppView attestations. Each entry is either an inline `network.attested.signature` or a `com.atproto.repo.strongRef` pointing at a remote `network.attested.proof` record. The canonical signing payload covers `amount`, `interval`, `status`, `billingStartDate`, `createdAt`, plus `subject`, `cancelledAt`, and `accessUntil` when present. Mutating any of those fields invalidates every signature in this array.

Type: view

NameTypeRequiredDescription
uristring (at-uri)required
cidstring (cid)optional
subjectunionoptional
amountintegerrequired(min: 0)
intervalunionrequired
statusstringrequired
billingStartDatestring (datetime)required
renewalDatestring (datetime)optionalNext scheduled renewal/billing date. Server-derived from the billing schedule; not stored on the record.
cancelledAtstring (datetime)optional
accessUntilstring (datetime)optional
createdAtstring (datetime)required
signaturesarray<network.attested.signature | com.atproto.repo.strongRef>optional

Type: userRef

NameTypeRequiredDescription
didstring (did)required

Usage Example

typescript
import { Agent } from "@atiproto/agent";
// Create a TipAgent from any XrpcClient
const paymentAgent = new Agent(authenticatedClient);
// com.atiproto.subscription record shape
const record = {
subject: { ... },
amount: 500,
interval: { ... },
status: "example",
billingStartDate: "2026-01-01T00:00:00.000Z",
cancelledAt: "2026-01-01T00:00:00.000Z",
accessUntil: "2026-01-01T00:00:00.000Z",
createdAt: "2026-01-01T00:00:00.000Z",
signatures: [...]
};