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

# Validate address

> Validate a destination address and optional memo before creating a LightSwap quote or asking a user to continue.



## OpenAPI

````yaml api-reference/openapi.json POST /address
openapi: 3.1.0
info:
  title: LightSwap API
  description: >-
    Backend REST API for approved LightSwap integrations to quote, create, and
    track swaps.
  version: 1.0.0
servers:
  - url: https://lightswap.me/api/partner/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Assets
    description: Supported asset discovery.
  - name: Address
    description: Destination address validation.
  - name: Quotes
    description: Short-lived quotes.
  - name: Swaps
    description: Swap creation and status tracking.
paths:
  /address:
    post:
      tags:
        - Address
      summary: Validate address
      description: Validates a destination address before swap creation.
      operationId: validateAddress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddressValidationRequest'
            examples:
              tronUsdt:
                summary: Validate a tron USDT address
                value:
                  network: tron
                  token: USDT
                  address: TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r
                  memo: null
      responses:
        '200':
          description: Validation result.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressValidationResponse'
              examples:
                valid:
                  summary: Valid address
                  value:
                    valid: true
                    normalizedAddress: TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r
                    requiresMemo: false
                    message: null
        '400':
          $ref: '#/components/responses/BadRequest'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    AddressValidationRequest:
      type: object
      required:
        - network
        - token
        - address
      properties:
        network:
          type: string
          example: tron
        token:
          type: string
          example: USDT
        address:
          type: string
          example: TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r
        memo:
          type:
            - string
            - 'null'
          description: Destination memo. The MVP accepts `null` or an omitted value.
          example: null
      additionalProperties: false
    AddressValidationResponse:
      type: object
      required:
        - valid
        - normalizedAddress
        - requiresMemo
        - message
      properties:
        valid:
          type: boolean
        normalizedAddress:
          type:
            - string
            - 'null'
        requiresMemo:
          type: boolean
        message:
          type:
            - string
            - 'null'
    ErrorResponse:
      type: object
      required:
        - error
        - requestId
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
        requestId:
          type: string
          example: req_123
    ErrorBody:
      type: object
      required:
        - code
        - message
        - details
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          example: Quote has expired.
        details:
          type: object
          additionalProperties: true
          example: {}
    ErrorCode:
      type: string
      enum:
        - inactive_partner
        - internal_error
        - invalid_api_key
        - provider_unavailable
        - quote_already_used
        - quote_expired
        - quote_not_found
        - rate_limited
        - swap_not_found
        - unsupported_asset
        - unsupported_pair
        - validation_error
  headers:
    RequestId:
      description: >-
        Request ID generated by LightSwap or echoed from the `x-request-id`
        request header.
      schema:
        type: string
        example: req_123
    RetryAfter:
      description: Seconds to wait before retrying a rate-limited request.
      schema:
        type: integer
        example: 30
  responses:
    BadRequest:
      description: The request is invalid.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            validationError:
              value:
                error:
                  code: validation_error
                  message: quoteId is invalid.
                  details: {}
                requestId: req_123
    RateLimited:
      description: The request exceeded the configured API rate limit.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                error:
                  code: rate_limited
                  message: Too many API requests. Please wait a moment and try again.
                  details: {}
                requestId: req_123
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key. Keep this key on your backend.

````