POST Customer Token Login

​

Signs a customer in using a security token issued by the brand's Punchh loyalty platform, rather than credentials. Use it when the customer arrives already authenticated — from a loyalty app or site handing off into ordering — so they are not asked to log in twice.

The token comes from Punchh, not from MENU. Send it as security-token, noting the hyphen.

The response returns the customer account, the MENU customer token to use as the Authorization bearer on subsequent calls, and the dlc_access_token for loyalty calls.

This is refused with 403 for brands that use an external identity provider — check GET /brands/{brand_id}/customer-identity-provider-configuration first.

Headers

  • Type of content accepted by the API (application/json in most cases)

  • Application key for specific client app

  • Content-Type header

  • Version of the API to be used

  • Unique request identifier

Body

required
application/json
  • The security token issued by the brand's Punchh platform.

Responses

  • application/json
  • The brand uses an external identity provider, so MENU customer auth is unavailable.

  • The brand has no Punchh integration configured.

  • security-token is missing or is not a string.

Request Example for post/customers/token-login
curl https://api-public-demo.menu.app/api/customers/token-login \
  --request POST \
  --header 'Accept: application/json' \
  --header 'Application: application-key' \
  --header 'Content-Type: application/json' \
  --header 'API-VERSION: ' \
  --header 'X-Request-ID: c10b4a70-6274-490d-80a0-03e7bb826937' \
  --data '{
  "security-token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}'
{
  "status": "OK",
  "code": 200,
  "data": {
    "customer_account": {
      "id": 8891,
      "type_id": 1,
      "brand_id": 57,
      "first_name": "Ada",
      "last_name": "Lovelace",
      "email": "ada@example.com",
      "phone_number": "+15550000000",
      "locale": "en",
      "state": 1
    },
    "token": {
      "ttl": 60,
      "refresh_ttl": 20160,
      "issued_token_type": "access_token",
      "token_type": "Bearer",
      "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
    },
    "dlc_access_token": {
      "ttl": 60,
      "refresh_ttl": 20160,
      "issued_token_type": "access_token",
      "token_type": "Bearer",
      "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
    }
  }
}