---
title: Validate Payment Card API
slug: validate-card-number
url: https://apyhub.com/creightonnick0/service/validate-card-number
provider: nick creighton
categories: [Data Validation, Finance, "Security & Privacy"]
tags: [card-validation, luhn-check, payment-cards, network-detection, masking]
auth: api_key
---

# Validate Payment Card API

Validate card numbers with Luhn and length checks, identify the network, and return masked or formatted values for safe handling.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `` | What it does Validates a card number using the Luhn algorithm, detects the card network, and return… | 10 |

## About

## What it does
Card Number Validator checks whether a payment card number is structurally valid, identifies the card network, and returns a masked representation for safer handling.

Send a `card_number` in the request body. The value can include spaces or dashes; those are ignored during validation. The response includes `valid`, `luhn_valid`, and `length_valid` so you can see whether the number passes the checksum and length checks. You also get `network`, `iin`, `length`, `last4`, `formatted`, and `masked` when they can be derived, plus an optional `note` for additional context.

Use Card Number Validator when you need to clean up user-entered payment data before storing it, flag obvious typos in checkout forms, or label card numbers by network in admin and support workflows. The masked and last-four outputs are useful when you want to display or log card details without exposing the full number.

This service is for validation and normalization only. It does not perform authorization, issuer lookup, or account verification.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/creightonnick0/service/validate-card-number
