Skip to main content

Start Session for User Account

POST 

/client/users/:identifier/sessions

Request

This request is used to begin a session with a customer account. A session is required for any API interaction outside of enrollment.

Additional Headers

X-Identifier-Type
Differentiates what type of identifier the path variable identifier is
Possible Values

  • ACCOUNT_ID

  • LOYALTY_ID

  • EXTERNAL_ID

  • EMAIL

  • PARTNER_LINK_ID

  • PHONE_NUMBER

  • EXTERNAL_AGENT_ID

The default value for x-identifier-type (in the Headers) is ACCOUNT_ID. The default option is defined by a configuration in the configuration file (ConfigType='START_SESSION_CUX_IDENTIFIER'). 'LOYALTY_ID' and 'ACCOUNT_ID' are allowed for most clients, and those as well as 'EXTERNAL_ID' for a few clients.

Redemptions cannot be made using PHONE_NUMBER as the X-Identifier-Type, so if it is used, then attributes for redeemable balances are returned in the response as "0" values.

If EXTERNAL_AGENT_ID is used, it can be used with the externalAgentSessionId attribute in the request to provide the unique identifier.

Path Variables

Identifier
The identifier that points to the account for which the session is being opened.

Body

AttributeDefinitionFormatNotes
correlationIdUnique identifier for the sessionStringRecommended format is GUID.
channelChannel in which an offer was createdEnum, commonly-used values: "APP", "STORE", "POS", "PARTNER" or "WEBSITE"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.
externalAgentSessionIdUnique identifier provided by the client.StringOptional, GUID, can be used if enabled through configuration; also used with EXTERNAL_AGENT_ID x-identifier-type.

Response

For hierarchy information, view the sample Response code.

