com.atiproto.payment.subscription.create

atiproto.com

Documentation

Create a subscription to a user. Returns a one-off cart with checkout URL.

main procedure

Create a subscription to a user. Returns a one-off cart with checkout URL.

Input

Encodingapplication/json
amount integer Optional

Custom amount in cents (if pay-as-you-want enabled)

cartUri stringat-uri Optional

AT-URI of an existing cart to add this subscription to. If omitted, a new cart is created.

currency string Required

ISO 4217 currency code

maxLength: 3 bytes
interval string Required

Billing interval

maxLength: 64 bytes
isPrivate boolean Optional

If true, the recipient (subject) is stored only in atiproto's private database and is omitted from the PDS subscription record.

redirectUrl stringuri Optional

URL to redirect to after checkout completes

subject stringdid Required

DID of the user to subscribe to

Output

Encodingapplication/json
cartUri stringat-uri Optional

URI of the cart record in PDS

checkoutUrl stringuri Optional

Checkout URL hosted by atiproto

subscriptionUri stringat-uri Optional

URI of the subscription record in PDS

Try It

Requests are sent directly from your browser. Some servers may block requests due to CORS.

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

Lexicon Garden

@