updateCreditCard
put
/ccagent/v1/profiles/{id}/creditCards/{cardId}
Updates the credit card information for the id, passed in as query parameter, by searching the credit cards associated with the given shopper profile and its organization. Currently, only setAsDefault and nickname fields are allowed to be updated for the saved cards.
Request
Supported Media Types
- application/json
Path Parameters
-
cardId: string
The id of the credit card, that needs to be searched, in the given shopper profile and its organization.
-
id: string
User profile id
Header Parameters
-
X-CCAsset-Language(optional): string
The asset language of the request.
Root Schema : updateCreditCard_request
Type:
Show Source
object
-
additionalInfo(optional):
string
This field is a custom property which stores any pretext specific to the card. The length of this property must be less than or equal to 2000 characters
-
nickname(optional):
string
The nick name for the credit card.
-
setAsDefault(optional):
boolean
The flag to determine whether the card needs to be set as default card for the profile.
Example:
{
"nickname":"Home Card 2",
"additionalInfo":"Card has been synced with id 10001",
"setAsDefault":true
}
Response
Supported Media Types
- application/json
200 Response
Following model is returned when the operation succeeds.
Root Schema : updateCreditCard_response
Type:
Show Source
object
-
additionalInfo(optional):
string
This field is a custom property which stores any pretext specific to the card.
-
cardNumber(optional):
string
The masked card number.
-
cardType(optional):
string
The type of the card.
-
expiryMonth(optional):
string
The expiry month for the card. Value lies between 01-12.
-
expiryYear(optional):
string
The expiry year for the card.
-
hasExpired(optional):
boolean
The flag that indicates if the card can be used or has it expired.
-
iin(optional):
string
The issuer identification number for the card.
-
isDefault(optional):
boolean
The flag that indicates if the card is the default card of the shopper.
-
nameOnCard(optional):
string
The name on the card.
-
nickname(optional):
string
The nick name for the card.
-
repositoryId(optional):
string
The repository id for the card.
-
savedCardId(optional):
string
The card id for the saved credit card.
Example Response (application/json)
{
"expiryMonth":"03",
"cardType":"visa",
"expiryYear":"2021",
"iin":"411111",
"savedCardId":"usercc10002",
"hasExpired":false,
"isDefault":true,
"nameOnCard":"card2",
"repositoryId":"usercc10002",
"nickname":"Home Card 2",
"additionalInfo":"Card has been synced with id 10002",
"links":[
{
"rel":"self",
"href":"http://localhost:8080/ccstoreui/v1/profiles/{id}/creditCards/usercc10002"
}
],
"cardNumber":"xxxxxxxxxxxx1111"
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commercer Cloud:
|Error Code|Description|
|------------------|------------------|
|28388|Unable to find credit card for the card id {cardId}.|
|28395|User is not authorized to update the credit card with card id {cardId}.|
|28392|An error occured while trying to update the credit card with card id {cardId}.|
|28391|An error occurred while processing the credit card.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code