Skip to main content

Add Card(s) to Account

POST 

/client/users/:correlation_id/cards

Release: ES Loyalty 3.0

This request is used to add cards, physical and/or digital, to an account as active cards. Note:

  • There can be multiple active cards, but only one primary card, which is not set in this request.

  • There is a limit on the number of cards that can be added to an account, so if the request causes this limit to be exceeded, an error will result.

  • Either digital or physical active cards can be added in a request, but not both types in one request.

Request

Body

AttributeDefinitionFormatNotes
physicalCardsProvides details of physical cards being addedArrayRequired for physical cards added only
quantitySpecifies number of digital cards being addedNumberRequired for digital cards added only
loyaltyIdUnique identifier for the loyalty card numberNumberRequired
cardLabelText/number label to help identify the cardStringOptional attribute
isDefaultSpecifies whether the card added is the new default card.Boolean: Enum: "true" or "false"Optional
extendedDataAdditional information attached to the cardObjectContains attribute:value pairs that provide further information for the card. Optional.

Response

AttributeDefinitionFormatNotes
successListThe card numbers of cards that were successfully added to the accountArray
errorListThe card numbers of cards that failed to be added to the account.Array
errorMessageA message to indicate what caused the error in adding that card.String

Error Responses

statusCodeerrorMessageerrorCodeDefinition
400 Bad RequestAt least one card should be requested.INVALID_REQUESTA valid request to add a digital card has an attribute value of "0".
400 Bad RequestInvalid loyaltyIdINVALID_REQUESTA valid request to add a physical card has an empty loyaltyID attribute value.
400 Bad RequestAccount status is set to "CLOSED" or "DECEASED".INVALID_REQUESTMember's account has a status of "CLOSED" or "DECEASED".
400 Bad RequestMember's account not registered.INVALID_REQUESTMember's account is not registered.
400 Bad RequestMaximum number of cards exceeded.INVALID_REQUESTNumber of cards requested exceeds the maximum number of cards allowed on the account.
400 Bad RequestDigital cards not enabled.INVALID_REQUESTMember chooses digital card and digitalCard.Enabled = false in ConfigType = 'REGISTRATION'.
401 UnauthorizedAccount status is CLOSED.API_VALIDATIONCannot add card(s) to a closed account.

Request

Responses

200 - Cards Added or Errors