Welcome‎ > ‎Version 2‎ > ‎Publisher Api (Read/Write)‎ > ‎Methods‎ > ‎3 - Consumer‎ > ‎

Get Credit Cards

This method will return a list of credit cards previously used by the consumer.

Method: /api/v2/consumer/{userKey}/creditcards
Authentication: oauth

Required Parameters:
  userKey - The publisher assigned userKey for the consumer.

Optional Parameters:
  none

Returns:
  Returns List of Credit Cards

Sample Request:
GET /api/v2/consumer/5509477/creditcards HTTP/1.1

Authorization: OAuth oauth_signature="nyEr2evVPjGmqFgHEMaGHdWm0y4%3d", oauth_nonce="7350323", oauth_timestamp="1303151819", oauth_consumer_key="43c5c674-620c-4f2b-bdcf-3082c99e8186", oauth_signature_method="HMAC-SHA1", oauth_version="1.0"
Host: apitest.groupcommerce.com

Sample XML Response:
<creditcards xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <version>2.0</version>
    <success>true</success>
    <lastPublished>2011-02-16T23:14:03.3556636Z</lastPublished>
    <data>
        <creditcard>
            <expiration>2011-01</expiration>
            <maskedCardNumber>XXXX1111</maskedCardNumber>
            <storedCreditCardId>2125587</storedCreditCardId>
            <type>MasterCard</type>
        </creditcard>
        <creditcard>
            <expiration>2014-11</expiration>
            <maskedCardNumber>XXXX1111</maskedCardNumber>
            <storedCreditCardId>2198146</storedCreditCardId>
            <type>Visa</type>
        </creditcard>
    </data>
    <metaData>
        <pageCount>1</pageCount>
        <pageNumber>1</pageNumber>
        <pageSize>2</pageSize>
        <totalItems>2</totalItems>
    </metaData>
</creditcards>


Sample JSON Response:
{
    "version": "2.0",
    "success": true,
    "lastPublished": "\/Date(1303151478985)\/",
    "data": [
        {
            "expiration": "2011-01",
            "maskedCardNumber": "XXXX1111",
            "storedCreditCardId": "2329470",
            "type": "Visa"
        },
        {
            "expiration": "2012-02",
            "maskedCardNumber": "XXXX1111",
            "storedCreditCardId": "2741327",
            "type": "Visa"
        }
    ],
    "metaData": {
        "pageCount": 1,
        "pageNumber": 1,
        "pageSize": 2,
        "totalItems": 2
    }
}
Comments