addCreditCard

post

/ccagent/v1/profiles/{id}/creditCards

Add credit card for the shopper. The credit card data is tokenised and is stored against the profile.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
Root Schema : addCreditCard_request
Type: object
Show Source
Example:
{
    "cardCVV":"123",
    "customProperties":{
        "prop2":"value2",
        "prop1":"value1"
    },
    "nameOnCard":"card2",
    "expiryMonth":"03",
    "cardType":"visa",
    "nickname":"visa - 1111",
    "expiryYear":"2021",
    "billingAddress":{
        "lastName":"Anderson",
        "country":"US",
        "address2":"",
        "city":"Syracuse",
        "address1":"21 Cedar Ave",
        "postalCode":"13202",
        "county":"",
        "selectedCountry":"US",
        "firstName":"Kim",
        "phoneNumber":"212-555-1977",
        "state":"New York",
        "selectedState":"NY",
        "email":"kim@example.com",
        "state_ISOCode":"US-NY"
    },
    "cardNumber":"4123567812341111",
    "setAsDefault":true
}
Nested Schema : billingAddress
Type: object
The billing address details.
Show Source
Nested Schema : customProperties
Type: object
Custom object with dynamic properties. This will be passed to the webhook request
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when the operation succeeds.
Body ()
Root Schema : addCreditCard_response
Type: object
Show Source
Nested Schema : customPaymentProperties
Type: object
The set of properties returned by the generic payment webhook.
Example Response (application/json)
{
    "savedCardId":"usercc10002",
    "hasExpired":false,
    "isDefault":true,
    "customPaymentProperties":{
        "addl-prop4":"addl-prop4",
        "addl-prop3":"addl-prop3",
        "addl-prop1":"addl-prop1",
        "decision":null,
        "reasonCode":null
    },
    "nameOnCard":"card2",
    "expiryMonth":"03",
    "cardType":"visa",
    "nickname":"Home Card 2",
    "links":[
        {
            "rel":"self",
            "href":"http://localhost:9080/ccagentui/v1/profiles/se-570031/creditCards"
        }
    ],
    "expiryYear":"2021",
    "cardNumber":"xxxxxxxxxxxx1111",
    "iin":"411111"
}

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| |------------------|------------------| |28396|Provided card details are incorrect.| |28397|An error occured while trying to add the credit card.| |28398|Tokenisation declined by payment gateway. Error message sent by the gateway will be returned.
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top