Welcome‎ > ‎Version 3‎ > ‎Publisher Api‎ > ‎Methods‎ > ‎2 - Consumer Related‎ > ‎Credit Card Management‎ > ‎

Add Credit Card

This method will store a credit card in the system.

Method: POST /api/v3/publisher/consumer/{userKey}/creditcard

Authentication: oauth
 
Post
Required Form Name Data Type Explanation
YesUserKeystringThe user key of the consumer who owns the credit card.
No
AddCreditCardInformation.
    BillingAddress
string The consumer's billing address.
No
AddCreditCardInformation.
    BillingAddress2
string The optional second line of the consumer's billing address.
No AddCreditCardInformation.
    BillingCity
string The consumer's billing city.
No AddCreditCardInformation.
    BillingCountry
string The consumer's billing country.
No AddCreditCardInformation.
    BillingPhone
string The consumer's billing phone number.
No AddCreditCardInformation.
    BillingState
string
The consumer's billing state.
No AddCreditCardInformation.
    BillingZip
string The consumer's billing zip code.
Yes
AddCreditCardInformation.
    CardNumber
string
The consumer's credit card number.
Yes
AddCreditCardInformation.
    CVV
string The consumer's card verification value (aka security code).
Yes
AddCreditCardInformation.
    ExpirationMonth
int16 The credit card expiration month.
YesAddCreditCardInformation.
    ExpirationYear
int16The credit card expiration year.
YesAddCreditCardInformation.
    NameOnCard
stringThe name on the consumer's credit card.
NoAddCreditCardInformation.
    PaymentType
stringThe credit card type.  Currently accepted values: {Unknown, HouseAccount, MasterCard, Visa, Amex, Discover, DinersClub, JCB, enRoute}

Returns
base response fields
storedCreditCardId - The id of the credit card that was added to the system.


Sample Request:

POST http://api.groupcommerce.com/api/v3/publisher/consumer/3c651ac9e6054d72b9b938f782790c8c/creditcard

Form:
AddCreditCardInformation.NameOnCard=G+Commerce&AddCreditCardInformation.CardNumber=4111111111111111&AddCreditCardInformation.PaymentType=Unknown&AddCreditCardInformation.CVV=111&AddCreditCardInformation.ExpirationMonth=1&AddCreditCardInformation.ExpirationYear=2015&AddCreditCardInformation.BillingAddress=24138+Hazelmere&AddCreditCardInformation.BillingCity=Mayfield&AddCreditCardInformation.BillingState=NY&AddCreditCardInformation.BillingZip=14853&AddCreditCardInformation.BillingCountry=US&UserKey=3c651ac9e6054d72b9b938f782790c8c

Authorization: OAuth oauth_signature="ebngfWWPqy%2fUbLwtunTp6tCiMoU%3d", oauth_nonce="973816", oauth_timestamp="1322683492", oauth_consumer_key="eeb6b959-b854-4ad1-b563-e801c83cf81d", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"


Sample JSON Response:

{
    "errors": [],
    "lastPublished": "/Date(1322683497944)/",
    "success": true,
    "version": "3",
    "storedCreditCardId": "5030078"
}


Sample XML Response:

<addCreditCardResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <errors/>
    <lastPublished>2011-11-30T20:07:30.1819056Z</lastPublished>
    <success>true</success>
    <version>3</version>
    <storedCreditCardId>5030084</storedCreditCardId>
</addCreditCardResponse>
Comments