default_payment_method

Description

The default payment method for a customer. When completing a transaction through the API, this is the payment method that will be used. To set a new payment card, modify cc_number, though it won't be displayed as part of the resource.

Note: some of the functionality related to the customer payment method are still being developed and reorganized. Currently only a payment card can be saved and not an alternative payment method.

Sandbox Example

You can interact with this resource and run actions against the sandbox API via our HAL Brower.

Actions

GET
View a default_payment_method
PATCH
Update a default_payment_method (send only the properties you want to modify)
PUT
Replace a default_payment_method (send the entire representation)
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
save_cc If the customer selected to save their payment information, this will be true. To clear out the payment information, set this to false. Boolean true or false, 1 or 0.
cc_type The credit card or debit card type. This will be determined automatically once the payment card is saved. String Read only
cc_number The payment card number. This property will not be displayed as part of this resource, but can be used to modify this payment method. Integer Must be a valid payment card number.
cc_number_masked A masked version of this payment card showing only the last 4 digits. String Read only
cc_exp_month The payment card expiration month in the MM format. String Must be a valid month from 01 to 12
cc_exp_year The payment card expiration year in the YYYY format. String Must be a valid 4 digit year
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api.foxycart.com/customers/8/default_payment_method",
            "title": "Default Payment Method"
        },
        "fx:store": {
            "href": "https://api.foxycart.com/stores/8",
            "title": "This Store"
        },
        "fx:customer": {
            "href": "https://api.foxycart.com/customers/8",
            "title": "This Customer"
        }
    },
    "save_cc": 1,
    "cc_type": "Visa",
    "cc_number_masked": "xxxxxxxxxxxx1111",
    "cc_exp_month": "12",
    "cc_exp_year": "2020",
    "date_created": "2009-02-10T21:41:51-0800",
    "date_modified": "2013-08-17T17:40:22-0700"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/customers/8/default_payment_method" rel="https://api.foxycart.com/rels/default_payment_method">
  <link rel="self" href="https://api.foxycart.com/customers/8/default_payment_method" title="Default Payment Method"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api.foxycart.com/stores/8" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/customer" href="https://api.foxycart.com/customers/8" title="This Customer"/>
  <save_cc>1</save_cc>
  <cc_type>Visa</cc_type>
  <cc_number_masked>xxxxxxxxxxxx1111</cc_number_masked>
  <cc_exp_month>12</cc_exp_month>
  <cc_exp_year>2020</cc_exp_year>
  <date_created>2009-02-10T21:41:51-0800</date_created>
  <date_modified>2013-08-17T17:40:22-0700</date_modified>
</resource>
{
    "class": [
        "default_payment_method"
    ],
    "properties": {
        "save_cc": 1,
        "cc_type": "Visa",
        "cc_number_masked": "xxxxxxxxxxxx1111",
        "cc_exp_month": "12",
        "cc_exp_year": "2020",
        "date_created": "2009-02-10T21:41:51-0800",
        "date_modified": "2013-08-17T18:41:07-0700"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/customers/8/default_payment_method"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api.foxycart.com/stores/8"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/customer"
            ],
            "href": "https://api.foxycart.com/customers/8"
        }
    ]
}

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.