{"uid":"cap_K6i_69kynDhtdBhdFfSMz","slug":"luhn-algorithm-validator-checkdigit-openverbs-com-a1296cb5","name":"Luhn Algorithm Validator (checkdigit.openverbs.com)","description":"Validate a number by the Luhn (mod-10) algorithm — the scheme behind credit/debit card numbers and many IDs. Spaces and hyphens are ignored. A mismatched check digit is a successful { valid: false }.","url":"https://checkdigit.openverbs.com/v1/luhn","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["number"],"properties":{"number":{"type":"string","maxLength":64,"minLength":1,"description":"Digit string (spaces/hyphens allowed), 2-34 digits."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SDE8OxvBWklHDBCh5uC8L","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates any digit string against the Luhn (mod-10) checksum algorithm, returning whether the number has a valid check digit.","exampleAgentPrompt":"Can you check whether this card number passes the Luhn algorithm: 4532 0151 1283 0366?","exampleUseCases":[{"title":"Pre-payment card number sanity check","prompt":"Before I charge the customer, can you run a Luhn check on their card number 4111-1111-1111-1111 to make sure it's structurally valid?"},{"title":"User input validation in checkout flow","prompt":"A user just typed in 378282246310005 as their card number — can you verify it passes the Luhn mod-10 check so we know it's not a typo?"},{"title":"Bulk fraud filter on suspicious numbers","prompt":"I have a number that looks like it might be fake: 1234567890123456 — can you run the Luhn algorithm on it and tell me if the check digit is valid?"}],"resultDescription":"Returns a JSON object with a `valid` boolean indicating whether the input digit string passes the Luhn (mod-10) checksum. Spaces and hyphens in the input are ignored. A number with an incorrect check digit returns `{ valid: false }` as a successful (non-error) response.","failureModes":["Input string shorter than 2 digits or longer than 34 digits after stripping spaces/hyphens returns a validation error","Non-digit characters other than spaces and hyphens cause a rejection","Empty string input returns an error","Network timeout or payment failure (x402) may prevent the call from completing"],"whenToPreferThis":"Choose this endpoint when you need to validate any arbitrary digit string against the Luhn algorithm — for example, generic card numbers, loyalty IDs, or other Luhn-encoded identifiers not covered by the more specific siblings (IMEI, ABA routing, GTIN, ISBN). If you specifically need to validate an IMEI, ABA routing number, GTIN barcode, or ISBN, prefer the dedicated sibling endpoints which apply the appropriate format-specific rules on top of Luhn.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:40:01.608Z","isFirstParty":false}