{
"id": "com.atiproto.recipient.payment.subscription.validate",
"defs": {
"main": {
"type": "query",
"output": {
"schema": {
"type": "object",
"required": [
"valid"
],
"properties": {
"valid": {
"type": "boolean",
"description": "Whether a sender has an active, verified subscription to the authed recipient"
},
"amount": {
"type": "integer",
"description": "Subscription amount in cents"
},
"reason": {
"type": "string",
"maxLength": 1024,
"description": "If invalid, reason for rejection"
},
"currency": {
"type": "string",
"maxLength": 3,
"description": "Currency of the subscription"
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"properties": {
"amount": {
"type": "integer",
"description": "Expected subscription amount in cents. If omitted, only checks that a subscription exists."
},
"sender": {
"type": "string",
"format": "did",
"description": "DID of the subscriber. Ignored if subscriptionUri is provided."
},
"subscriptionUri": {
"type": "string",
"format": "at-uri",
"description": "AT-URI of a specific subscription record. Takes precedence over sender."
}
}
},
"description": "Validate that a sender has an active, Stripe-verified subscription to the authenticated user (as the recipient/subject). Looks up by subscriptionUri (a specific subscription record) or sender (subscriber DID). These are mutually exclusive; subscriptionUri takes precedence."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}