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

# Luhn Algorithm Validation

> This method allows you to provide the card number and validate it against the Luhn algorithm. In addition, you can choose to receive the card's metadata in the response.



## OpenAPI

````yaml get /Tools/luhn
openapi: 3.0.4
info:
  title: Orchestra API
  description: Code Version 1.0.11.6
  version: Prod
servers:
  - url: https://api.orchestrasolutions.com
security: []
tags:
  - name: AP2
    description: Test AP2 controller
  - name: EWalletOperations
    description: Card operations controller
  - name: MockCredentialProvider
    description: |-
      Mock Credential Provider controller implementing JSON-RPC 2.0 protocol
      Used for testing AP2 checkout flows
  - name: PaymentGatewayAccounts
    description: Payment Gateway Accounts
  - name: PaymentGateway
    description: Universal Payment Gateway
  - name: StringTokens
    description: Token management
  - name: Tools
    description: >-
      Card tools for BIN/IIN lookup, brand identification, Luhn validation, and
      card risk assessment
  - name: Utils
    description: Utils
paths:
  /Tools/luhn:
    get:
      tags:
        - Tools
      summary: Luhn Algorithm Validation
      description: >-
        This method allows you to provide the card number and validate it
        against the Luhn algorithm. In addition, you can choose to receive the
        card's metadata in the response.
      operationId: CardLuhnValidate
      parameters:
        - name: number
          in: query
          description: The full card number to be validated
          required: true
          schema:
            type: string
        - name: metaData
          in: query
          description: >-
            An optional indicator to specify whether the card metadata should be
            included in the response
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PayTools_Api.Models.LuhnCheckResultsWithIinData
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/PayTools_Shared.Models.ValidationErrorMessage
        '401':
          description: Not authenticated
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PayTools_Api.Models.LuhnCheckResultsWithIinData:
      type: object
      properties:
        luhnValid:
          type: boolean
          description: Indicates whether the card number passed the Luhn algorithm check
        error:
          type: string
          description: Error description if validation failed
          nullable: true
        iinData:
          $ref: '#/components/schemas/PayTools_Api.Models.IinData'
      additionalProperties: false
      description: Luhn Check Results with optional IIN metadata
    PayTools_Shared.Models.ValidationErrorMessage:
      type: object
      properties:
        fieldName:
          type: string
          description: Field name the error(s) are referring to
          nullable: true
        errors:
          type: array
          items:
            type: string
          description: List of errors
          nullable: true
      additionalProperties: false
      description: Model for display validation error messages
    PayTools_Api.Models.IinData:
      type: object
      properties:
        bin:
          type: string
          description: >-
            The longest match of the first 6 to 11 digits of the card number
            that we were able to match
        cardBrand:
          type: string
          description: The card brand (AMERICAN EXPRESS, VISA, MASTERCARD, JCB etc)
        cardType:
          type: string
          description: The type of card (DEBIT, CREDIT, DEBIT OR CREDIT, CHARGE CARD)
        category:
          type: string
          description: >-
            The category of the card (CLASSIC, BUSINESS, STANDARD, PERSONAL,
            etc)
        issuingOrganization:
          type: string
          description: The name of the entity (usually bank) that issued the card
        countryCode:
          type: string
          description: The 2 letter country code (ISO 3166-2) where the card was issued
        brandLogoUrl:
          type: string
          description: The URL to the brand logo image
      additionalProperties: false
      description: IIN / BIN metadata for a card
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Please enter ApiKey into field
      name: X-Api-Key
      in: header

````