Skip to main content

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.

The Luhn Validation endpoint checks whether a card number is valid according to the Luhn algorithm — the standard checksum formula used by all major card schemes. Optionally, you can request the card’s metadata in the same call. Endpoint: GET /Tools/luhn

When to Use This

Use Luhn Validation as an early check before submitting a payment. A card number that fails the Luhn check is guaranteed to be invalid — catching it here avoids an unnecessary API call to the PSP, saves processing time, and gives the customer immediate feedback to correct their input. By setting metaData=true, you can combine validation and metadata lookup in a single call — useful when you need both the validity check and card details (e.g., for form validation plus BIN-based routing in one step).

How It Works

Pass the full card number as the number query parameter. Set metaData to true if you also want the card’s BIN metadata in the response.
ParameterTypeRequiredDescription
numberstring (query)YesThe full card number to validate
metaDataboolean (query)NoInclude card metadata in the response (default: false)

Example: Validate Before Payment Submission

Check the card number on your server before sending it to the PSP. If validation fails, return an error to the customer immediately.
async function validateCard(cardNumber, apiKey) {
  const response = await fetch(
    `https://api.orchestrasolutions.com/Tools/luhn?number=${cardNumber}&metaData=true`,
    { headers: { 'X-Api-Key': apiKey } }
  );
  const result = await response.json();

  if (!result.luhnValid) {
    return { valid: false, error: result.error || 'Invalid card number' };
  }

  return {
    valid: true,
    brand: result.iinData?.cardBrand,
    type: result.iinData?.cardType,
    issuerCountry: result.iinData?.countryCode
  };
}

const check = await validateCard('4111111111111111', 'YOUR_API_KEY');
if (!check.valid) {
  console.error(check.error);
} else {
  console.log(`Valid ${check.brand} ${check.type} card from ${check.issuerCountry}`);
}

Metadata Lookup

Already know the card is valid? Look up metadata from just the BIN.

API Reference

Full endpoint specification and response schema