GET
/
api
/
v2
/
storefront
/
account
/
credit_cards
/
default
curl --request GET \
  --url https://demo.spreecommerce.org/api/v2/storefront/account/credit_cards/default \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "id": "1",
    "type": "credit_card",
    "attributes": {
      "cc_type": "visa",
      "last_digits": "4111",
      "month": 12,
      "year": 2026,
      "name": "John Doe",
      "default": true,
      "gateway_payment_profile_id": "card_1JqvNB2eZvKYlo2C5OlqLV7S"
    },
    "relationships": {
      "payment_method": {
        "data": {
          "id": "1",
          "type": "payment_method"
        }
      }
    }
  },
  "included": [
    {
      "id": "1",
      "type": "payment_method",
      "attributes": {
        "type": "Spree::Gateway::StripeGateway",
        "name": "Stripe",
        "description": "Stripe Payments",
        "preferences": {}
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

User token to authorize Cart and Checkout requests.

It is required to associate Cart with the User.

Query Parameters

include
string

Specify the related resources you would like to receive in the response body. More Information.

fields[credit_card]
string

Specify the fields you would like returned in the response body. More information.

Response

200
application/vnd.api+json
200 Success - Returns the `credit_card` object.
data
object
required
included
object[]