Skip to main content

Google Login

This guide explains how to implement Google Sign-In in the Calwe application.

Request

Endpoint

  • Method: GET
  • URL: /v1/customer/auth/google/callback

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes

Request Body

{
"google_id": "google_id",
"fcm_token": "firebase_cloud_messaging_token",
"device_id": "unique_device_identifier"
}
ParameterTypeRequiredDescription
google_idstringYesThe ID token obtained from Google Sign-In
fcm_tokenstringNoFirebase Cloud Messaging token for push notifications
device_idstringRequired with fcm_tokenUnique identifier for the device

Success Response

{
"success": true,
"message": "تم تسجيل الدخول بنجاح.",
"data": {
"firstName": "Ahmed",
"lastName": "Mohammed",
"email": "example@gmail.com",
"birthDate": "1990/01/01",
"phone": null,
"gender": "ذكر",
"isPhoneVerified": false,
"isEmailVerified": true,
"hasCompletedProfile": false,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9....",
"tokenType": "Bearer"
},
"statusCode": 202
}

Example Implementation Flow

  1. Initialize Google Sign-In in your application
  2. User clicks on Google Sign-In button
  3. Obtain Google ID token after successful sign-in
  4. Send token to /v1/customer/auth/google/callback endpoint
  5. Handle the response and store the API token