{
"id": "com.atiproto.subscription",
"defs": {
"main": {
"key": "any",
"type": "record",
"record": {
"type": "object",
"required": [
"subject",
"amount",
"currency",
"interval",
"status",
"billingStartDate",
"createdAt"
],
"properties": {
"amount": {
"type": "integer",
"minimum": 0,
"description": "Subscription amount in cents (0 for free subscriptions)"
},
"status": {
"enum": [
"pending",
"active",
"past_due",
"cancelled",
"expired"
],
"type": "string",
"maxLength": 64,
"description": "Subscription status"
},
"subject": {
"type": "string",
"format": "did",
"description": "DID of the user being subscribed to"
},
"currency": {
"type": "string",
"maxLength": 3,
"description": "ISO 4217 currency code"
},
"interval": {
"enum": [
"monthly",
"yearly"
],
"type": "string",
"maxLength": 64,
"description": "Billing interval"
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Creation timestamp"
},
"accessUntil": {
"type": "string",
"format": "datetime",
"description": "Date until which the subscriber retains access after cancellation"
},
"cancelledAt": {
"type": "string",
"format": "datetime",
"description": "Cancellation timestamp"
},
"billingStartDate": {
"type": "string",
"format": "datetime",
"description": "First billing period, can be used to determine recurrence"
}
}
},
"description": "A record representing a subscription from one user to another"
},
"view": {
"type": "object",
"required": [
"uri",
"amount",
"currency",
"interval",
"status",
"billingStartDate",
"createdAt"
],
"properties": {
"uri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of the subscription record"
},
"amount": {
"type": "integer",
"minimum": 0,
"description": "Subscription amount in cents (0 for free subscriptions)"
},
"status": {
"enum": [
"pending",
"active",
"past_due",
"cancelled",
"expired"
],
"type": "string",
"maxLength": 64,
"description": "Subscription status"
},
"subject": {
"type": "string",
"format": "did",
"description": "DID of the user being subscribed to"
},
"currency": {
"type": "string",
"maxLength": 3,
"description": "ISO 4217 currency code"
},
"interval": {
"enum": [
"monthly",
"yearly"
],
"type": "string",
"maxLength": 64,
"description": "Billing interval"
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Creation timestamp"
},
"accessUntil": {
"type": "string",
"format": "datetime",
"description": "Date until which the subscriber retains access after cancellation"
},
"cancelledAt": {
"type": "string",
"format": "datetime",
"description": "Cancellation timestamp"
},
"billingStartDate": {
"type": "string",
"format": "datetime",
"description": "First billing period, can be used to determine recurrence"
}
},
"description": "View of a subscription record for use in API responses"
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}