Log in With Google

This API enables users to log in using Google Sign-in on the Web.

The following must be configured for the business in the Punchh platform to make a successful call to the API:

  • Google sign-in must be enabled.
  • Google web client ID, Google iOS client ID / Google Andriod client ID, and Google web client secret must be specified.

Contact your Punchh representative to update these configurations.

Headers
  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • User-Agent
    Type: string
    required

    For details, see User Agent.

  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Accept-Language
    Type: string

    Set to the language you are using.

Body
application/json
  • client
    Type: string
    required

    Client key of 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. Possible Values: true, false. The value is set to true if the user's age is verified; otherwise, it is set to false. The response returns this parameter in sign-in, sign-up, and user update APIs if the age verification is enabled for the business in the Punchh platform. Contact your Punchh representative to update this Punchh platform configuration setting.

  • 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/api/auth/users/connect_with_google
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/users/connect_with_google \
  --request POST \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
  --header 'x-pch-digest: SIGNATURE_GOES_HERE' \
  --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
}'
{
  "address_line1": "ADDRESS_GOES_HERE",
  "anniversary": null,
  "avatar_remote_url": null,
  "birthday": "1999-01-01",
  "city": "Mountain View",
  "created_at": "2023-05-24T13:25:23Z",
  "email": "test@example.com",
  "email_verified": false,
  "fb_uid": null,
  "first_name": "FIRST_NAME_GOES_HERE",
  "age_verified": false,
  "privacy_policy": false,
  "gender": "female",
  "id": 94731770,
  "last_name": "LAST_NAME_GOES_HERE",
  "state": "California",
  "updated_at": "2023-05-25T06:29:55Z",
  "zip_code": "45672",
  "test_user": false,
  "allow_multiple": false,
  "authentication_token": "AUTHENTICATION_TOKEN_GOES_HERE",
  "auth_token": {
    "token": "ACCESS_TOKEN_GOES_HERE",
    "seconds_to_expire": null,
    "revoked_at": null,
    "refresh_token": "REFRESH_TOKEN_GOES_HERE",
    "scopes": [
      "wifi"
    ]
  },
  "favourite_locations": "",
  "favourite_store_numbers": "1023",
  "marketing_email_subscription": false,
  "marketing_pn_subscription": false,
  "passcode_configured": false,
  "profile_field_answers": {},
  "referral_code": "REFERRAL_CODE_GOES_HERE",
  "referral_path": "URL_GOES_HERE",
  "secondary_email": "test@example.com",
  "terms_and_conditions": false,
  "title": null,
  "user_as_barcode": "11111111",
  "user_as_qrcode": "QR_CODE_GOES_HERE",
  "user_code": "P11111111",
  "user_id": 94731770,
  "user_relations": [],
  "work_zip_code": null,
  "preferred_locale": "en",
  "force_password_reset": null,
  "expiration_date": null,
  "sms_subscription": false,
  "phone": "1111111111",
  "migrate_status": false,
  "email_unsubscribe": true,
  "allow_push_notifications": false,
  "facebook_signup": false,
  "communicable_email": "test@example.com",
  "access_token": "ACCESS_TOKEN_GOES_HERE",
  "verification_mode": null,
  "apple_signup": false,
  "apple_uid": null,
  "age_verified_status": true
}