{
  "openapi": "3.0.2",
  "info": {
    "title": "GTIN® EAN UPC Checksum Validator",
    "version": "1.0.0",
    "description": "Validate or calculate check digits for GTIN-8, GTIN-12/UPC-A, GTIN-13/EAN-13 and GTIN-14. Send up to 100 items in one request. This API checks number structure only. It does not query GS1 or confirm assignment, ownership, product identity or authenticity.\n\nThis is a best-effort service with no SLA. Requests pass through RapidAPI and may appear in RapidAPI traffic logs, including request and response content. The Worker processes requests in memory and does not independently persist them. Do not submit credentials, secrets, or confidential or non-public personal data as item values.\n\nGTIN® is a registered trademark of GS1 AISBL. This independent API is not affiliated with, sponsored by, certified by or endorsed by GS1 AISBL or any GS1 Member Organisation. Method: https://www.gs1.org/services/how-calculate-check-digit-manually\n\nAccess: subscribe through RapidAPI, then send both x-rapidapi-key and x-rapidapi-host. Never publish a consumer key."
  },
  "paths": {
    "/gtin/validate": {
      "post": {
        "operationId": "validateGtins",
        "summary": "Validate or calculate GTIN check digits",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "oneOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "object",
                          "required": [
                            "value"
                          ],
                          "properties": {
                            "value": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "mode": {
                              "type": "string",
                              "enum": [
                                "validate",
                                "calculate"
                              ],
                              "default": "validate"
                            },
                            "format": {
                              "type": "string",
                              "enum": [
                                "GTIN-8",
                                "GTIN-12",
                                "GTIN-13",
                                "GTIN-14"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "items": [
                  "6291041500213",
                  {
                    "value": "6291 0415-0021",
                    "mode": "calculate",
                    "format": "GTIN-13"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-item checksum results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results",
                    "meta"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Meta": {
        "type": "object",
        "required": [
          "bestEffort",
          "sla"
        ],
        "properties": {
          "bestEffort": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "sla": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Rejected request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      },
      "RapidApiRejected": {
        "description": "RapidAPI rejected missing or invalid consumer authentication headers.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "RapidApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-rapidapi-key",
        "description": "RapidAPI consumer key. Subscribe to this API on RapidAPI before calling it."
      }
    },
    "parameters": {
      "RapidApiHost": {
        "name": "x-rapidapi-host",
        "in": "header",
        "required": true,
        "description": "RapidAPI gateway host for this API.",
        "schema": {
          "type": "string",
          "enum": [
            "gtin-ean-upc-validator.p.rapidapi.com"
          ],
          "default": "gtin-ean-upc-validator.p.rapidapi.com"
        },
        "example": "gtin-ean-upc-validator.p.rapidapi.com"
      }
    }
  },
  "servers": [
    {
      "url": "https://gtin-ean-upc-validator.p.rapidapi.com",
      "description": "RapidAPI gateway"
    }
  ],
  "security": [
    {
      "RapidApiKey": []
    }
  ]
}
