---
agentTools:
  projectIndex: https://ordatic.readme.io/llms.txt
---

# Authentication

This is perhaps the most important endpoint of Ordatic's Public API because, in order to authenticate yourself with other endpoints, a Bearer `token` must be specified in the `headers`. Use this endpoint, with your credentials (`appId` and `appSecret`), to be able to generate the `token`. The returned `token` has a duration of 24 hours.

[block:html]
{
  "html": "<style>\n.simulate-readme-title {\n  color: var(--graphite);\n  font-family: var(--font-family);\n  font-size: 12px;\n  font-weight: var(--font-weight-bold);\n  text-transform: uppercase;\n}\n</style>\n<strong class=\"simulate-readme-title\">App Scope</strong>"
}
[/block]

[block:parameters]
{
  "data": {
    "h-0": "Channel",
    "h-1": "Pos",
    "h-2": "Rider",
    "h-3": "Loyalty",
    "0-0": "✔️",
    "0-1": "✔️",
    "0-2": "✔️",
    "0-3": "✔️"
  },
  "cols": 4,
  "rows": 1
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Public API",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://public-api.qa.ordatic.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://example.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v2/auth": {
      "post": {
        "summary": "Authentication",
        "description": "",
        "operationId": "authentication",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "appId",
                  "appSecret"
                ],
                "properties": {
                  "appId": {
                    "type": "string",
                    "description": "The `appId` is provided directly from the Ordatic's partners team"
                  },
                  "appSecret": {
                    "type": "string",
                    "description": "The `appSecret` is provided directly from the Ordatic's partners team"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImUyYzAwODNkLTg5ZjUtNGRmNi1hOGJlLTJjMzliZDU0ZGM3NSIsImRhdGUiOiIyMDIyLTAzLTI3VDIwOjMwOjEzLjAwOFoiLCJpYXQiOjE2NDg0MTMwMTMsImV4cCI6MTY0ODQ5OTQxM30.NCv1UHEfR8G1qpfZ9MM74yrkIKtm6PPD1Z6pq_Xel2U\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImUyYzAwODNkLTg5ZjUtNGRmNi1hOGJlLTJjMzliZDU0ZGM3NSIsImRhdGUiOiIyMDIyLTAzLTI3VDIwOjMwOjEzLjAwOFoiLCJpYXQiOjE2NDg0MTMwMTMsImV4cCI6MTY0ODQ5OTQxM30.NCv1UHEfR8G1qpfZ9MM74yrkIKtm6PPD1Z6pq_Xel2U"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"status\": 400,\n\t\"body\": {\n    \"error\": true,\n    \"message\": \"A message representing the error\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "body": {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "message": {
                          "type": "string",
                          "example": "A message representing the error"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"status\": 403,\n\t\"body\": {\n    \"error\": true,\n    \"message\": \"A message representing the error\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 403,
                      "default": 0
                    },
                    "body": {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "message": {
                          "type": "string",
                          "example": "A message representing the error"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"status\": 404,\n\t\"body\": {\n    \"error\": true,\n    \"message\": \"A message representing the error\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404,
                      "default": 0
                    },
                    "body": {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        },
                        "message": {
                          "type": "string",
                          "example": "A message representing the error"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": []
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "623c58397d65e5077a346cab:623ddf10241d1207b8904890"
}
```