# com.atiproto.recipient.payment.item.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.item.validate)
- [Documentation](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.recipient.payment.item.validate/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:4x5dcv6u4wlkjcssto7f22nu/com.atiproto.recipient.payment.item.validate/examples)

## Definitions

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

**Type**: `query`

Validate that a sender has completed item payment(s) to the authenticated user (as the recipient/subject). Looks up by itemUri (a specific item record), recordUri (sums all items for that record), or sender (sender DID). These are mutually exclusive and resolved in that order.

#### Parameters

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

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `valid` | `boolean` | Yes | Whether a sender has completed and verified item(s) to the authed recipient |
| `amount` | `integer` | No | Sum of all verified completed item amounts in cents |
| `reason` | `string` | No | If invalid, reason for rejection |
| `currency` | `string` | No | Currency of the items |

## Raw Schema

```json
{
  "id": "com.atiproto.recipient.payment.item.validate",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "valid"
          ],
          "properties": {
            "valid": {
              "type": "boolean",
              "description": "Whether a sender has completed and verified item(s) to the authed recipient"
            },
            "amount": {
              "type": "integer",
              "description": "Sum of all verified completed item amounts in cents"
            },
            "reason": {
              "type": "string",
              "maxLength": 1024,
              "description": "If invalid, reason for rejection"
            },
            "currency": {
              "type": "string",
              "maxLength": 3,
              "description": "Currency of the items"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Expected item amount in cents. If omitted, only checks that a item exists."
          },
          "sender": {
            "type": "string",
            "format": "did",
            "description": "DID of the item sender. Ignored if itemUri or recordUri is provided."
          },
          "itemUri": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of a specific item record. Takes precedence over recordUri and sender."
          },
          "recordUri": {
            "type": "string",
            "format": "at-uri",
            "description": "AT-URI of the record being tipped. Takes precedence over sender."
          }
        }
      },
      "description": "Validate that a sender has completed item payment(s) to the authenticated user (as the recipient/subject). Looks up by itemUri (a specific item record), recordUri (sums all items for that record), or sender (sender DID). These are mutually exclusive and resolved in that order."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
