Replace Existing Card
PUT/client/users/:correlation_id/cards
- In its simplest form, this call replaces a known account card with a new digital card. The old card will be invalidated and the new card will have an ACTIVE status.
- If the newLoyaltyId is specified, then the existing card is replace with a new physical (plastic) card using this card number.
- Other than specifying the old card number, the request takes in a status to update the replaced card state. The update status must be one of the 3 end states for cards: DAMAGED, CANCELLED or LOST_OR_STOLEN. If the existing card is being replaced with a physical card, then the newLoyaltyId is specified as well.
- The correlation ID used with the Start Session call will be used to identify the account and the card number to be replaced must be from the same account.
- The card for a ghost or unregistered account may be replaced, but only when the configuration is set to "in transition" (when an initial data migration for a new client is in progress).
Request
Body
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| oldLoyaltyId | Unique identifier of the known card being replaced | Number | |
| status | The reason the known card is being replaced | String. Value is one of: "DAMAGED", "CANCELLED", or "LOST_OR_STOLEN" | Allows reasons for card replacements to be tracked |
| newLoyaltyId | Unique identifier of the new replacement card. | String | Used only if the existing card is being replaced with a physical (plastic) card. |
Response
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| NewLoyaltyCard | Unique identifier of the new (replacement) loyalty card | Number | |
| Message | The reason the known card is being replaced | String. Value is one of: "Card updated." | Provides status of replacement process |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Error: Card replacement is not allowed as the user account is not Active | INVALID_REQUEST | Card replacement cannot occur on an account that is not Active |
| 400 Bad Request | Card replacement is not allowed as the user account is suspended | INVALID_REQUEST | Card replacement is cannot occur on a suspended account |
| 400 Bad Request | LoyaltyId specified is not associated with this Account | INVALID_REQUEST | Loyalty ID referenced is not associated with the account |
| 400 Bad Request | Cannot change the status of a Cancelled card | INVALID_REQUEST | Status of a Cancelled card can not be changed through this request |
| 400 Bad Request | Cannot change the status of a Damaged card | INVALID_REQUEST | Status of a Damaged card can not be changed through this request |
| 400 Bad Request | Cannot change the status of a Lost or Stolen card | INVALID_REQUEST | Status of a Lost or Stolen card can not be changed through this request |
| 400 Bad Request | Invalid status specified for card replacement! | INVALID_REQUEST | A valid status has not been provided as part of the card replacement process |
| 400 Bad Request | Card Replacement limit exceeded! Cannot replace card more than twice a month. | INVALID_REQUEST | Card can be replace a maximum of two times within the span of a month |
| 401 Unauthorized | Account status is CLOSED. | API_VALIDATION | Cannot replace card for an account that is CLOSED. |
Request
Responses
- 200
- 400
- 401
200 - Replace Existing Card with Digital Card
Response Headers
Date
Example:
Thu, 21 May 2020 14:16:45 GMTContent-Length
Example:
66Connection
Example:
keep-alivex-amzn-RequestId
Example:
005d5b5f-c300-42d3-8894-0c1e9050a2fcReferrer-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=31536000Feature-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:
M4sEHGwAIAMFhJg=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-5ec68d4d-de23eb6fad2e8610946e1fbb;Sampled=0400 - Card Replacement Not Allowed on Inactive Account
Response Headers
Date
Example:
Thu, 21 May 2020 14:16:45 GMTContent-Length
Example:
66Connection
Example:
keep-alivex-amzn-RequestId
Example:
005d5b5f-c300-42d3-8894-0c1e9050a2fcReferrer-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=31536000Feature-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:
M4sEHGwAIAMFhJg=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-5ec68d4d-de23eb6fad2e8610946e1fbb;Sampled=0401 - 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==