Log in With Google
Enables mobile application users to log in using Google Sign-in.
The following must be configured for the business in the Punchh platform to make a successful call to the API:
1. The Enable Google Sign-in option must be enabled in the Punchh platform. Contact your Punchh representative to update this Punchh platform configuration.
2. Google Web Client ID, Google iOS Client ID / Google Andriod Client ID, and Google Web Client Secret must be specified in the Punchh platform. Contact your Punchh representative to update this Punchh platform configuration.
- Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringAccept
- Language Preferred language
- Type: stringContent
- Type requiredSet this header to application/json.
- Type: stringUser
- Agent requiredUsed to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.
- Type: stringclientrequired
OAuth client ID provided by the business
- Type: stringgoogle
_id _token requiredToken received from Google
- Type: stringaddress
Address of the user
- Type: booleanage
_verified Whether the age of the user has been verified or not. Required when the business-level age verification is enabled.
- Type: booleanage
_verified _status Whether or not the user has undergone age verification by Koupon Media. Possible Values: true, false. The parameter is accepted in the request if Koupon Media is selected as the age verification adapter for the business in the Punchh platform. Contact your Punchh representative to update this configuration.
- enumanniversaryconst:YYYY-MM-DD
Anniversary date of the user
values- Y
Y Y Y - M M - D D
- Type: stringbirthday
Date of birth of the user, in YYYY-MM-DD format
- Type: stringcity
City where the user lives
- Type: stringfavourite
_location _ids Favorite location IDs of the user
- Type: stringfirst
_name First name of the user
- Type: stringgender
Gender of the user
- Type: stringlast
_name Last name of the user
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/users/google_sign_in \
--request POST \
--header 'x-pch-digest: {{$$.env.signature}}' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'Content-Type: application/json' \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--data '{
"client": "CLIENT_KEY_GOES_HERE",
"google_id_token": "GOOGLE_ID_TOKEN_GOES_HERE",
"first_name": "FIRST_NAME_GOES_HERE",
"last_name": "LAST_NAME_GOES_HERE",
"privacy_policy": true,
"age_verified": false,
"phone": 1111111111,
"birthday": "1999-01-01",
"favourite_location_ids": "304155",
"secondary_email": "test@example.com",
"marketing_email_subscription": true,
"marketing_pn_subscription": true,
"anniversary": "2013-07-13",
"zip_code": "30201",
"address": "ADDRESS_GOES_HERE",
"city": "Mountain View",
"state": "California",
"gender": "female",
"send_compliance_sms": true,
"terms_and_conditions": true,
"age_verified_status": true
}'
{
"access_token": {
"token": "ACCESS_TOKEN_GOES_HERE",
"seconds_to_expire": null,
"revoked_at": null,
"refresh_token": "REFRESH_TOKEN_GOES_HERE",
"scopes": [
"wifi"
]
},
"user": {
"address": "ADDRESS_GOES_HERE",
"anniversary": null,
"avatar_remote_url": null,
"birthday": "1999-01-01",
"city": "Mountain View",
"communicable_email": "test@example.com",
"created_at": "2023-02-24T15:56:07+05:30",
"email": "test@example.com",
"email_verified": false,
"facebook_signup": null,
"apple_signup": null,
"apple_uid": "APPLE_UID_GOES_HERE",
"favourite_location_ids": "304155",
"favourite_store_numbers": "1023",
"fb_uid": null,
"first_name": "FIRST_NAME_GOES_HERE",
"gender": "female",
"has_generated_fb_email": false,
"last_name": "LAST_NAME_GOES_HERE",
"marketing_email_subscription": true,
"marketing_pn_subscription": true,
"migrate_status": false,
"passcode_configured_for_giftcards": false,
"phone": "1111111111",
"profile_field_answers": {
"upf0": "test",
"upf1": "test",
"upf2": "test",
"upf3": "test"
},
"referral_code": "REFERRAL_CODE_GOES_HERE",
"referral_path": "URL_GOES_HERE",
"secondary_email": null,
"state": null,
"superuser": false,
"terms_and_conditions": false,
"privacy_policy": false,
"title": "",
"updated_at": "2023-02-28T19:06:24+05:30",
"user_as_qrcode": "QR_CODE_GOES_HERE",
"user_code": "P11111111",
"user_id": 111111111,
"preferred_locale": "en",
"user_relations": [],
"zip_code": null,
"verification_mode": null,
"sms_subscription": false,
"age_verified_status": true,
"user_joined_at": "2023-02-24T15:56:07+05:30",
"apple_pass_url": "APPLE_PASS_URL_GOES_HERE",
"google_pass_url": "GOOGLE_PASS_URL_GOES_HERE"
}
}