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

# Merchant Password Login

> Merchant Password login

## Endpoint Overview

**POST** `https://api.unibee.dev/merchant/auth/sso/login`

Merchant Password login

***

## Authorization

All UniBee Merchant API requests require authentication via API key.

| Header          | Required | Description                           |
| --------------- | -------- | ------------------------------------- |
| `Authorization` | Yes      | Bearer `<your_api_key>`               |
| `Content-Type`  | Yes      | `application/json` (for request body) |

***

## Parameters

Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.

### Request body

| Name         | Type   | Required | Description                       |
| ------------ | ------ | -------- | --------------------------------- |
| `email`      | string | Yes      | The merchant member email address |
| `password`   | string | Yes      | The merchant member password      |
| `provider`   | string | No       | Connect to OAuth provider         |
| `providerId` | string | No       | Connect to OAuth ProviderId       |
| `totpCode`   | string | No       | The totp code                     |

***

## Request examples

### cURL

```bash theme={null}
curl -X POST "https://api.unibee.dev/merchant/auth/sso/login" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "user@example.com",
  "password": "",
  "provider": "id_example",
  "providerId": "id_example",
  "totpCode": ""
}'
```

### Sandbox

```bash theme={null}
curl -X POST "https://api-sandbox.unibee.top/merchant/auth/sso/login" \
  -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "user@example.com",
  "password": "",
  "provider": "id_example",
  "providerId": "id_example",
  "totpCode": ""
}'
```

***

## Response

Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success.

| Field                 | Type    | Description                  |
| --------------------- | ------- | ---------------------------- |
| `code`                | integer | Response code. `0` = success |
| `data`                | object  | Response payload             |
| `data.merchantMember` | object  |                              |
| `data.token`          | string  | Access token of admin portal |
| `message`             | string  | Human-readable message       |
| `requestId`           | string  | Request ID for support       |

***

## Error handling

| HTTP status | Meaning                                                                   |
| ----------- | ------------------------------------------------------------------------- |
| 400         | Bad request — invalid or missing parameters. Check `message` in the body. |
| 401         | Unauthorized — missing or invalid API key.                                |
| 404         | Not found — invalid path or resource.                                     |
| 500         | Server error — retry with backoff.                                        |

When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support.


## OpenAPI

````yaml post /merchant/auth/sso/login
openapi: 3.0.0
info:
  description: UniBee Api Server
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  title: OpenAPI UniBee
  version: daily,buildtime:202603161017
servers:
  - url: https://api.unibee.dev
  - url: https://api-sandbox.unibee.top
security:
  - Authorization: []
paths:
  /merchant/auth/sso/login:
    post:
      tags:
        - Member Authentication
      summary: Merchant Password Login
      description: Merchant Password login
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/unibee.api.merchant.auth.LoginReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  code:
                    format: int
                    properties: {}
                    type: integer
                  data:
                    properties:
                      merchantMember:
                        $ref: >-
                          #/components/schemas/unibee.api.bean.detail.MerchantMemberDetail
                      token:
                        description: Access token of admin portal
                        format: string
                        properties: {}
                        type: string
                    type: object
                  merchantId:
                    format: int64
                    properties: {}
                    type: integer
                  message:
                    format: string
                    properties: {}
                    type: string
                  redirect:
                    format: string
                    properties: {}
                    type: string
                  requestId:
                    format: string
                    properties: {}
                    type: string
                type: object
          description: ''