AttributeDefinitionFormatNote
accountIdGUID uniquely identifying the accountString
loyaltyIdLoyalty Card Number for the sessionString (Client specific)If loyaltyId was not provided in the request, then this is the primary card number on the account
externalIdPrimary identifier of the account holder in the client systemStringOptional, but can be configured to be a required field. Note that this identifier is not returned for accounts where the userStatus is "CLOSED", "CANCELLED", or "DECEASED".
membershipTypeType of membershipEnum: Defaults: "R" or "E"R = Regular, E = Employee. Note that through ConfigType='MEMBERSHIP_TYPES" in the configuration file, the letters used for these defaults can be changed.
userStatusStatus of the loyalty accountEnum: "ACTIVE", "UNREGISTERED", "EXPIRED", "DECEASED", "CLOSED", or "CANCELLED"Note that for a "ghost card" or unregistered card, the userStatus is "UNREGISTERED".
cardStatusStatus of the loyalty cardEnum: "ACTIVE", "INVALID", "SUSPENDED", "LOST_OR_STOLEN", "DAMAGED", "FRAUD_ABUSE", "CANCELLED", "EXPIRED", or "NON_LOYALTY"Always the status of the loyaltyId passed in. Note that for a card with an "UNREGISTERED" userStatus, this value is "NON-LOYALTY".
cardTypeIndicator for the type of card associated to the accountEnum: "DIGITAL" or "PHYSICAL"
isSuspendedIndicates whether the account has a status of SuspendedBoolean: true or false
isExpiredIndicates whether the account has a status of ExpiredBoolean: true or falseExpiry due to long period of inactivity
isValidValid sessionBooleanLegacy attribute. Value is always "true"
pointsBalanceCustomer's current points balanceNumber
dollarBalanceCustomer's current dollar balanceNumber
availablePointsBalanceCustomer's available points balanceNumberThis is their balance less holds on their account.
availableDollarBalanceUser's available dollar balanceNumberThis is their balance less holds on their account.
userMinRedeemPointsMinimum redemption (Points).NumberThe minimum number of points this user is able to redeem this session. If they are unable to redeem due to insufficient funds or other business rule violations, this value will be 0.
userMinRedeemDollarsMinimum redemption (Dollars)NumberThe minimum redemption this user is able to perform expressed this session in dollar amount. If they are unable to redeem due to insufficient funds or other business rule violations, this value will be 0.
userMaxRedeemPointsMaximum redemption (Points). This is the number used to display the Redeemable Balance in the Console.NumberThe maximum number of points this user is able to redeem this session. If they are unable to redeem due to insufficient funds or other business rule violations, this value will be 0.
userMaxRedeemDollarsMaximum redemption (Dollars). This is the number used to display the Redeemable Value in the Console.NumberThe maximum redemption this user is able to perform expressed this session in dollar amount. If they are unable to redeem due to insufficient funds or other business rule violations, this value will be 0.
redeemablePointBalanceThe balance that can currently be redeemed in points.NumberThis balance may be set to 0 if there is an outstanding fraud prevention advice on redemption for this account.
redempableDollarBalanceThe balance that can be currently redeemed in dollars.NumberThis balance may be set to 0 if there is an outstanding fraud prevention advice on redemption for this account.
redemptionsToDateCumulative total of redemptionsNumberHow many points the member has redeemed in the current YTD, including adjustments. The REDEEM_YEAR configuration must be turned on or this attribute will not appear.
sessionCorrelationIdCorrelationId for the session.StringThis will always match the correlationId passed in the request.
userProfileCustomer personal informationObject
dateOfBirthCustomer date of birthString"YYYY-MM-DD"
genderCustomer Personal InformationEnum: "M", "F", "Other", "PreferNotToSay"Required attribute. M = 'MALE', F = 'FEMALE', Other = 'Other', PreferNotToSay = 'PreferNotToSay'.
firstNameCustomer Personal InformationStringOptional attribute. Not returned if empty.
lastNameCustomer Personal InformationStringOptional attribute. Not returned if empty.
businessNameCustomer business nameStringOptional. Can be used in B2B loyalty programs
postalCode/zipCodePostal or Zip code of customerStringOptional. Note that in LOCALIZATION config, if addressType is set to "US" then field name will be "zipCode" and if addressType is set to "CA" then the field name will be "postalCode". Format: "H0H 0H0" / "HOHOH" / "HOHOH-HOHO".
emailEmail of userStringRequired attribute. In standard email format.
partnersMap of partner names or identifiers and the account holder’s link status for each listed partner and partner card details only for Non-Financial Partners.ObjectThe name or identifier is an object containing the "status" and optional "links" attribute. The attributes below down to "bin" are contained in this object.
{partnerName}Usually an acronym for the partner name.Object
statusWhether the partner is linked or unlinked to the member account.Enum: "LINKED" or "UNLINKED"Only linked status (LINKED/UNLINKED) are returned for financial partners and unlinked partners. In addition to status, the list of linkIds and associated last4 and bin are returned for linked non-financial partners (bin may not always be included).
linksIf the status is "LINKED", may provide details about the link.Array containing one or more objects, each containing the following three attributesReturned for linked non-financial partners only.
linkIdThe unique identifier of the link.StringOptional
last4The last four digits of the linked card or account as an identifier.StringOptional
binThe Bank Identification Number.StringOptional
membershipTiersContains detailed information about an accounts loyalty program tier informationObjectOptional. Array of loyalty programs. See the membershipTiers attribute table below.
householdContains information about a household or related group of members who may use combined rewardsObjectContains the unique ID of the household, whether the current member is the "PRIMARY" member, and data about household balances and redeemable amounts
idUnique identifier for the household of members.String
roleThe role within the household of the current member.Enum: "PRIMARY" or "SECONDARY"
balanceContains information about the household account balance in dollars and points.ObjectContains attributes with data about points and dollars balances, minimum and maximum redemption
totalPointsBalanceThe total number of points attributed to the household account.Number
totalDollarBalanceThe total number of dollars attributed to the household account.Number
totalAvailablePointBalanceThe total number of points currently available to the household account.Number
totalAvailableDollarBalanceThe total number of dollars currently available to the household account.Number
totalRedeemablePointBalanceThe total number of points that can currently be redeemed by this household account.Number
totalRedeemableDollarBalanceThe total number of dollars that can currently be redeemed by this household account.Number
minRedeemPointsThe minimum number of points that can be redeemed by this household account.Number
maxRedeemPointsThe maximum number of points that can be redeemed by this household account.Number
minRedeemDollarsThe minimum number of dollars that can be redeemed by this household account.Number
maxRedeemDollarsThe maximum number of dollars that can be redeemed by this household account.Number

