com.atiproto.payment.subscription.create
Create a subscription to a user. Returns a one-off cart with checkout URL.
Details · procedure
| Kind | procedure |
|---|---|
| Authority | subscription.payment.atiproto.com |
| Indexed |
Checks
Valid Lint pass{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"description": "Create a subscription to a user. Returns a one-off cart with checkout URL.",
"input": {
"encoding": "application/json",
"schema": {
"properties": {
"amount": {
"description": "Custom amount in cents (if pay-as-you-want enabled)",
"type": "integer"
},
"cartUri": {
"description": "AT-URI of an existing cart to add this subscription to. If omitted, a new cart is created.",
"format": "at-uri",
"type": "string"
},
"currency": {
"description": "ISO 4217 currency code",
"maxLength": 3,
"type": "string"
},
"interval": {
"description": "Billing interval",
"enum": [
"monthly",
"yearly"
],
"maxLength": 64,
"type": "string"
},
"isPrivate": {
"description": "If true, the recipient (subject) is stored only in atiproto's private database and is omitted from the PDS subscription record.",
"type": "boolean"
},
"redirectUrl": {
"description": "URL to redirect to after checkout completes",
"format": "uri",
"type": "string"
},
"subject": {
"description": "DID of the user to subscribe to",
"format": "did",
"type": "string"
},
"workflow": {
"description": "Workflow callback envelope. Present on agent-driven callbacks; absent on initial calls.",
"ref": "com.atiproto.actions#inboundWorkflow",
"type": "ref"
}
},
"required": [
"subject",
"currency",
"interval"
],
"type": "object"
}
},
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"cart": {
"description": "The created cart record (status: open)",
"ref": "com.atiproto.cart#view",
"type": "ref"
},
"cartUri": {
"description": "URI of the cart record in PDS",
"format": "at-uri",
"type": "string"
},
"checkoutUrl": {
"description": "Checkout URL hosted by atiproto",
"format": "uri",
"type": "string"
},
"subscription": {
"description": "The created subscription record (status: pending)",
"ref": "com.atiproto.subscription#view",
"type": "ref"
},
"subscriptionUri": {
"description": "URI of the subscription record in PDS",
"format": "at-uri",
"type": "string"
},
"workflow": {
"description": "Workflow envelope. When present, the agent runs the actions and calls back. When absent, this is the final native result.",
"ref": "com.atiproto.actions#outboundWorkflow",
"type": "ref"
}
},
"type": "object"
}
},
"type": "procedure"
}
},
"id": "com.atiproto.payment.subscription.create",
"lexicon": 1
}