# Check Digit API
> Add and verify check digits with the standard algorithms — Luhn (mod 10), Verhoeff, Damm and ISO 7064 mod 97-10 — on any number. The generate endpoint returns the check digit(s) and the complete number; the validate endpoint tells you whether a number's check digit is correct. Luhn is the familiar mod-10 scheme behind credit cards, IMEI and many ID numbers; Verhoeff and Damm are single-digit schemes that also catch all adjacent-transposition errors; mod 97-10 produces two check digits and is the scheme used by IBAN. Perfect for generating and validating reference, account, membership and order numbers, and for data-entry integrity. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. Distinct from credit-card and barcode validators, which apply a fixed algorithm to one specific number format.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/checkdigit-api/..."
```

## Pricing
- **Free** (Free) — 995 calls/Mo, 2 req/s
- **Starter** ($0/Mo) — 8,350 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 134,500 calls/Mo, 20 req/s
- **Mega** ($58/Mo) — 710,000 calls/Mo, 50 req/s

## Endpoints

### Check Digit

#### `GET /v1/generate` — Generate a check digit

**Parameters:**
- `number` (query, required, string) — Base number (no check digit) Example: `7992739871`
- `algorithm` (query, optional, string) — luhn|verhoeff|damm|mod97 (default luhn) Example: `luhn`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/checkdigit-api/v1/generate?number=7992739871&algorithm=luhn"
```

**Response:**
```json
{
    "data": {
        "number": "7992739871",
        "algorithm": "luhn",
        "check_digit": "3",
        "full_number": "79927398713"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:43.096Z",
        "request_id": "3725976f-8725-493f-97d0-5d71a385516e"
    },
    "status": "ok",
    "message": "Generate a check digit",
    "success": true
}
```

#### `GET /v1/validate` — Validate a check digit

**Parameters:**
- `number` (query, required, string) — Number including its check digit Example: `79927398713`
- `algorithm` (query, optional, string) — luhn|verhoeff|damm|mod97 (default luhn) Example: `luhn`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/checkdigit-api/v1/validate?number=79927398713&algorithm=luhn"
```

**Response:**
```json
{
    "data": {
        "valid": true,
        "number": "79927398713",
        "algorithm": "luhn"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:43.204Z",
        "request_id": "daf4c7ef-e71b-45d3-bc8e-c4f74b84f64d"
    },
    "status": "ok",
    "message": "Validate a check digit",
    "success": true
}
```

### Reference

#### `GET /v1/algorithms` — Supported algorithms

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/checkdigit-api/v1/algorithms"
```

**Response:**
```json
{
    "data": {
        "algorithms": [
            {
                "name": "luhn",
                "description": "Mod 10 — credit cards, IMEI, many ID numbers.",
                "check_length": 1
            },
            {
                "name": "verhoeff",
                "description": "Catches all single-digit and most transposition errors.",
                "check_length": 1
            },
            {
                "name": "damm",
                "description": "Single-digit, detects all single and adjacent transposition errors.",
                "check_length": 1
            },
            {
                "name": "mod97",
                "description": "ISO 7064 mod 97-10 — two check digits, as used by IBAN.",
                "check_length": 2
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:43.298Z",
        "request_id": "fae0e1cf-e045-451c-bc4d-0f3bcbf98b6f"
    },
    "status": "ok",
    "message": "Supported algorithms",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/checkdigit-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "Check Digit API",
        "notes": "Luhn, Verhoeff and Damm produce one check digit; mod 97-10 produces two. Spaces and hyphens in the input are ignored. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/generate",
                "params": {
                    "number": "the base number (required)",
                    "algorithm": "luhn|verhoeff|damm|mod97 (default luhn)"
                },
                "returns": "the check digit(s) and the full number"
            },
            {
                "path": "/v1/validate",
                "params": {
                    "number": "the number including its check digit (required)",
                    "algorithm": "default luhn"
                },
                "returns": "whether the check digit is correct"
            },
            {
                "path": "/v1/algorithms",
                "params": [],
                "returns": "the supported algorithms"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Generate and validate check digits with the standard algorithms — Luhn (mod 10), Verhoeff, Damm and ISO 7064 mod 97-10 — on any number. Use it to add or verify a check digit on IDs, references, account and membership numbers. Pure local, no key."
    },
    "meta": {
        "timestam
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/checkdigit-api
OpenAPI spec: https://www.oanor.com/api/checkdigit-api/openapi.json
