> ## Documentation Index
> Fetch the complete documentation index at: https://docs.closient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify a GS1 key's check digit and identify its prefix

> Check the GS1 mod-10 check digit on any numeric GS1 key (GTIN-8/12/13/14, GLN, SSCC) and — for GTIN-shaped keys — report which GS1 Member Organisation or numbering scheme the prefix belongs to.

`expected_check_digit` is returned even when the supplied digit is wrong, because the useful answer to a failed check is which digit it should have been.

**Keyless** — no API key, no signup. IP-throttled at 300 requests/minute and cached at the edge for 24h, so repeat calls for the same input do not reach origin. Over-rate callers get a `429` with a `Retry-After` header and a `retry_after` field — it never silently degrades or returns a wrong answer under load.



## OpenAPI

````yaml /openapi/openapi-resolver.json get /resolver/api/v1/public/gs1/analyze
openapi: 3.1.0
info:
  title: Resolver API
  version: 1.0.0
  description: >
    GS1 Digital Link resolution with content negotiation and linkset support.


    ## Authentication


    All endpoints require an API key passed via the `X-API-Key` HTTP header,
    unless otherwise noted.


    ```

    X-API-Key: csb_<body>_<checksum>

    ```


    Generate API keys in **Settings > API Keys** in your dashboard, or via the
    Account API.

    Session-based (cookie) authentication is also accepted for browser-based
    access.


    ## Rate Limits


    | Tier        | Requests / minute | Requests / day |

    |-------------|-------------------|----------------|

    | Default     | 300               | 10,000         |

    | Custom      | Contact us        | Contact us     |


    Rate-limit headers are included on every response so callers can
    self-throttle without

    hitting our 429s ("informed governor"):


    - `RateLimit-Policy` — every active window, e.g. `300;w=60, 10000;w=86400`

    - `RateLimit-Limit` — quota for the **most-restrictive** currently-active
    window

    - `RateLimit-Remaining` — requests left in that window

    - `RateLimit-Reset` — seconds until that window resets (relative; clock-skew
    safe)


    Legacy `X-RateLimit-*` aliases are also emitted for back-compat.
    `X-RateLimit-Reset`

    keeps the absolute Unix-timestamp shape to avoid breaking existing
    consumers.


    When rate-limited, you receive `429 Too Many Requests` with a
    `retry_after_seconds` field

    in the error envelope and a `Retry-After` header.


    ## Pagination


    List endpoints return paginated results in this envelope:


    ```json

    {
      "data": [...],
      "pagination": {
        "page": 1,
        "page_size": 25,
        "total_count": 342,
        "total_pages": 14,
        "has_next": true,
        "has_previous": false
      }
    }

    ```


    Use `?page=2&page_size=50` query parameters. Maximum page size is 100.


    ## Error Responses


    All errors conform to [RFC 9457 Problem
    Details](https://www.rfc-editor.org/rfc/rfc9457)

    with `Content-Type: application/problem+json`:


    ```json

    {
      "type": "https://closient.com/docs/errors/not_found",
      "title": "Not Found",
      "status": 404,
      "detail": "The requested resource was not found.",
      "error_code": "not_found",
      "retryable": false,
      "timestamp": "2026-03-31T12:00:00+00:00"
    }

    ```


    Common error codes: `unauthorized` (401), `forbidden` (403), `not_found`
    (404),

    `validation_error` (422), `rate_limited` (429), `internal_error` (500).
  termsOfService: https://www.closient.com/terms/
servers:
  - url: https://www.closient.com
security: []
tags:
  - name: Resolver
    description: GS1 Digital Link resolution with content negotiation and linkset support.
  - name: Custom URLs
    description: >-
      Reusable custom-URL catalog (C-3339) — create, list, edit, and delete the
      custom redirect destinations that resolution rules point at.
  - name: Verification
    description: >-
      Serial verification (`gs1:verificationService`) — tiered, rate-limited
      responses for serialized GTIN scans. Experimental v1; see the
      verification-service guide.
  - name: GS1 Primitives (Public)
    description: >-
      Keyless GS1 Digital Link primitives (C-4295) — parse, validate, build,
      decompress, and check-digit analysis. **No API key, no signup.** Pure
      functions over strings: no database, no network, no catalog data.
      IP-throttled and edge-cached so repeat calls cost nothing. This is the
      reference implementation the resolver itself runs on.
  - name: Resolver Custom Hostnames
    description: >-
      BYO domain (C-4058) — register a customer-owned hostname, publish the
      CNAME records, verify ownership, and serve an org's Digital Link QRs from
      its own DNS.
externalDocs:
  description: Closient Documentation
  url: https://docs.closient.com
paths:
  /resolver/api/v1/public/gs1/analyze:
    get:
      tags:
        - GS1 Primitives (Public)
      summary: Verify a GS1 key's check digit and identify its prefix
      description: >-
        Check the GS1 mod-10 check digit on any numeric GS1 key
        (GTIN-8/12/13/14, GLN, SSCC) and — for GTIN-shaped keys — report which
        GS1 Member Organisation or numbering scheme the prefix belongs to.


        `expected_check_digit` is returned even when the supplied digit is
        wrong, because the useful answer to a failed check is which digit it
        should have been.


        **Keyless** — no API key, no signup. IP-throttled at 300 requests/minute
        and cached at the edge for 24h, so repeat calls for the same input do
        not reach origin. Over-rate callers get a `429` with a `Retry-After`
        header and a `retry_after` field — it never silently degrades or returns
        a wrong answer under load.
      operationId: apps_resolver_api_public_gs1_analyze_gs1_key_public
      parameters:
        - in: query
          name: key
          schema:
            description: >-
              The GS1 key to analyse, e.g. `09506000164908`. Hyphens and spaces
              are ignored.
            maxLength: 64
            minLength: 1
            title: Key
            type: string
          required: true
          description: >-
            The GS1 key to analyse, e.g. `09506000164908`. Hyphens and spaces
            are ignored.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GS1KeyAnalysisOut'
components:
  schemas:
    GS1KeyAnalysisOut:
      description: Check-digit and issuing-organisation analysis of a numeric GS1 key.
      examples:
        - check_digit: '8'
          expected_check_digit: '8'
          gs1_prefix: '950'
          is_gtin_length: true
          is_valid: true
          issuing_organization: GS1 Global Office
          length: 14
          normalized: '09506000164908'
          value: '09506000164908'
      properties:
        value:
          description: The input, echoed back unchanged.
          title: Value
          type: string
        is_valid:
          description: True when the key's trailing GS1 mod-10 check digit is correct.
          title: Is Valid
          type: boolean
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: Why the key is invalid, or `null` when it checks out.
          title: Error
        normalized:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            GTIN-length keys zero-padded to GTIN-14; other keys stripped of
            separators. `null` when the key could not be read.
          title: Normalized
        check_digit:
          anyOf:
            - type: string
            - type: 'null'
          description: The trailing digit supplied by the caller.
          examples:
            - '8'
          title: Check Digit
        expected_check_digit:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The digit the GS1 mod-10 algorithm requires. Populated even when it
            disagrees with `check_digit`.
          title: Expected Check Digit
        length:
          description: Digit count after stripping hyphens and spaces.
          examples:
            - 14
          minimum: 0
          title: Length
          type: integer
        is_gtin_length:
          description: Whether the length is one of the GTIN-8/12/13/14 lengths.
          title: Is Gtin Length
          type: boolean
        gs1_prefix:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The three-digit GS1 prefix (digits 2-4 of the GTIN-14). `null` for
            non-GTIN-length keys.
          title: Gs1 Prefix
        issuing_organization:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Which GS1 Member Organisation or scheme that prefix belongs to.
            `null` when unassigned or not GTIN-shaped.
          title: Issuing Organization
      required:
        - value
        - is_valid
        - length
        - is_gtin_length
      title: GS1KeyAnalysisOut
      type: object

````