Skip to main content

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

AttributeDefinitionFormatNotes
oldLoyaltyIdUnique identifier of the known card being replacedNumber
statusThe reason the known card is being replacedString. Value is one of: "DAMAGED", "CANCELLED", or "LOST_OR_STOLEN"Allows reasons for card replacements to be tracked
newLoyaltyIdUnique identifier of the new replacement card.StringUsed only if the existing card is being replaced with a physical (plastic) card.

Response

AttributeDefinitionFormatNotes
NewLoyaltyCardUnique identifier of the new (replacement) loyalty cardNumber
MessageThe reason the known card is being replacedString. Value is one of: "Card updated."Provides status of replacement process

Error Responses

statusCodeerrorMessageerrorCodeDefinition
400 Bad RequestError: Card replacement is not allowed as the user account is not ActiveINVALID_REQUESTCard replacement cannot occur on an account that is not Active
400 Bad RequestCard replacement is not allowed as the user account is suspendedINVALID_REQUESTCard replacement is cannot occur on a suspended account
400 Bad RequestLoyaltyId specified is not associated with this AccountINVALID_REQUESTLoyalty ID referenced is not associated with the account
400 Bad RequestCannot change the status of a Cancelled cardINVALID_REQUESTStatus of a Cancelled card can not be changed through this request
400 Bad RequestCannot change the status of a Damaged cardINVALID_REQUESTStatus of a Damaged card can not be changed through this request
400 Bad RequestCannot change the status of a Lost or Stolen cardINVALID_REQUESTStatus of a Lost or Stolen card can not be changed through this request
400 Bad RequestInvalid status specified for card replacement!INVALID_REQUESTA valid status has not been provided as part of the card replacement process
400 Bad RequestCard Replacement limit exceeded! Cannot replace card more than twice a month.INVALID_REQUESTCard can be replace a maximum of two times within the span of a month
401 UnauthorizedAccount status is CLOSED.API_VALIDATIONCannot replace card for an account that is CLOSED.

Request

Responses

200 - Replace Existing Card with Digital Card

Response Headers
    Date
    Example: Thu, 21 May 2020 14:16:45 GMT
    Content-Length
    Example: 66
    Connection
    Example: keep-alive
    x-amzn-RequestId
    Example: 005d5b5f-c300-42d3-8894-0c1e9050a2fc
    Referrer-Policy
    Example: no-referrer
    X-XSS-Protection
    Example: 1;mode=block
    Access-Control-Allow-Origin
    Example: *
    Expect-CT
    Example: max-age=86400
    Strict-Transport-Security
    Example: max-age=31536000
    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
    x-amz-apigw-id
    Example: M4sEHGwAIAMFhJg=
    cache-control
    Example: no-cache, no-store, must-revalidate
    X-Content-Type-Options
    Example: nosniff
    X-Amzn-Trace-Id
    Example: Root=1-5ec68d4d-de23eb6fad2e8610946e1fbb;Sampled=0