com.atiproto.subscription
recordcom.atiprotoRecord Schema
| Name | Type | Required | Description |
|---|---|---|---|
| subject | union | optional | Reference 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. |
| amount | integer | required | Per-period subscription amount in the smallest unit of the cart's `currency` (0 for free).(min: 0) |
| interval | union | required | Billing 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 }`). |
| status | string | required | Subscription lifecycle state. Open to extension via `knownValues`; PoS continues to interpret these values for subscription-specific flows (renewal, dunning, etc.). |
| billingStartDate | string (datetime) | required | First billing period; can be used to derive recurrence. |
| cancelledAt | string (datetime) | optional | |
| accessUntil | string (datetime) | optional | Date until which the subscriber retains access after cancellation. |
| createdAt | string (datetime) | required | |
| signatures | array<network.attested.signature | com.atproto.repo.strongRef> | required | PoS + 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
| Name | Type | Required | Description |
|---|---|---|---|
| uri | string (at-uri) | required | |
| cid | string (cid) | optional | |
| subject | union | optional | |
| amount | integer | required | (min: 0) |
| interval | union | required | |
| status | string | required | |
| billingStartDate | string (datetime) | required | |
| renewalDate | string (datetime) | optional | Next scheduled renewal/billing date. Server-derived from the billing schedule; not stored on the record. |
| cancelledAt | string (datetime) | optional | |
| accessUntil | string (datetime) | optional | |
| createdAt | string (datetime) | required | |
| signatures | array<network.attested.signature | com.atproto.repo.strongRef> | optional |
Type: userRef
| Name | Type | Required | Description |
|---|---|---|---|
| did | string (did) | required |
Usage Example
typescript
import { Agent } from "@atiproto/agent";// Create a TipAgent from any XrpcClientconst paymentAgent = new Agent(authenticatedClient);// com.atiproto.subscription record shapeconst 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: [...]};