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
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| physicalCards | Provides details of physical cards being added | Array | Required for physical cards added only |
| quantity | Specifies number of digital cards being added | Number | Required for digital cards added only |
| loyaltyId | Unique identifier for the loyalty card number | Number | Required |
| cardLabel | Text/number label to help identify the card | String | Optional attribute |
| isDefault | Specifies whether the card added is the new default card. | Boolean: Enum: "true" or "false" | Optional |
| extendedData | Additional information attached to the card | Object | Contains attribute:value pairs that provide further information for the card. Optional. |
Response
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| successList | The card numbers of cards that were successfully added to the account | Array | |
| errorList | The card numbers of cards that failed to be added to the account. | Array | |
| errorMessage | A message to indicate what caused the error in adding that card. | String |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | At least one card should be requested. | INVALID_REQUEST | A valid request to add a digital card has an attribute value of "0". |
| 400 Bad Request | Invalid loyaltyId | INVALID_REQUEST | A valid request to add a physical card has an empty loyaltyID attribute value. |
| 400 Bad Request | Account status is set to "CLOSED" or "DECEASED". | INVALID_REQUEST | Member's account has a status of "CLOSED" or "DECEASED". |
| 400 Bad Request | Member's account not registered. | INVALID_REQUEST | Member's account is not registered. |
| 400 Bad Request | Maximum number of cards exceeded. | INVALID_REQUEST | Number of cards requested exceeds the maximum number of cards allowed on the account. |
| 400 Bad Request | Digital cards not enabled. | INVALID_REQUEST | Member chooses digital card and digitalCard.Enabled = false in ConfigType = 'REGISTRATION'. |
| 401 Unauthorized | Account status is CLOSED. | API_VALIDATION | Cannot add card(s) to a closed account. |
Request
Responses
- 200
- 400
- 401
200 - Cards Added or Errors
400 - Invalid loyaltyId
401 - Account Status is Closed
Response Headers
Content-Length
Example:
39Connection
Example:
keep-aliveDate
Example:
Thu, 29 Sep 2022 14:43:05 GMTx-amzn-RequestId
Example:
30ba166d-da0e-4d92-b570-054040ec06c2Referrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*MCK-APPID
Example:
ES-CS-V1MCK-MSGID
Example:
mck-920b9070-8b11-47d5-a26a-641a81e84737Expect-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.netMCK-MSGTIMESTAMP
Example:
September 29th 2022, 2:43:04x-amz-apigw-id
Example:
ZOhGxEnsIAMFpJg=Cache-Control
Example:
no-cache, no-store, must-revalidateMCK_CORRELATIONID
Example:
CORRELATION_ID_NOT_PROVIDED_IN_REQUESTX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-6335aef7-5dcacca052d1282852cc708e;Sampled=0X-Cache
Example:
Miss from cloudfrontVia
Example:
1.1 fff6a70a81914898c2756daea39344e8.cloudfront.net (CloudFront)X-Amz-Cf-Pop
Example:
IAD79-C2X-Amz-Cf-Id
Example:
vSUeUi6yzsps0TIwLEJ0wE3aCHaTGa1Kzz-eKFCk380BFTjext7d9Q==