---
agentTools:
  projectIndex: https://staging-fyn-gateway.readme.io/llms.txt
---

# Fyn-Gateway Authentication

To access the APIs, client need to authenicate to Fynamics GSP. In order to authenticate, use the Client Id and Client Secret which were generated previously.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "E-Invoice API",
    "description": "Fyn-Gateway APIs allows developers to quickly review and integrate them to their development, thereby reducing Deployment time. The documentation is realtime and up-to-date with the option to test the APIs through the UI itself.<br><br>Get started and try them out yourself!<br><br>NIC Einvoice Developer Portal: <a href=\"https://einv-apisandbox.nic.in\" target=\"_blank\">https://einv-apisandbox.nic.in</a>",
    "version": "3.0.3"
  },
  "servers": [
    {
      "url": "https://staging.fynamics.co.in/api",
      "description": "Sandbox server"
    }
  ],
  "paths": {
    "/authenticate": {
      "post": {
        "tags": [
          "Fyn-Gateway Authentication API"
        ],
        "summary": "Fyn-Gateway Authentication",
        "description": "To access the APIs, client need to authenicate to Fynamics GSP. In order to authenticate, use the Client Id and Client Secret which were generated previously.",
        "parameters": [
          {
            "in": "header",
            "name": "clientId",
            "description": "Client ID generated by Fyn Gateway",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "clientSecret",
            "description": "Client Secret generated by Fyn Gateway",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Response Payload",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Fyn-Gateway-Authentication-Response-Success"
                    },
                    {
                      "$ref": "#/components/schemas/Fyn-Gateway-Authentication-Response-Error"
                    }
                  ]
                },
                "examples": {
                  "success": {
                    "summary": "Success response",
                    "value": {
                      "status": 1,
                      "data": {
                        "accessToken": "sdfsdfsdfsdfsdfsdfgsd",
                        "expiresIn": 86400
                      }
                    }
                  },
                  "error": {
                    "summary": "Error response",
                    "value": {
                      "status": 0,
                      "errorMessage": "Client Key is invalid"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fyn-Gateway-Authentication-Response-Success": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "enum": [
              1,
              0
            ],
            "description": "Status of the request(1-Success and 0- Error)"
          },
          "data": {
            "type": "object",
            "description": "If Status is 1",
            "properties": {
              "accessToken": {
                "example": 112010000002315,
                "description": "Access Token"
              },
              "expiresIn": {
                "example": 86400,
                "description": "Access token expiry (in seconds)"
              }
            }
          }
        }
      },
      "Fyn-Gateway-Authentication-Response-Error": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "enum": [
              1,
              0
            ],
            "example": 0,
            "description": "Status of the request(1-Success and 0- Error)"
          },
          "errorMessage": {
            "type": "string",
            "example": "Client Key is invalid",
            "description": "Error Message"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 99,
      "1": 181,
      "2": 102,
      "3": 210,
      "4": 116,
      "5": 61,
      "6": 66,
      "7": 0,
      "8": 156,
      "9": 31,
      "10": 199,
      "11": 146
    }
  }
}
```