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

# Mail Check

> Sends a physical check payment by mail to a specified payee on behalf of a platform user.

This endpoint will:
- Download and validate the check attachment (PDF only, max 7MB, up to 10 pages)
- Calculate processing fees based on mail type and attachment pages
- Deduct the total amount (payment + fees) from the user's wallet
- Generate and mail a physical check to the payee's address
- Create payment and check records for tracking

Supported mail types include USPS First Class, USPS Certified, Overnight, and Two-Day delivery.
Processing fees vary by mail type and include additional charges for attachment pages.



## OpenAPI

````yaml POST /api/platform/payment/mail-check/{user_id}
openapi: 3.1.0
info:
  title: paywint
  version: 0.1.0
servers:
  - url: http://localhost:8001
  - url: https://api.pw.wintpay.com
  - url: https://test.pw.wintpay.com
  - url: https://api.sandbox.paywint.com
security: []
paths:
  /api/platform/payment/mail-check/{user_id}:
    post:
      tags:
        - Platform payment
      summary: Send Physical Check Payment
      description: >-
        Sends a physical check payment by mail to a specified payee on behalf of
        a platform user.


        This endpoint will:

        - Download and validate the check attachment (PDF only, max 7MB, up to
        10 pages)

        - Calculate processing fees based on mail type and attachment pages

        - Deduct the total amount (payment + fees) from the user's wallet

        - Generate and mail a physical check to the payee's address

        - Create payment and check records for tracking


        Supported mail types include USPS First Class, USPS Certified,
        Overnight, and Two-Day delivery.

        Processing fees vary by mail type and include additional charges for
        attachment pages.
      operationId: mail_check_api_platform_payment_mail_check__user_id__post
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique identifier (UUID) of the user who mails the check.
            title: User Id
          description: Unique identifier (UUID) of the user who mails the check.
          example: f47ac10b-****-****-****-0e02b2c3d479
        - name: X-Platform-ID
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              Unique platform identifier (UUID). You receive this during
              onboarding. Must be sent with every API request.
            title: X-Platform-Id
          description: >-
            Unique platform identifier (UUID). You receive this during
            onboarding. Must be sent with every API request.
        - name: X-Signature
          in: header
          required: true
          schema:
            type: string
            description: >-
              HMAC-SHA256 request signature for authentication. Use your
              platform secret key to compute it as: `METHOD + PATH + QUERY +
              BODY_HASH`.
            title: X-Signature
          description: >-
            HMAC-SHA256 request signature for authentication. Use your platform
            secret key to compute it as: `METHOD + PATH + QUERY + BODY_HASH`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalCheckPaymentCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse_ExternalCheckPaymentRead_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExternalCheckPaymentCreate:
      properties:
        payee_id:
          type: string
          format: uuid4
          title: Payee Id
          description: >-
            Unique identifier (UUID) of the recipient who will receive the
            physical check.
          example: f47ac10b-****-****-****-0e02b2c3d479
        amount:
          type: number
          minimum: 1
          title: Amount
          description: Payment amount in USD. Must be at least $1.00.
          example: 150
        payee_address_id:
          type: string
          format: uuid4
          title: Payee Address Id
          description: >-
            UUID of the recipient's mailing address where the physical check
            will be sent.
          example: f47ac10b-****-****-****-0e02b2c3d479
        invoice_no:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Invoice No
          description: >-
            Invoice or reference number that will appear on the check for
            tracking purposes.
          example: INV-2024-001234
        description:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Description
          description: Optional memo or description that will appear on the check.
          example: Payment for consulting services
        mail_type:
          $ref: '#/components/schemas/CheckMailType'
          description: >-
            Delivery method for the physical check. Options: USPS_FIRST_CLASS
            (default), USPS_CERTIFIED, OVERNIGHT, TWO_DAY. Different mail types
            have different processing fees.
          default: USPS_FIRST_CLASS
          example: USPS_FIRST_CLASS
        payment_method:
          $ref: '#/components/schemas/ExternalCheckPaymentMethodRead'
          description: >-
            Payment source for the check amount and fees. Currently only WALLET
            is supported.
          default: WALLET
          example: WALLET
        remittance:
          anyOf:
            - items:
                $ref: '#/components/schemas/RemittanceAdvice'
              type: array
            - type: 'null'
          title: Remittance
          description: >-
            Optional list of remittance details to include with the check
            (maximum 50 items). Useful for invoice breakdowns or payment
            details.
        attachment_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Attachment Url
          description: >-
            Optional HTTPS URL of a PDF document to attach to the check. Must be
            a valid PDF, maximum 7MB, up to 10 pages. Additional fees apply per
            page.
          example: https://example.com/documents/invoice.pdf
      type: object
      required:
        - payee_id
        - amount
        - payee_address_id
      title: ExternalCheckPaymentCreate
    CommonResponse_ExternalCheckPaymentRead_:
      properties:
        success:
          type: boolean
          title: Success
          description: Indicates whether the request was processed successfully.
          default: true
          example: true
        message:
          type: string
          title: Message
          description: >-
            A short, human-readable message describing the result of the
            request.
          default: Success
          example: Operation completed.
        data:
          anyOf:
            - $ref: '#/components/schemas/ExternalCheckPaymentRead'
            - type: 'null'
          description: The main response payload, if applicable
        queryGeneratedTime:
          anyOf:
            - type: number
            - type: 'null'
          title: Querygeneratedtime
          description: >-
            The Unix timestamp (in seconds) indicating when the response was
            generated.
          default: 1782303609.673092
          example: 1718006400
      type: object
      title: CommonResponse[ExternalCheckPaymentRead]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CheckMailType:
      type: string
      enum:
        - USPS_FIRST_CLASS
        - USPS_CERTIFIED
        - TWO_DAY
        - OVERNIGHT
      title: CheckMailType
    ExternalCheckPaymentMethodRead:
      type: string
      enum:
        - WALLET
      title: ExternalCheckPaymentMethodRead
    RemittanceAdvice:
      properties:
        id:
          type: string
          maxLength: 50
          minLength: 1
          title: Id
          description: >-
            Reference identifier for this remittance item (e.g., invoice number,
            transaction ID).
          example: INV-001
        date:
          type: string
          title: Date
          description: >-
            Date in MM-DD-YYYY format. Must be today or a future date (UTC
            timezone).
          example: 09-15-2025
        amount:
          type: number
          minimum: 0
          title: Amount
          description: Amount associated with this remittance item.
          example: 150
        gross:
          anyOf:
            - type: number
            - type: 'null'
          title: Gross
          description: Gross amount for this remittance entry.
          example: 150
        discount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount
          description: Discount associated with this remittance entry.
          example: 10
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description or note for this remittance item.
          example: Consulting services - September 2025
      type: object
      required:
        - id
        - date
        - amount
      title: RemittanceAdvice
    ExternalCheckPaymentRead:
      properties:
        payment_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Payment Id
          description: Unique identifier (UUID) of the payment transaction.
          example: f47ac10b-****-****-****-0e02b2c3d479
        transaction_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Transaction Id
          description: Integer ID of the payment
          example: 1501
        payer_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Payer Id
          description: Unique identifier (UUID) of the user who initiated the payment.
          example: f47ac10b-****-****-****-0e02b2c3d479
        payee_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Payee Id
          description: Unique identifier (UUID) of the recipient who received the payment
          example: f47ac10b-****-****-****-0e02b2c3d479
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
          description: Total amount transferred in the transaction.
          example: 100
        processing_fee:
          anyOf:
            - type: number
            - type: 'null'
          title: Processing Fee
          description: Processing fee charged on payment.
          example: 1.5
        delivery_fee:
          anyOf:
            - type: number
            - type: 'null'
          title: Delivery Fee
          description: Delivery fee charged on payment.
          example: 0.5
        invoice_no:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice No
          description: >-
            Invoice or transaction reference number for tracking and
            record-keeping purposes.
          example: INV-2024-001234
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: Three-letter ISO currency code for the transaction (e.g., USD).
          example: USD
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional note or description attached to the payment.
          example: June invoice for services
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Timestamp when the payment record was initially created.
          example: '2025-06-16T10:04:51.739761Z'
        payment_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Payment Date
          description: Timestamp when the payment was successfully processed or completed.
          example: '2025-06-16T10:13:16.749655Z'
        status:
          $ref: '#/components/schemas/PlatformPaymentStatus'
          description: The current status of the payment (e.g., success, failed, pending).
          example: success
        card_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Card Id
          description: UUID of the payer's card.
          example: f47ac10b-****-****-****-0e02b2c3d479
        bank_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Bank Id
          description: UUID of the payer's bank account.
          example: f47ac10b-****-****-****-0e02b2c3d479
        payee_card_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Payee Card Id
          description: UUID of the payee's card where funds are received.
          example: f47ac10b-****-****-****-0e02b2c3d479
        payee_bank_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Payee Bank Id
          description: UUID of the payee's bank account where funds are received.
          example: f47ac10b-****-****-****-0e02b2c3d479
        failure_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Reason
          description: Explanation for why the payment failed, if applicable.
          example: Insufficient wallet balance
        payment_method:
          anyOf:
            - $ref: '#/components/schemas/ExternalCheckPaymentMethodRead'
            - type: 'null'
          description: The method used to send the payment (e.g., WALLET, CARD, ACH).
          example: WALLET
        receiving_method:
          anyOf:
            - $ref: '#/components/schemas/ExternalPaymentReceivingMethodRead'
            - type: 'null'
          description: >-
            The destination method where the payment was received (e.g.,
            CHECK_MAIL, WALLET, CARD, ACH).
          example: CHECK_MAIL
        attachment_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Attachment Url
          description: Optional URL of the attachment added with the check.
          example: >-
            https://paywint-bucket.s3.amazonaws.com/wallet/check-payments/23ec826b-54cd-4241-a855-ae038bbf568a/testing.pdf
      type: object
      title: ExternalCheckPaymentRead
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PlatformPaymentStatus:
      type: string
      enum:
        - requested
        - initiated
        - check_pending
        - processing
        - SETTLING
        - approved
        - success
        - failed
        - request_failed
        - rejected
        - declined
        - mailed
        - expired
      title: PlatformPaymentStatus
    ExternalPaymentReceivingMethodRead:
      type: string
      enum:
        - CHECK_MAIL
      title: ExternalPaymentReceivingMethodRead

````