membershipTiers

For hierarchy information, view the sample Response code.

AttributeDefinitionFormatNote
{{programName}}Name of the loyalty tier programObjectThe attribute name is assigned ID when creating the program. (eg. "GenericProgramName" would be the attribute).
programCodeIdentifier of the loyalty tier programStringCustomized at time of program creation
tierCodeTier code of the accounts current tierString
tierNameName or short description of the tier.String
tierRankNumerical representation of the current tier rankNumberTier numbering starts at 0
tierContextIdentifies whether tier data applies to individual tier or household tier.Enum: "INDIVIDUAL" or "HOUSEHOLD"Only used when Household tier is enabled
nextPeriodTierRankIdentifies the tier rank based on current contributions and the tier status rolled over from the last period (if enabled).NumberTier-related rank aligned to Code and Name below
nextPeriodTierCodeIdentifies the tier rank based on current contributions and the tier status rolled over from the last period (if enabled).StringFor example, "UNRANKED" or "GOLD"
nextPeriodTierNameIdentifies the tier rank or provides an explanatory message based on current contributions and the tier status rolled over from the last period (if enabled).StringFor instance, "Not yet qualified", "BRONZE", "SILVER", "GOLD", "TIER 1", "TIER 2", etc.
achievedDateCaptures the date/time at which the current tier status was achieved or, if the status was rolled over at the beginning of the period, the beginning date of this period.StringSubject to rollover configuration and subsequent adjustments, contributions, or redemptions. In the case of a household, a member joining or leaving the household may also change achievedDate if the new household balance causes a change in the household tier.
nextTierMap containing information for the accounts next tierObjectContains id, rank, and tierName
idSystem ID for next tierStringCreated when program is created
rankNumerical representation of the next tierNumber
tierNameClient-defined tier nameString
contributionsDetails about an account tier contribution amountsObjectContains the spend object
spendMap of current tier and account spend informationObjectContains total, next, and unused; use this or "next"
unitMap of current tier and account units purchased informationObjectContains total, next, and unused; use this or "spend"
nextAmount of spend required to reach the next tierString
totalTotal amount of spend within the tier program periodString
unusedAmount of spend towards the current tierString
businessUnitsList of all businessUnits participating in the programString ArrayThe name of the businessUnit is in the array.
dateRangeDefines range of the tier periodObjectContains effective and expiry dates
effectiveBeginning of the tier periodString in ISO 8601 format
expiryEnd of the tier periodString in ISO 8601 format
qualifyingBehaviourTypeLabelIdentifies the right behaviour to qualify.StringFor instance, "contributions" is set to "unit", then this attribute can identify the type of unit such as "Fuel"
qualifyingCartSelectorDescIdentifies the cart selector description corresponding to the label.StringFor example, if the above attribute is "Fuel", then this might be "Fuel Qualifying Product Description"
tierContextIdentifies whether tier data applies to individual tier or household tier.Enum: "INDIVIDUAL" or "HOUSEHOLD"Only used when Household tier is enabled
nextPeriodTierRankIdentifies the tier rank based on current contributions and the tier status rolled over from the last period (if enabled).NumberTier-related rank aligned to Code and Name below
nextPeriodTierCodeIdentifies the tier rank based on current contributions and the tier status rolled over from the last period (if enabled).StringFor example, "UNRANKED" or "GOLD"
nextPeriodTierNameIdentifies the tier rank or provides an explanatory message based on current contributions and the tier status rolled over from the last period (if enabled).StringFor instance, "Not yet qualified", "BRONZE", "SILVER", "GOLD", "TIER 1", "TIER 2", etc.
achievedDateCaptures the date/time at which the current tier status was achieved or, if the status was rolled over at the beginning of the period, the beginning date of this period.StringSubject to rollover configuration and subsequent adjustments, contributions, or redemptions. In the case of a household, a member joining or leaving the household may also change achievedDate if the new household balance causes a change in the household tier.

