Loyalty API

Write Call

UpdateCustomerDetails1

Update the customer's details as if the customer has just entered that value on the loyalty page. Strictly for self-service portals, customer support portals, data collection forms and the like.

Kind Write API call
Method POST
URL https://app.bubblehouse.com/api/v20230601/<shop>/UpdateCustomerDetails1
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 function runs in real time, and is meant to give an immediate feedback to the customer. It is for strictly customer-initiated updates happening right now.

Good usage examples: self-service customer portals, customer support portals, data collection forms and popups.

Bad usage examples: batch updates, importing data from other systems. Use UpdateCustomersV call for those.

Note that the function call itself will succeed even if some field updates fail (either due to invalid data or external system failures). You are expected to check the result property for each updated field, and to display validation errors accordingly.

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.

  • first_name string | null optional

    The new first name to use.

    Set to empty string to remove the value. Omit or set to null to keep the current value.

  • last_name string | null optional

    The new last name to use.

    Set to empty string to remove the value. Omit or set to null to keep the current value.

  • phone string | null optional

    The new phone number to use.

    Set to empty string to remove the value. Omit or set to null to keep the current value.

    Updating a phone number is a long-running operation that involves talking to external systems; the call might take a few seconds or even a minute to complete.

    Updating a phone number can fail, or can report that the provided number is invalid.

    The resulting phone number might not match the input exactly, for example, if the input is missing a country code, the resulting phone number might have a country code added.

  • birthday date | null optional

    The new birthday to use (YYYY-MM-DD format).

    Set to an empty string (or 0-0-0) to remove the value. Omit or set to null to keep the current value.

    Use 0-MM-DD format if the year is unknown.

    Updating a birthday can report an invalid value if the day is invalid. Shop-specific rules might affect which exact dates are acceptable.

Output

  • ok boolean required

    True if all updates have succeeded, false otherwise.

  • first_name UpdateResult1 required if corresponding input field provided

    The result of updating the first name.

  • last_name UpdateResult1 required if corresponding input field provided

    The result of updating the last name.

  • birthday UpdateResult1 required if corresponding input field provided

    The result of updating the birthday.

  • phone UpdateResult1 required if corresponding input field provided

    The result of updating the birthday.

API-wide Errors

Status Error Reason & Examples
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.

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.

Global Errors

Status Error Reason & Examples
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.

400 obsolete_global_api_version

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

Previous
Unredeem1