{"uid":"cap_GDPlnqkNUoGqBK1abUbJ2","slug":"payment-card-structural-validation-luhn-brand-bin-5d475874","name":"Payment Card Structural Validation (Luhn + Brand + BIN)","description":"Validate a credit card or payment card number and detect its brand. Checks the Luhn checksum and identifies Visa, Mastercard, Amex, Discover, Diners or JCB, returning the BIN and last four digits. Structural card number validation for checkout forms and fraud pre-checks (does not verify the card exists or has funds).","url":"https://api.aventtech.com/validate/card?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["number"],"properties":{"number":{"type":"string","description":"Card number, spaces/dashes allowed"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"bin":"424242","brand":"visa","last4":"4242","valid":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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":{"p10Cents":"1.0000","medianCents":"1.0000","p90Cents":"1.0000","minCents":"1.0000","maxCents":"1.0000","p95Cents":"1.0000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9u0B5N5qBAKoW2I8KN_5m","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a payment card number's structure via Luhn checksum, detects card brand (Visa/Mastercard/Amex/Discover/Diners/JCB), and extracts BIN and last4 digits — without verifying the card actually exists.","exampleAgentPrompt":"Can you check if the card number 4532 0151 1283 0366 is structurally valid — run the Luhn check, tell me what brand it is (Visa, Mastercard, Amex, etc.), and give me the BIN and last 4 digits?","exampleUseCases":[{"title":"Catch card typos before checkout","prompt":"Before I submit this payment, can you run a quick structural check on card number 5425 2334 3010 9903 — does it pass the Luhn algorithm, what network is it on, and what are the BIN and last 4 digits? I just want to make sure the customer didn't mistype it."},{"title":"Identify card brand from number","prompt":"I have a card number — 3714 496353 98431 — and I need to know what brand it is (Visa, Amex, Mastercard, etc.) and whether the number itself is structurally valid. Can you check that for me without actually charging anything?"},{"title":"Pre-screen card inputs for fraud","prompt":"As part of our fraud triage flow, can you validate the structure of card number 6011 1111 1111 1117 — confirm it passes the Luhn check, tell me the card network, and pull out the BIN and last 4 digits so I can log them for review?"}],"resultDescription":"Returns whether the card number passes the Luhn checksum, the detected card brand (Visa/Mastercard/Amex/Discover/Diners/JCB), the BIN (first 6 digits), and the last 4 digits of the card number. Does not confirm card existence or available balance.","failureModes":["Missing 'number' query parameter returns a 400 bad request","Non-numeric or too-short input may fail Luhn and return invalid with no brand detected","Unrecognized card prefixes return no brand but still report Luhn result","Network timeout or service unavailability returns 5xx","Card number with invalid length for its detected brand may return structurally invalid"],"whenToPreferThis":"Use this endpoint when you need a fast, cheap, stateless structural check of a card number before a payment attempt — catching typos, invalid Luhn checksums, and identifying card brand without making a live authorization. Ideal for form validation, pre-screening card inputs, or fraud triage pipelines where you want zero side effects.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T18:40:01.911Z","isFirstParty":false,"canonicalSlug":"payment-card-structural-validation-luhn-brand-bin-5d475874"}