components:
  schemas:
    unibee.api.merchant.auth.LoginReq:
      description: Merchant Password login
      properties:
        email:
          description: The merchant member email address
          format: string
          properties: {}
          type: string
        password:
          description: The merchant member password
          format: string
          properties: {}
          type: string
        provider:
          description: Connect to OAuth provider
          format: string
          properties: {}
          type: string
        providerId:
          description: Connect to OAuth ProviderId
          format: string
          properties: {}
          type: string
        totpCode:
          description: The totp code
          format: string
          properties: {}
          type: string
      required:
        - email
        - password
      type: object
    unibee.api.bean.detail.MerchantMemberDetail:
      properties:
        MemberGroupPermission:
          additionalProperties:
            $ref: '#/components/schemas/unibee.api.bean.MerchantRolePermission'
          description: The member group permission map'
          format: map[string]*bean.MerchantRolePermission
          properties: {}
          type: object
        MemberRoles:
          description: The member role list'
          format: '[]*bean.MerchantRole'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MerchantRole'
          properties: {}
          type: array
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currentDeviceIdentity:
          description: The Current DeviceIdentity'
          format: string
          properties: {}
          type: string
        deviceList:
          description: The devices list'
          format: '[]*bean.MerchantMemberDevice'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MerchantMemberDevice'
          properties: {}
          type: array
        email:
          description: email
          format: string
          properties: {}
          type: string
        firstName:
          description: first name
          format: string
          properties: {}
          type: string
        id:
          description: userId
          format: int64
          properties: {}
          type: integer
        isBlankPasswd:
          description: is blank password
          format: bool
          properties: {}
          type: boolean
        isOwner:
          description: Check Member is Owner
          format: bool
          properties: {}
          type: boolean
        lastName:
          description: last name
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        mobile:
          description: mobile
          format: string
          properties: {}
          type: string
        oauthAccounts:
          description: List of connected OAuth accounts
          format: '[]*bean.Oauth'
          items:
            $ref: '#/components/schemas/unibee.api.bean.Oauth'
          properties: {}
          type: array
        status:
          description: 0-Active, 2-Suspend
          format: int
          properties: {}
          type: integer
        totpType:
          description: >-
            0-Inactive, 1-General, Google Authenticator | 2-Microsoft
            Authenticator | 3-Authy | 4-1Password | 5-LastPass | 6-FreeOTP |
            7-Other TOTP
          format: int
          properties: {}
          type: integer
      type: object
    unibee.api.bean.MerchantRolePermission:
      properties:
        group:
          description: Group
          format: string
          properties: {}
          type: string
        permissions:
          description: Permissions
          format: '[]string'
          items:
            format: string
            properties: {}
            type: string
          properties: {}
          type: array
      type: object
    unibee.api.bean.MerchantRole:
      properties:
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        id:
          description: id
          format: int64
          properties: {}
          type: integer
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        permissions:
          description: permissions
          format: '[]*bean.MerchantRolePermission'
          items:
            $ref: '#/components/schemas/unibee.api.bean.MerchantRolePermission'
          properties: {}
          type: array
        role:
          description: role
          format: string
          properties: {}
          type: string
      type: object
    unibee.api.bean.MerchantMemberDevice:
      properties:
        currentDevice:
          description: Is CurrentDevice
          format: bool
          properties: {}
          type: boolean
        identity:
          description: Identity
          format: string
          properties: {}
          type: string
        ipAddress:
          description: IP Address
          format: string
          properties: {}
          type: string
        lastActiveTime:
          description: Last Active Time
          format: int64
          properties: {}
          type: integer
        lastLoginTime:
          description: Last Login Time
          format: int64
          properties: {}
          type: integer
        lastTotpVerificationTime:
          description: Last Totp Verification Time
          format: int64
          properties: {}
          type: integer
        name:
          description: Name
          format: string
          properties: {}
          type: string
        status:
          description: true-Active, false-Offline
          format: bool
          properties: {}
          type: boolean
      type: object
    unibee.api.bean.Oauth:
      properties:
        email:
          format: string
          properties: {}
          type: string
        emailVerified:
          format: bool
          properties: {}
          type: boolean
        image:
          format: string
          properties: {}
          type: string
        name:
          format: string
          properties: {}
          type: string
        provider:
          format: string
          properties: {}
          type: string
        providerId:
          format: string
          properties: {}
          type: string
      type: object
  securitySchemes:
    Authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````