Customers .: Get

API Reference / v15

Get details on a customer

This endpoint allows you to get details on a customer using their payment token. This endpoint can be used after a transaction to get the user’s name, order count and loyalty ID. It should not be required or hold up the transaction if for some reason it is slow or fails.

To request the user’s payment method, you must have a token with the manage_merchant_orders permission.

Request Endpoint

POST /v15/merchants/:merchant_id/customer

Authorization Required – User Token in Header

Authorization: token merchant="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"

cURL Example

curl https://sandbox.thelevelup.com/v15/merchants/34/customer \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token merchant="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"'
  -d '{
    "customer": {
      "payment_token_data": "LU02000008ZS9OJFUBNEL6ZM030000LU"
    }
  }'

Response Parameters

Key Type Description
loyalty_id Integer The merchant-specific ID for this customer.
name String The customer’s first name and last initial.
orders_count Integer The count of successful orders by this customer at this merchant.

Example:

{
  "customer": {
    "loyalty_id": 123456,
    "name": "Bob B.",
    "orders_count": 15
  }
}

Errors

HTTP/1.1 error 404 Not Found - QR Code is invalid

HTTP/1.1 error 401 Unauthorized - Merchant token is not valid for the chosen location