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": "1111",
"month": 12,
"year": 2026,
"name": "John Doe",
"gateway_payment_profile_id": "card_1JqvNB2eZvKYlo2C5OlqLV7S",
"default": true
},
"relationships": {
"payment_method": {
"data": {
"id": "<string>",
"type": "<string>"
}
}
}
},
"included": [
{
"id": "1",
"type": "payment_method",
"attributes": {
"type": "Spree::Gateway::StripeGateway",
"name": "Stripe",
"description": "Stripe Payments",
"preferences": {}
}
}
]
}Returns the current user’s default credit card.
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": "1111",
"month": 12,
"year": 2026,
"name": "John Doe",
"gateway_payment_profile_id": "card_1JqvNB2eZvKYlo2C5OlqLV7S",
"default": true
},
"relationships": {
"payment_method": {
"data": {
"id": "<string>",
"type": "<string>"
}
}
}
},
"included": [
{
"id": "1",
"type": "payment_method",
"attributes": {
"type": "Spree::Gateway::StripeGateway",
"name": "Stripe",
"description": "Stripe Payments",
"preferences": {}
}
}
]
}User token to authorize Cart and Checkout requests.
It is required to associate Cart with the User.
Specify the related resources you would like to receive in the response body. More Information.
Specify the fields you would like returned in the response body. More information.
200 Success - Returns the credit_card object.
Show child attributes
"1"
"credit_card"
Show child attributes
visa, mastercard, amex "visa"
Last 4 digits of CC number
"1111"
Expiration date month
12
Expiration date year
2026
Card holder name
"John Doe"
ID of a gateway's payment method
"card_1JqvNB2eZvKYlo2C5OlqLV7S"
Defines if this is the default CC for a signed in user
true
Show child attributes
"1"
Was this page helpful?