# com.atiproto.recipient.payment.subscription.validate

> Published by [atiproto.com](https://lexicon.garden/identity/did:plc:4x5dcv6u4wlkjcssto7f22nu)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.recipient.payment.subscription.validate)
- [Documentation](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.recipient.payment.subscription.validate/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.recipient.payment.subscription.validate/examples)

## Definitions

### `com.atiproto.recipient.payment.subscription.validate`

**Type**: `query`

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.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `amount` | `integer` | No | Expected subscription amount in cents. If omitted, only checks that a subscription exists. |
| `sender` | `string` (did) | No | DID of the subscriber. Ignored if subscriptionUri is provided. |
| `subscriptionUri` | `string` (at-uri) | No | AT-URI of a specific subscription record. Takes precedence over sender. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `valid` | `boolean` | Yes | Whether a sender has an active, verified subscription to the authed recipient |
| `amount` | `integer` | No | Subscription amount in cents |
| `reason` | `string` | No | If invalid, reason for rejection |
| `currency` | `string` | No | Currency of the subscription |

## Raw Schema

```json
{
  "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
}
```
