> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snack.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay to farcaster user



## OpenAPI

````yaml https://api.snack.money/openapi.json?tags=Payments&group_by=Farcaster,X,Github,Email,Web post /payments/farcaster/pay
openapi: 3.0.0
info:
  title: Snack Money API
  version: 1.0.0
  description: >
    The **Snack Money API** enables seamless microtransaction and reward
    distribution for social networks and other platforms.  

    It is designed for scenarios where you need to send small amounts of USDC to
    individual users or groups, validate payments, and automate content-based
    reward payouts.


    ---


    ## Features


    - **Single Payments** – Send USDC payments directly to a single recipient
    via `/payments/pay`.

    - **Batch Payments** – Send USDC to multiple recipients in one request via
    `/payments/batch-pay`.

    - **Payment Validation** – Validate payment status and details using
    `/payments/validate`.

    - **Reward Distribution** – Create and confirm reward distribution orders
    based on content engagement using `/rewards/create-distribution` and
    `/rewards/confirm-distribution`.

    - **Supports Multiple Identities** – Payments can be made to recipients
    identified via:
      - Twitter
      - Farcaster
      - Domain names
    - **X402-Compliant** – Payment-required responses include full X-PAYMENT
    header details for compliance.


    ---


    ## Authentication


    Some endpoints require the `PAYMENT-SIGNATURE` header for processing.

    The header contains payment details that comply with the [X402 payment
    protocol](https://x402.org/).


    ---


    ## Error Handling


    The API returns standardized error responses:

    - **400** – Validation errors

    - **402** – Payment required

    - **500** – Internal server errors


    ---


    ## Example Use Cases


    - Reward social media users for likes, comments, or reposts.

    - Facilitate tipping between content creators and followers.

    - Batch transfer funds to multiple recipients with one API call.
servers: []
security: []
paths:
  /payments/farcaster/pay:
    post:
      tags:
        - Farcaster
      summary: Pay to farcaster user
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
            example:
              amount: 1
              currency: USDC
              receiver: snackmoney
              description: Payment to Farcaster user
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequired'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    PaymentRequest:
      type: object
      properties:
        amount:
          type: number
          minimum: 0.01
          maximum: 10
          example: 1
        currency:
          type: string
          enum:
            - USDC
          default: USDC
          example: USDC
        receiver:
          type: string
          minLength: 1
          example: snackmoney
        description:
          type: string
          nullable: true
          example: Description about the payment
        transaction_hash:
          type: string
          nullable: true
          example: Transaction Hash
        meta:
          type: object
          properties:
            snack_name:
              type: string
              nullable: true
            snack_emoji:
              type: string
              nullable: true
            snack_amount:
              type: number
              nullable: true
            source_wallet:
              type: string
              nullable: true
            snack_quantity:
              type: number
              nullable: true
            sender_username:
              type: string
              nullable: true
            sender_identity:
              type: string
              nullable: true
            agent_name:
              type: string
              nullable: true
            content_url:
              type: string
              nullable: true
      required:
        - amount
        - receiver
    PaymentResponse:
      type: object
      properties:
        code:
          type: number
          enum:
            - 200
        msg:
          type: string
        data:
          type: object
          properties:
            txn_id:
              type: number
              example: 1762890982975
            amount:
              type: number
              example: 0.01
            receipt:
              type: string
              format: uri
              example: https://snack.money/twitter/0xmesuthere?txn=1762890982975
          required:
            - txn_id
            - amount
            - receipt
      required:
        - code
        - msg
        - data
    ValidationError:
      type: object
      properties:
        code:
          type: number
          enum:
            - 400
        msg:
          type: string
          default: Validation failed
        error:
          nullable: true
      required:
        - code
    PaymentRequired:
      type: object
      properties:
        x402Version:
          type: number
          default: 1
        code:
          type: number
          enum:
            - 402
        msg:
          type: string
          default: PAYMENT-SIGNATURE header is required
        accepts:
          type: array
          items:
            type: object
            properties:
              scheme:
                type: string
                default: exact
              network:
                type: string
                default: base
              maxAmountRequired:
                type: string
                example: '1030000'
              resource:
                type: string
                default: https://snack.money
              description:
                type: string
              mimeType:
                type: string
              payTo:
                type: string
                default: '0x1223d566f05Ea54E5854434C4552c9f5C2259e0f'
              maxTimeoutSeconds:
                type: number
                default: 60
              asset:
                type: string
                default: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
              extra:
                type: object
                properties:
                  name:
                    type: string
                    default: USD Coin
                  version:
                    type: string
                    default: '2'
            required:
              - maxAmountRequired
              - extra
      required:
        - code
        - accepts
    InternalServerError:
      type: object
      properties:
        code:
          type: number
          enum:
            - 500
        msg:
          type: string
          default: Internal server error
        error:
          nullable: true
          example: Something went wrong
      required:
        - code

````