Sign up / Register

Registers a user's profile on the app of a business

Note: If the business is using referral code, the actual first_name and last_name of the guest must be passed because the referral code will be generated using the first_name, last_name, and some random characters. Also, if you do not pass the first_name or the last_name, the API response may be delayed or time out.

Using Referral Code As Invite Code in the Sign-up Process

When a user signs up using the Sign up / Register API, the API returns a referral code within the user object. The user can share this code with non-loyalty users to invite them to join the business loyalty program.

When a referred user signs up and enters the shared referral code in the mobile app, this referral_code must be passed in the invite_code request parameter when calling the Sign up / Register API.

Headers
  • punchh-app-device-id
    Type: string
    required

    The app device ID helps Punchh identify each device so that certain rewards can be awarded individually to each device instead of per user. For example, the sign-up reward is given to each device ID to prevent fraudulent sign-ups so that a user cannot do repeated sign-ups from a single device to get rewards. It should not change even if the user resets a device. See the sample code to generate the punchh-app-device-id header.

  • 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

    Preferred language

  • 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

    OAuth client ID provided by the business

  • user
    Type: object
Responses
  • application/json
  • application/json
Request Example for post/api2/mobile/users
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/users \
  --request POST \
  --header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
  --header 'x-pch-digest: {{$$.env.signature}}' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Accept-Language: en' \
  --header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "user": {
    "email": "test@example.com",
    "password": "PASSWORD_GOES_HERE",
    "password_confirmation": "PASSWORD_GOES_HERE",
    "first_name": "FIRST_NAME_GOES_HERE",
    "last_name": "LAST_NAME_GOES_HERE",
    "phone": 1111111111,
    "apn_token": "APN_TOKEN_GOES_HERE",
    "gcm_token": "GCM_TOKEN_GOES_HERE",
    "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": "male",
    "invite_code": "INVITE_CODE_GOES_HERE",
    "terms_and_conditions": true,
    "external_source": "SOURCE_GOES_HERE",
    "external_source_id": "SOURCE_ID_GOES_HERE",
    "send_compliance_sms": "true",
    "signup_channel": "Wifi",
    "age_verified_status": true
  }
}'
{
  "access_token": {
    "token": "ACCESS_TOKEN_GOES_HERE",
    "seconds_to_expire": null,
    "revoked_at": null
  },
  "user": {
    "address": "ADDRESS_GOES_HERE",
    "avatar_remote_url": null,
    "birthday": "1999-01-01",
    "communicable_email": "test@example.com",
    "city": "Mountain View",
    "created_at": "2016-03-16T11:40:07+00:00",
    "email": "test@example.com",
    "email_verified": false,
    "facebook_signup": null,
    "favourite_locations": "304155",
    "favourite_store_numbers": "1023",
    "fb_uid": null,
    "first_name": "FIRST_NAME_GOES_HERE",
    "gender": "male",
    "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": {},
    "referral_code": "REFERRAL_CODE_GOES_HERE",
    "referral_path": "URL_GOES_HERE",
    "secondary_email": "test@example.com",
    "state": "California",
    "superuser": false,
    "terms_and_conditions": true,
    "title": null,
    "updated_at": "2016-03-16T11:40:08+00:00",
    "user_as_barcode": "1111111",
    "user_as_qrcode": "QR_CODE_GOES_HERE",
    "user_code": "P11111111",
    "user_id": 111111111,
    "user_relations": [],
    "zip_code": "30201",
    "anniversary": "2013-07-13",
    "verification_mode": null,
    "apple_signup": null,
    "apple_uid": null,
    "has_generated_fb_email": false,
    "sms_subscription": true,
    "apple_pass_url": "APPLE_PASS_URL_GOES_HERE",
    "google_pass_url": "GOOGLE_PASS_URL_GOES_HERE",
    "age_verified_status": true,
    "user_joined_at": "2016-03-16T11:40:07+00:00"
  }
}