Log in With Facebook

This API is invoked when a user registers on a business app using Facebook ID, email address, first name, last name, etc. On success, the API returns the user's profile details.

Headers
  • x-pch-digest
    Type: string
    required

    The signature for the API call

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • Accept
    Type: string
    required

    Advertises which content types the client is able to understand

  • Accept-Language
    Type: string

    Set to the language you are using.

  • User-Agent
    Type: string
    required

    For details, see User Agent.

Body
application/json
  • access_token
    Type: string
    required

    Access token provided by Facebook

  • client
    Type: string
    required

    Client key of the business

  • email
    Type: string
    required

    Email address of the user for sign-up

  • address_line1
    Type: string

    Address information (part 1) of the user

  • address_line2
    Type: string

    Address information (part 2) of the user

  • 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
    Type: string

    Anniversary of the user

  • apn_token
    Type: string

    Apple Push Notification (APN) token

  • apn_token_readability
    Type: boolean

    Whether Apple Push Notification (APN) is enabled on the iOS mobile app or not

  • app_device_id
    Type: string

    Device ID of the mobile app

  • birthday
    Format: dateenum
    const:  
    YYYY-MM-DD

    Birthday of the user

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

    Cell phone number of the user

Responses
  • application/json
  • 412

    Sending invalid Signature

  • 422

    Sending invalid Entity

Request Example for post/api/auth/users/connect_with_facebook
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/users/connect_with_facebook \
  --request POST \
  --header 'x-pch-digest: SIGNATURE_GOES_HERE' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Accept-Language: en' \
  --header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
  --data '{
  "access_token": "ACCESS_TOKEN_GOES_HERE",
  "address_line_1": "ADDRESS_GOES_HERE",
  "anniversary": "2015-05-17",
  "apn_token": "APN_TOKEN_GOES_HERE",
  "app_device_id": "APP_DEVICE_ID_GOES_HERE",
  "birthday": "1990-05-17",
  "cell_phone": "+1-111-111-1111",
  "client": "CLIENT_GOES_HERE",
  "country": "USA",
  "email": "test@example.com",
  "fav_location_id": 30245,
  "fb_uid": "FB_UID_GOES_HERE",
  "first_name": "FIRST_NAME_GOES_HERE",
  "gcm_token": "GCM_TOKEN_GOES_HERE",
  "gender": "male",
  "invite_code": "DianeM97",
  "last_name": "LAST_NAME_GOES_HERE",
  "password": "PASSWORD_GOES_HERE",
  "password_confirmation": "PASSWORD_GOES_HERE",
  "secondary_email": "test@example.com",
  "state": "Ohio",
  "unsubscribed": false,
  "user_relations": [
    {
      "id": 229,
      "name": "FIRST_NAME_GOES_HERE LAST_NAME_GOES_HERE",
      "relation": "kid",
      "birthday": "2013-12-31"
    },
    {
      "id": 230,
      "name": "FIRST_NAME_GOES_HERE LAST_NAME_GOES_HERE",
      "relation": "spouse",
      "birthday": "1992-12-31"
    }
  ],
  "work_zip_code": "1234556",
  "zip_code": "70001",
  "age_verified_status": true
}'
{
  "access_token": "ACCESS_TOKEN_GOES_HERE",
  "address_line1": "ADDRESS_GOES_HERE",
  "allow_multiple": false,
  "allow_push_notifications": true,
  "anniversary": "2015-05-17",
  "authentication_token": "AUTHENTICATION_TOKEN_GOES_HERE",
  "avatar_remote_url": null,
  "birthday": "1990-05-17",
  "communicable_email": "test@example.com",
  "created_at": "2015-12-08T10:57:35Z",
  "email": "test@example.com",
  "email_unsubscribe": null,
  "email_verified": false,
  "facebook_signup": false,
  "favourite_locations": "30245",
  "favourite_store_numbers": "1023",
  "fb_uid": null,
  "first_name": "FIRST_NAME_GOES_HERE",
  "gender": "male",
  "id": 111111111,
  "last_name": "LAST_NAME_GOES_HERE",
  "marketing_email_subscription": false,
  "marketing_pn_subscription": false,
  "migrate_status": false,
  "passcode_configured": false,
  "phone": 1111111111,
  "preferred_menu_items": [],
  "profile_field_answers": {},
  "referral_code": "REFERRAL_CODE_GOES_HERE",
  "referral_path": "URL_GOES_HERE",
  "secondary_email": "test@example.com",
  "terms_and_conditions": false,
  "title": "",
  "updated_at": "2016-01-07T09:24:27Z",
  "user_as_barcode": "1111111",
  "user_as_qrcode": "QR_CODE_GOES_HERE",
  "user_id": 111111111,
  "user_relations": [
    {
      "id": 229,
      "name": "FIRST_NAME_GOES_HERE LAST_NAME_GOES_HERE",
      "relation": "kid",
      "birthday": "2013-12-31"
    },
    {
      "id": 230,
      "name": "FIRST_NAME_GOES_HERE LAST_NAME_GOES_HERE",
      "relation": "spouse",
      "birthday": "1992-12-31"
    }
  ],
  "wants_menu_notifications": false,
  "work_zip_code": null,
  "zip_code": "70001",
  "expiration_date": "2018-07-31",
  "age_verified_status": true
}