Skip to main content
GET
/
api
/
v1
/
customer
/
saved-payments
Get Saved Payment Methods
curl --request GET \
  --url https://api.cravejs.com/api/v1/customer/saved-payments \
  --header 'X-API-Key: <api-key>'
[
  {
    "id": "pm_1234567890abcdef",
    "object": "payment_method",
    "type": "card",
    "card": {
      "brand": "visa",
      "last4": "4242",
      "exp_month": 12,
      "exp_year": 2025,
      "funding": "credit",
      "country": "US"
    },
    "created": 1634567890,
    "customer": "cus_authenticated_customer_id"
  },
  {
    "id": "pm_0987654321fedcba",
    "object": "payment_method",
    "type": "card",
    "card": {
      "brand": "mastercard",
      "last4": "1234",
      "exp_month": 8,
      "exp_year": 2026,
      "funding": "debit",
      "country": "US"
    },
    "created": 1634567800,
    "customer": "cus_authenticated_customer_id"
  }
]

Headers

Authorization
string
required
Bearer token from OTP verification
Format: Bearer {jwt_token}
X-API-Key
string
required
Storefront API key for authentication
[
  {
    "id": "pm_1234567890abcdef",
    "object": "payment_method",
    "type": "card",
    "card": {
      "brand": "visa",
      "last4": "4242",
      "exp_month": 12,
      "exp_year": 2025,
      "funding": "credit",
      "country": "US"
    },
    "created": 1634567890,
    "customer": "cus_authenticated_customer_id"
  },
  {
    "id": "pm_0987654321fedcba",
    "object": "payment_method",
    "type": "card",
    "card": {
      "brand": "mastercard",
      "last4": "1234",
      "exp_month": 8,
      "exp_year": 2026,
      "funding": "debit",
      "country": "US"
    },
    "created": 1634567800,
    "customer": "cus_authenticated_customer_id"
  }
]
This endpoint returns an array of Stripe payment methods that have been saved for the authenticated customer. Returns an empty array [] if no payment methods are saved. Payment methods are automatically saved when customers opt to save their payment information during checkout.

Authorizations

X-API-Key
string
header
required

Response

Payment methods retrieved successfully.

Array of saved payment methods. Returns empty array if no payment methods are saved.

id
string

Stripe payment method ID

object
string

Object type (always 'payment_method')

type
string

Payment method type (e.g., 'card')

card
object
created
integer

Unix timestamp of when the payment method was created

customer
string

Stripe customer ID