> ## 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.

# Batch pay to users via email



## OpenAPI

````yaml https://api.snack.money/openapi.json?tags=Payments&group_by=Farcaster,X,Github,Email,Web post /payments/email/batch-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/email/batch-pay:
    post:
      tags:
        - Email
      summary: Batch pay to users via email
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchPaymentRequest'
            example:
              currency: USDC
              receivers:
                - receiver: tips@snack.money
                  amount: 1
                - receiver: user@example.com
                  amount: 0.5
              description: Batch payment via email
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchPaymentResponse'
        '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:
    BatchPaymentRequest:
      type: object
      properties:
        currency:
          type: string
          enum:
            - USDC
          default: USDC
          example: USDC
        receivers:
          type: array
          items:
            type: object
            properties:
              receiver:
                type: string
                minLength: 1
                example: snackmoney
              amount:
                type: number
                minimum: 0.01
                maximum: 10
                example: 0.5
            required:
              - receiver
              - amount
          minItems: 1
          maxItems: 100
        description:
          type: string
          nullable: true
          example: A description about the payment
        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
            agent_name:
              type: string
              nullable: true
      required:
        - receivers
    BatchPaymentResponse:
      type: object
      properties:
        code:
          type: number
          enum:
            - 200
        msg:
          type: string
          default: Payment sent successfully to users
        settlement_attempt_id:
          type: string
          example: attempt_1762889082833_abc123
        data:
          type: array
          items:
            type: object
            properties:
              txn_id:
                type: number
                example: 1751194593304
              username:
                type: string
                example: snackmoney
              receipt:
                type: string
                format: uri
                example: https://snack.money/transaction/1751194593304
            required:
              - txn_id
              - username
              - receipt
      required:
        - code
        - 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

````