Loyalty API

Read Call

CustomerDetails1

Returns customer information as stored in Bubblehouse, including profile data, account status, and shop-provided attributes.

Kind Read API call
Method GET or POST
URL https://app.bubblehouse.com/api/v20230601/<shop>/CustomerDetails1
Authentication Customer TokenShop Token
You have a choice of making this call from your server using a shop token and specifying a customer ID, or making this call from a web browser/app using a customer token you have generated on the server.

This endpoint returns the customer data as originally provided via API and/or collected by first-party integrations.

Input

  • customer CustomerIdentity1 required if using a shop token

    A customer to operate upon, when using a shop token.

    If you're using a customer token and decide to pass this field (which we do not recommend), it must match the customer from the token.

Output

See Customer2.

Usage Examples

Retrieve customer by Bubblehouse ID

The most efficient way to retrieve customer details when you have the Bubblehouse ID:

Request

{
  "customer": {
    "bhid": "0000018abc123def"
  }
}

Response

{
  "anniversary": "2015-08-20",
  "bh_id": "0000018abc123def",
  "birthday": "1990-05-15",
  "email": "alice@example.com",
  "email_marketing_consent": "subscribed",
  "email_verified": "unknown",
  "extras": {
    "favorite_color": "blue",
    "preferences": "organic"
  },
  "first_name": "Alice",
  "id": "shop-customer-123",
  "last_name": "Smith",
  "optin": true,
  "order_count": 42,
  "personal_referral_code": "ALICE20",
  "phone": "+15551234567",
  "signed_up_at": "2020-01-15T10:30:00Z",
  "tags": [
    "vip",
    "wholesale"
  ],
  "total_spent": "1250.00"
}

Retrieve customer by email

Find a customer using their email address:

Request

{
  "customer": {
    "email": "customer@example.com"
  }
}

Response

{
  "alt_emails": [
    "old.email@example.com"
  ],
  "bh_id": "0000018def456789",
  "email": "customer@example.com",
  "email_marketing_consent": "unsubscribed",
  "email_verified": "unknown",
  "first_name": "Bob",
  "id": "shop-customer-456",
  "last_name": "Johnson",
  "optin": true,
  "order_count": 5,
  "signed_up_at": "2023-06-01T14:20:00Z",
  "sms_marketing_consent": "subscribed",
  "tags": [],
  "total_spent": "350.00"
}

API-wide Errors

Status Error Reason & Examples
404 no_customers_match_customer_identity

The customer identity ('customer' input parameter) does not match a known customer.

404 customer_identity_partially_mismatches_matched_customer

A customer has been matched by one of the fields of the customer identity ('customer' input parameter), but some non-empty fields do not match Bubblehouse data on that customer.

400 missing_customer_identity

The customer identity ('customer' input parameter) has not been specified when using a shop token. You need to either specify a non-empty value for one of the customer identity fields, or use a customer token.

404 empty_customer_identity

All fields of the customer identity ('customer' input parameter) have been empty when using a shop token. You need to either specify a non-empty value for one of the customer identity fields, or use a customer token.

403 customer_identity_does_not_match_token

API call is using a customer token, but the customer identity in API params does not match the customer from the token.

Global Errors

Status Error Reason & Examples
400 obsolete_global_api_version

The global API version you are trying to use is no longer supported.

400 inaccessible_global_api_version

The global API version you are trying to use is not enabled on your account.

401 invalid_token

The provided authentication token is invalid or has expired.

429 rate_limit_exceeded

Your usage is over the rate limit. Ensure that you're not making duplicate calls, and contact our team for a rate limit increase.

400 invalid_global_api_version

The global API version you are trying to use has never existed.

Previous
CustomerBalance3