Member Enrollment/Profile Update
POST/client/users
Request
This request is used to enroll a customer into the loyalty program.
Note: If the phone number is part of the lock configuration, when a phone number is associated with an account, a lock is placed on the phone number to prevent use for another account. If an account with a new phone number is added, then the number is locked on that account. If a new account is added with an existing phone number associated with an account, then the new account will get the phone number and the lock, and the old account will lose both (it will have no phone number). If a phone number is deleted on an account, then the lock and the phone number are removed.
Body
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| externalIdentifier | Primary identifier of the account holder in the client system | String | Optional, but can be configured to be a required field. |
| dateOfBirth | Customer date of birth | String | Optional. "YYYY-MM-DD" |
| gender | Customer Personal Information | Enum: "M", "F", "Other", "PreferNotToSay" | Optional. M = 'MALE', F = 'FEMALE', Other = 'Other', PreferNotToSay = 'PreferNotToSay'. |
| firstName | Customer Personal Information | String | Optional. Will not be included in call if empty. |
| lastName | Customer Personal Information | String | Optional. Will not be included in call if empty. |
| Customer email | String | Required attribute | |
| businessName | Customer business name | String | Optional. Can be used in Business-to-Business loyalty programs |
| postalZipCode | Customer's Postal Code(Canada) or Zip Code (United States) | String | Required attribute: Example (Postal Code): "H0H 0H0" Example (Zip Code): "00000" |
| This attribute is deprecated. | |||
| physicalCard | Loyalty card number | String | Optional. If digital card creation is disabled, this is a required field. |
| street | Customer address information | String | Optional |
| street2 | Customer address information | String | Optional |
| provinceState | Customer's province or state | Enum Canada provinces: "NL", "PE", "NS", "NB", "QC", "ON", "MB", "SK", "AB", "BC", "YT", "NT", or "NU" American states: "AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY" American military states: "AE", "AP", "AA" | Optional. Provinces and territories in Canada or states and military states on United States |
| This attribute is deprecated. | |||
| phoneNumber | Customer personal information | String | Optional. Example: "(999) 999-9999" |
| phoneNumberSource | Source through which the phone number was provided. | String | Optional Applicable only to new registrants. |
| languagePreference | Customer language preference | String including language code and country code; for example: "en-CA", "fr-CA", or just language code, for instance: "FR" or "EN" | Optional. Value can be language code (ISO 639) and country code (ISO 3166) joined by hyphen (in accordance with BCP 47) or ISO 639 two-letter language code only. If languagePreference is not provided or the value is not valid, the default value is "en-CA". |
| city | Customer address information | String | Optional |
| channel | Indicator for request source | Enum, commonly-used values: "STORE", "POS", "WEBSITE", "APP", "PARTNER" | Optional. Depending on client implementation, the default is "APP" or "STORE". Note that the client may supply their own custom value, but it cannot be null or blank. |
| cardLabel | Allows a unique name to identify the member's card | String | Optional. The card label should be 1-100 characters. Possible characters: a-z, A-Z, 0-9, space, underscore, hyphen, single quote. |
| extendedDataSource | Used with multi-source EMD to identify the source of the EMD provided. | String | Optional, used only with multi-source EMD. For example: "MARKETING", "PARTNERSHIP", "PPN", "SALESFORCE", or "BANKING_INFO" |
| extendedData | Contains custom attributes for an account | Object | Optional. Can be used for offer targeting and for reporting/analytics purposes. Attributes included must be declared in the ESI system; talk to your TSA for more information. For instance, to provide banking information, the attributes could be: "bankName", "institutionNumber", accountNumber", "transitNumber", and "accountHolderType". |
| accountAssociations | Contains different AccountAssociations | Array of AccountAssociations: "accountAssociations":[{ associationType:"type", associationValue]:"value"}] | Optional attribute. Creates associations under AssociationTypes configured in the system. |
| referralCode | Code provided as reference to referrer (not provided if not referred) | String | Optional. Provision of code related to potential rewards for referee and possibly referrer if this member carried out specified action or spend |
| loyaltyId | Unique loyalty program identifier for the account. | String | Required only if physicalCard is not an attribute that is included in the request and if digitalCard is disabled in the configuration |
Response
| Attribute | Description | Format | Note |
|---|---|---|---|
| accountID | GUID identifying the account | String | |
| loyaltyCard | Loyalty Card Number registered to the account | String | |
| cardStatus | Status of the loyalty card | String | Always "ACTIVE" |
| cardType | Indicator for the type of card the associated to the account | Enum: "DIGITAL" or "PHYSICAL" | If data is in the process of being migrated into ES Loyalty and certain configuration settings are set, then the card can be saved as "DIGITAL" or "PHYSICAL". |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Sorry, that email address is already in use | EMAIL_ALREADY_EXISTS | Email address is already registered in the system |
| 400 Bad Request | Missing Required Fields | MISSING_REQUIRED_FIELDS_ERROR | A mandatory field is not in the request body. See ConfigType = 'REGISTRATION', attribute 'mandatoryFields' |
| 400 Bad Request | LoyaltyID {loyalty_id} is not allocated and therefore cannot be claimed | INVALID_REQUEST | LoyaltyID value is not in the list of allocated values |
| 400 Bad Request | Provided business name is not valid | INVALID_REQUEST | businessName has more than 100 characters |
| 400 Bad Request | That account cannot be registered | INVALID_REQUEST | Card number submitted for physicalCard is invalid |
| 400 Bad Request | Card has already been claimed by another account! | INVALID_REQUEST | Card number belongs to a different account |
| 400 Bad Request | LoyaltyId is required for this operation | INVALID_REQUEST | When physicalCard is not in the request body and digital card configuration is disabled. See ConfigType = 'REGISTRATION', attribute 'mandatoryFields' in configuration file. |
| 400 Bad Request | ExternalIdentifier length is greater than 100 characters | INVALID_LOYALTY_ID | When externalIdentifier has more than 100 characters |
| 400 Bad Request | Invalid Extended data: Exceeded data size limit for extended data: {dataSize} Bytes | INVALID_REQUEST | When extendedData size exceeds the size limit. See the limit on ConfigType='EXTENDED_DATA', attribute Platform.DataSizeLimitInKb in configuration file. |
| 400 Bad Request | Invalid Extended data: Exceeded root level key limit for extended data {numberOfKeys} keys | INVALID_REQUEST | When extendedData exceeds number of attributes/keys limit. See the limit on ConfigType='EXTENDED_DATA', attribute Platform.TopLevelKeysLimit in configuration file. |
| 400 Bad Request | Attribute(s) {att1}, {att-x} are already used in another source. | INVALID_REQUEST | Attributes must be unique to this EMD source. |
| 400 Bad Request | INTERNAL cannot be used as extended data source. | INVALID_REQUEST | INTERNAL is not a valid EMD data source value. |
| 400 Bad Request | {value} is not valid extended data source. | INVALID_REQUEST | Data source name provided is not valid. |
| 400 Bad Request | Provided association type: is not allowed. | INVALID_REQUEST | Association Type should be one of the configured types in system. |
| 400 Bad Request | AssociationValue should be 3-128 characters. Possible characters: a-z, A-Z, 0-9, space, underscore, hyphen. | INVALID_REQUEST | Association Value allows 3-128 characters which can have spaces,underscores and hyphens. |
| 400 Bad Request | Association Type is mandatory and required to be non-empty | MISSING_REQUIRED_FIELDS_ERROR | Association Type is mandatory. |
| 400 Bad Request | Association Value is mandatory and required to be non-empty | MISSING_REQUIRED_FIELDS_ERROR | Association Value is mandatory. |
| 400 Bad Request | Account association feature is not supported. | INVALID_REQUEST | ACCOUNT_ASSOCIATION feature needs to be enabled to add Associations |
| 400 Bad Request | Multiple associations with an Association Type are not allowed. | INVALID_REQUEST | User cannot have multiple associations with a single associationType |
| 400 Bad Request | email is mandatory and required to be non-empty | INVALID_REQUEST | A valid email address must be provided. |
| 400 Bad Request | Invalid PostalZipCode: {postalZipCode} | INVALID_REQUEST | Invalid Postal Code or Zip Code |
| 400 Bad Request | No active referral program found. | ACTIVE_REFERRAL_PROGRAM_NOT_FOUND | There is no active referral program related to the referral code provided. |
| 400 Bad Request | Invalid referral code generated. | INVALID_REFERRAL_CODE | The referral code provided is not a valid code. |
| 400 Bad Request | Referrer's account status is not eligible: {status} to participate in the Referral Program. | INVALID_ACCOUNT_STATUS | Account status does not allow referral; for example, CLOSED or DECEASED. |
| 400 Bad Request | Referral Quota Reached | REFERRAL_QUOTA_REACHED | The configured limit on the number of referalls allowed for the referrer has been reached. |
Request
Responses
- 200
- 400
- 500
200 - User Enrolled with Digital Card
400 - Email Already in Use
500 - Unexpected Error
Response Headers
Date
Example:
Wed, 19 Jun 2024 20:35:16 GMTContent-Length
Example:
143Connection
Example:
keep-alivex-amzn-RequestId
Example:
01ef30bd-770c-40ee-9b47-9347a2efab76Referrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*Expect-CT
Example:
max-age=86400Strict-Transport-Security
Example:
max-age=31536000; includeSubDomains; preloadFeature-Policy
Example:
vibrate 'none'; geolocation 'none'X-Frame-Options
Example:
sameoriginContent-Security-Policy
Example:
connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.netx-amz-apigw-id
Example:
ZocYRFdtIAMEIUA=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-66734101-256bff5e544b192412f1c766;Parent=6e0d7ac186b5e299;Sampled=0;lineage=eaff8eb5:0