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.

Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • Accept-Language
    Type: string

    Preferred language

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • User-Agent
    Type: string
    required

    Used to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.

Body
application/json
  • client
    Type: string
    required

    OAuth client ID provided by the business

  • google_id_token
    Type: string
    required

    Token received from Google

  • address
    Type: string

    Address of the user

  • age_verified
    Type: boolean

    Whether the age of the user has been verified or not. Required when the business-level age verification is enabled.

  • age_verified_status
    Type: boolean

    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.

  • anniversary
    enum
    const:  
    YYYY-MM-DD

    Anniversary date of the user

    values
    • YYYY-MM-DD
  • birthday
    Type: string

    Date of birth of the user, in YYYY-MM-DD format

  • city
    Type: string

    City where the user lives

  • favourite_location_ids
    Type: string

    Favorite location IDs of the user

  • first_name
    Type: string

    First name of the user

  • gender
    Type: string

    Gender of the user

  • last_name
    Type: string

    Last name of the user

Responses
  • application/json
  • application/json
  • application/json
Request Example for post/api2/mobile/users/google_sign_in
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"
  }
}