Error Responses

statusCodeerrorMessageerrorCodeDefinition
400 Bad RequestSession must point to an existing accountINVALID_REQUESTHeading parameter x-identifier-type is ACCOUNT_ID and the informed identifier (account_id) is invalid
400 Bad RequestUnknown loyalty identifier type provided.INVALID_REQUESTThe value for x-identifier-type is not one of the options: LOYALTY_ID, ACCOUNT_ID, EXTERNAL_ID, PARTNER_LINK_ID, or PHONE_NUMBER
400 Bad RequestStart session with phone number as an identifier is not supported.INVALID_REQUESTPhone number has not been added in the exclusive lock configuration for use.
400 Bad RequestInvalid Correlation IDINVALID_REQUESTBody parameter correlationId not provided
400 Bad RequestSession must point to an existing accountINVALID_REQUESTSession is not referencing an existing account
400 Bad RequestInvalid External IDINVALID_REQUESTExternal ID is not valid or automatic creation of non-loyalty account is not enabled.
400 Bad RequestInvalid Partner Link IDINVALID_REQUESTHeading parameter x-identifier-type is PARTNER_LINK_ID and the informed identifier (partner_link_id) was not found.
400 Bad RequestInvalid Phone Number FormatINVALID_PHONE_NUMBER_FORMATValid phone number formats include, as examples: (718) 123-4567, (718) 1234567, (718)1234567, 7181234567, 718-123-4567, 718-1234567, and +1 (718) 123-4567.
400 Bad RequestUnable to reserve points for {accountID}. Please contact Customer Service to get more information.FAILED_REDEMPTIONNot able to redeem due to outstanding fraud prevention advice on account.
404 Not FoundCould not start a session associated with the given LoyaltyIDINVALID_LOYALTY_IDHeading parameter x-identifier-type is LOYALTY_ID and the informed identifier (loyalty_id) was not found (either account or card)
404 Not FoundCould not start a session associated with the given Phone Number.INVALID_REQUESTHeading parameter x-identifier-type is PHONE_NUMBER and the informed identifier was not found (either account or card).
500 Unexpected Error OccurredResponse could not be provided for unknown reasonUNKNOWNReport to your administrator with the GUID number in the error message.

Request

Responses

200 - Using Loyalty ID

Response Headers
    Date
    Example: Wed, 07 Aug 2024 07:22:40 GMT
    Content-Length
    Example: 783
    Connection
    Example: keep-alive
    x-amzn-RequestId
    Example: fc30acc6-7da9-4c93-9e02-c3abf22005a1
    Referrer-Policy
    Example: no-referrer
    X-XSS-Protection
    Example: 1;mode=block
    Access-Control-Allow-Origin
    Example: *
    MCK-APPID
    Example: ES-CB-V1
    MCK-MSGID
    Example: mck-c274b010-10b2-44fa-b104-3b56f5298f70
    Expect-CT
    Example: max-age=86400
    Strict-Transport-Security
    Example: max-age=31536000; includeSubDomains; preload
    Feature-Policy
    Example: vibrate 'none'; geolocation 'none'
    X-Frame-Options
    Example: sameorigin
    Content-Security-Policy
    Example: connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.net
    MCK-MSGTIMESTAMP
    Example: August 7th 2024, 7:22:39
    x-amz-apigw-id
    Example: cIIN8FfloAMEQBw=
    cache-control
    Example: no-cache, no-store, must-revalidate
    MCK_CORRELATIONID
    Example: CORRELATION_ID_NOT_PROVIDED_IN_REQUEST
    X-Content-Type-Options
    Example: nosniff
    X-Amzn-Trace-Id
    Example: Root=1-66b320bf-080d9d7f3b858fee2e1ac98e;Parent=481020856d9b4f30;Sampled=0;lineage=bcf9a1b6:0