Google Authentication

Sign in and sign up using Google OAuth

POST
/auth/signin-with-google
Sign In with Google
Authenticate an existing user with their Google account

Request Body

Request
{
  "googleId": "115921613887065575046"
}

Response

Response (200 OK)
{
  "data": {
    "user": {
      "id": "c7ddc0c2-248b-462d-a0c3-d723621b2c75",
      "email": "user@example.com",
      "fullName": "John Doe",
      "role": "Buyer"
    },
    "token": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "expiresIn": 5184000
    }
  },
  "message": "Successfully signed in with Google",
  "success": true
}
POST
/auth/signup-with-google
Sign Up with Google
Create a new user account using Google OAuth

Request Body

Request
{
  "username": "johndoe",
  "email": "john.doe@gmail.com",
  "googleId": "115921613887065575046"
}

Response

Response (200 OK)
{
  "data": {
    "user": {
      "id": "c7ddc0c2-248b-462d-a0c3-d723621b2c75",
      "referenceId": "ByF-USR-57988B",
      "email": "john.doe@gmail.com",
      "role": "Buyer",
      "accountStatus": "Active",
      "emailVerified": false,
      "createdAt": "2025-08-31T13:00:46.843Z"
    },
    "token": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "expiresIn": 5184000
    }
  },
  "message": "Successfully signed up with Google",
  "success": true
}