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

# verify



## OpenAPI

````yaml POST /verify
openapi: 3.1.0
info:
  title: Algen API
  description: Some important api listed in there
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://asdo.algen.network
security: []
paths:
  /verify:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                x402Version:
                  $ref: '#/components/schemas/X402Version'
                paymentPayload:
                  $ref: '#/components/schemas/x402PaymentPayload'
                paymentRequirements:
                  $ref: '#/components/schemas/x402PaymentRequirements'
              required:
                - x402Version
                - paymentPayload
                - paymentRequirements
            examples:
              example:
                value:
                  x402Version: 1
                  paymentPayload:
                    x402Version: 1
                    scheme: exact
                    network: mesherX
                    payload:
                      signature: >-
                        0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480
                      authorization:
                        from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                        to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                        value: '1000000000000000000'
                        validAfter: '1716150000'
                        validBefore: '1716150000'
                        nonce: '0x1234567890abcdef1234567890abcdef12345678'
                  paymentRequirements:
                    scheme: exact
                    network: mesherX
                    maxAmountRequired: '1000000'
                    resource: >-
                      [https://api.example.com/premium/resource/123](https://api.example.com/premium/resource/123)
                    description: Premium API access for data analysis
                    mimeType: application/json
                    outputSchema:
                      data: string
                    payTo: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                    maxTimeoutSeconds: 10
                    asset: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                    extra:
                      gasLimit: '1000000'
      responses:
        '200':
          description: Successfully verified payment on the x402 protocol.
          content:
            application/json:
              schema:
                type: object
                properties:
                  isValid:
                    type: boolean
                    description: Indicates whether the payment is valid.
                    example: false
                  invalidReason:
                    $ref: '#/components/schemas/x402VerifyInvalidReason'
                  payer:
                    type: string
                    description: >-
                      The onchain address of the client that is paying for the
                      resource.
                    pattern: >-
                      ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
                    example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                required:
                  - isValid
                  - payer
              examples:
                example:
                  value:
                    isValid: false
                    invalidReason: insufficient_funds
                    payer: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
      servers:
        - url: https://x402.algen.network/facilitator
          description: Verify x402 payment.
components:
  schemas:
    X402Version:
      type: integer
      description: The version of the x402 protocol.
      enum:
        - 1
      example: 1
    x402PaymentPayload:
      type: object
      description: The x402 protocol payment payload attached to X-PAYMENT header.
      properties:
        x402Version:
          $ref: '#/components/schemas/X402Version'
        scheme:
          type: string
          enum:
            - exact
          example: exact
        network:
          type: string
          enum:
            - mesherX
            - mesherX-testnet
          example: mesherX
        payload:
          type: object
          oneOf:
            - $ref: '#/components/schemas/x402ExactEvmPayload'
          example:
            signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480'
            authorization:
              from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
              to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
              value: '1000000000000000000'
              validAfter: '1716150000'
              validBefore: '1716150000'
              nonce: '0x1234567890abcdef1234567890abcdef12345678'
      required:
        - x402Version
        - scheme
        - network
        - payload
      example:
        x402Version: 1
        scheme: exact
        network: mesherX
        payload:
          signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480'
          authorization:
            from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
            to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
            value: '1000000000000000000'
            validAfter: '1716150000'
            validBefore: '1716150000'
            nonce: '0x1234567890abcdef1234567890abcdef12345678'
    x402PaymentRequirements:
      type: object
      description: The payment requirements expected by the resource server.
      properties:
        scheme:
          type: string
          enum:
            - exact
          example: exact
        network:
          type: string
          enum:
            - mesherX
            - mesherX-testnet
          example: mesherX
        maxAmountRequired:
          type: string
          example: '1000000'
        resource:
          $ref: '#/components/schemas/Url'
          example: https://api.example.com/premium/resource/123
        description:
          type: string
          example: Premium API access for data analysis
        mimeType:
          type: string
          example: application/json
        outputSchema:
          type: object
          additionalProperties: true
          example:
            data: string
        payTo:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
        maxTimeoutSeconds:
          type: integer
          example: 10
        asset:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$
          example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
        extra:
          type: object
          additionalProperties: true
          example:
            gasLimit: '1000000'
      required:
        - scheme
        - network
        - maxAmountRequired
        - resource
        - description
        - mimeType
        - payTo
        - asset
        - maxTimeoutSeconds
    x402VerifyInvalidReason:
      type: string
      description: The reason the payment is invalid on the x402 protocol.
      enum:
        - insufficient_funds
        - invalid_scheme
        - invalid_network
        - invalid_x402_version
        - invalid_payment_requirements
        - invalid_payload
        - invalid_exact_evm_payload_authorization_value
        - invalid_exact_evm_payload_authorization_value_too_low
        - invalid_exact_evm_payload_authorization_valid_after
        - invalid_exact_evm_payload_authorization_valid_before
        - invalid_exact_evm_payload_authorization_typed_data_message
        - invalid_exact_evm_payload_authorization_from_address_kyt
        - invalid_exact_evm_payload_authorization_to_address_kyt
        - invalid_exact_evm_payload_signature
        - invalid_exact_evm_payload_signature_address
        - invalid_exact_svm_payload_transaction
        - invalid_exact_svm_payload_transaction_amount_mismatch
        - invalid_exact_svm_payload_transaction_create_ata_instruction
        - >-
          invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee
        - >-
          invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset
        - invalid_exact_svm_payload_transaction_instructions
        - invalid_exact_svm_payload_transaction_instructions_length
        - >-
          invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction
        - >-
          invalid_exact_svm_payload_transaction_instructions_compute_price_instruction
        - >-
          invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high
        - >-
          invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked
        - >-
          invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked
        - invalid_exact_svm_payload_transaction_not_a_transfer_instruction
        - invalid_exact_svm_payload_transaction_cannot_derive_receiver_ata
        - invalid_exact_svm_payload_transaction_receiver_ata_not_found
        - invalid_exact_svm_payload_transaction_sender_ata_not_found
        - invalid_exact_svm_payload_transaction_simulation_failed
        - invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata
        - >-
          invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts
        - invalid_exact_svm_payload_transaction_fee_payer_transferring_funds
      example: insufficient_funds
    x402ExactEvmPayload:
      type: object
      title: x402ExactEvmPayload
      description: >-
        The x402 protocol exact scheme payload for EVM networks. Implemented
        using ERC-3009.
      properties:
        signature:
          type: string
          description: >-
            The EIP-712 hex-encoded signature of the ERC-3009 authorization
            message.
          example: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480'
        authorization:
          type: object
          description: The authorization data for the ERC-3009 message.
          properties:
            from:
              type: string
              pattern: ^0x[0-9a-fA-F]{40}$
              description: 0x-prefixed, checksum EVM address of the sender.
              example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
            to:
              type: string
              pattern: ^0x[0-9a-fA-F]{40}$
              description: 0x-prefixed, checksum EVM address of the recipient.
              example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
            value:
              type: string
              description: Value of the payment in atomic units.
              example: '1000000000000000000'
            validAfter:
              type: string
              description: Unix timestamp after which payment is valid.
              example: '1716150000'
            validBefore:
              type: string
              description: Unix timestamp before which payment is valid.
              example: '1716150000'
            nonce:
              type: string
              description: Hex-encoded nonce of the payment.
              example: '0x1234567890abcdef1234567890abcdef12345678'
          required:
            - from
            - to
            - value
            - validAfter
            - validBefore
            - nonce
          example:
            from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
            to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
            value: '1000000000000000000'
            validAfter: '1716150000'
            validBefore: '1716150000'
            nonce: '0x1234567890abcdef1234567890abcdef12345678'
      required:
        - signature
        - authorization
      example:
        signature: '0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480'
        authorization:
          from: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
          to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
          value: '1000000000000000000'
          validAfter: '1716150000'
          validBefore: '1716150000'
          nonce: '0x1234567890abcdef1234567890abcdef12345678'
    Url:
      type: string
      format: uri
      minLength: 11
      maxLength: 2048
      pattern: ^https://.*$
      description: A valid HTTPS URL.
      example: https://example.com

````