---
updatedAt: 2025-09-23T23:34:31.000Z
agentTools:
  projectIndex: https://docs.creditkey.com/v1.2/llms.txt
---

# /auth/login

Returns an access token for authentication and for subsequent requests. The lifetime of an access token is 2 hours. Once the token has expired, this endpoint can be used to generate a new token.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/auth/login": {
      "post": {
        "operationId": "AppController_merchantLogin",
        "summary": "",
        "description": "Returns an access token for authentication and for subsequent requests. The lifetime of an access token is 2 hours. Once the token has expired, this endpoint can be used to generate a new token.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "description": "Please use your API credentials provided by Credit Key.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientCredentialsDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OauthTokenEntity"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedException"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenException"
                }
              }
            }
          }
        },
        "tags": [
          "Authentication"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "Credit Key API Integration",
    "description": "An interface to interact with Credit Key for applications, orders, accounts, payments etc.",
    "version": "1.0",
    "contact": {}
  },
  "servers": [],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "UnauthorizedException": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "You don't have permission to access this resource"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          },
          "status_code": {
            "type": "number",
            "example": 401
          }
        }
      },
      "ForbiddenException": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "example": "Forbidden resource"
          },
          "error": {
            "type": "string",
            "example": "Forbidden"
          },
          "status_code": {
            "type": "number",
            "example": 403
          }
        }
      },
      "ClientCredentialsDto": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string"
          },
          "client_secret": {
            "type": "string"
          }
        },
        "required": [
          "client_id",
          "client_secret"
        ]
      },
      "OauthTokenEntity": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "example": "73hlbxjkhgjJhje62NDpgtVf50p_sdvoiwhg890h332"
          },
          "token_type": {
            "type": "string",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "number",
            "example": 7200
          },
          "created_at": {
            "type": "number",
            "example": 1674765889
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```