Log in With Apple

A user can sign in with Apple using a random email ID generated by Apple on the web. The generated authorization code corresponds to each redirect URI as provided in the redirect_uri request parameter.

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

    Set to the language you are using.

  • Content-Type
    Type: string
    required

    Set this header to application/json.

  • User-Agent
    Type: string
    required

    For details, see User Agent.

Body
application/json
  • client
    Type: string
    required

    Client key of the business

  • redirect_uri
    Type: string

    The URI used when authenticating with Apple

  • user
    Type: object
Responses
  • application/json
  • application/json
Request Example for post/api/auth/users/connect_with_apple
curl https://SERVER_NAME_GOES_HERE.punchh.com/api/auth/users/connect_with_apple \
  --request POST \
  --header 'x-pch-digest: SIGNATURE_GOES_HERE' \
  --header 'Accept: application/json' \
  --header 'Accept-Language: en' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
  --data '{
  "client": "CLIENT_GOES_HERE",
  "redirect_uri": "https://redirect-uri.com/auth/apple",
  "user": {
    "first_name": "FIRST_NAME_GOES_HERE",
    "last_name": "LAST_NAME_GOES_HERE",
    "email": "test@example.com",
    "external_source_id": "SOURCE_ID_GOES_HERE",
    "authorization_code": "AUTHORIZATION_CODE_GOES_HERE",
    "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": []
  },
  "user": {
    "address": null,
    "anniversary": null,
    "avatar_remote_url": null,
    "birthday": null,
    "city": null,
    "communicable_email": "test@example.com",
    "created_at": "2020-09-09T06:56:37Z",
    "email": "test@example.com",
    "email_verified": false,
    "facebook_signup": null,
    "apple_signup": null,
    "apple_uid": "APPLE_UID_GOES_HERE",
    "favourite_location_ids": "",
    "favourite_store_numbers": "",
    "fb_uid": null,
    "first_name": "FIRST_NAME_GOES_HERE",
    "gender": null,
    "has_generated_fb_email": false,
    "last_name": "LAST_NAME_GOES_HERE",
    "marketing_email_subscription": false,
    "marketing_pn_subscription": false,
    "migrate_status": false,
    "passcode_configured_for_giftcards": false,
    "phone": null,
    "profile_field_answers": {},
    "referral_code": "REFERRAL_CODE_GOES_HERE",
    "referral_path": "URL_GOES_HERE",
    "secondary_email": null,
    "state": null,
    "superuser": false,
    "terms_and_conditions": false,
    "title": null,
    "updated_at": "2020-09-09T07:48:41Z",
    "user_as_qrcode": "QR_CODE_GOES_HERE",
    "user_code": "P11111111",
    "user_id": 111111111,
    "preferred_locale": null,
    "user_relations": [],
    "zip_code": null,
    "verification_mode": null,
    "sms_subscription": false,
    "age_verified_status": true
  }
}