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

# Generate Auth Token

> Generate redirect url to login user directly



## OpenAPI

````yaml POST /marketplace/user/auth
openapi: 3.0.1
info:
  title: Marketplace API
  description: API specification for user authentication and transaction management
  version: 1.0.0
servers:
  - url: https://api.sandbox.external.bnznow.com
    description: Sandbox server for marketplace APIs
  - url: https://api.external.bnznow.com
    description: Production server for marketplace APIs
security: []
paths:
  /marketplace/user/auth:
    post:
      description: Generates a redirect URL for seamless user authentication
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
          description: API key for authentication
        - name: x-body-signature
          in: header
          required: true
          schema:
            type: string
          description: Signature of the request body signed with API secret (private key)
      requestBody:
        description: User authentication details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRequest'
        required: true
      responses:
        '200':
          description: Authentication redirect URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AuthRequest:
      required:
        - unique_id
        - govt_id
        - user_type
        - email
      type: object
      properties:
        unique_id:
          type: string
          description: >-
            Unique identifier for the user in your system (user_id, company_id,
            etc)
        email:
          type: string
          description: Email address of the user
        govt_id:
          type: string
          description: Government ID (Aadhar, CIN)
        name:
          type: string
          description: User's full name
        user_type:
          type: string
          enum:
            - company
            - individual
          description: Type of user
    AuthResponse:
      type: object
      properties:
        redirect_url:
          type: string
          description: URL to redirect the user for authentication
        registered_id:
          type: string
          description: Registered ID of the user on BNZ Green
        expires_in:
          type: integer
          description: Time in seconds until the redirect URL expires
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````