Skip to content
myela

The card charged when a request names none, including a scheduled invoice.

Set default card

POST/v1/payment_methods/{payment_method_id}/defaultLink

The card charged when a request names none, including a scheduled invoice.

SandboxSecret keypaymentMethods.setDefault

Request fields

Edit a field and the generated request updates immediately.

Path parameters
stringrequired

The reusable identifier of a stored payment method.

Response contract

The successful wire shape and errors an integration should branch on.

200

Payment method

application/json
idstringrequired
Unique payment-method identifier.
object"payment_method"required
Stable resource discriminator.
customerIdstringrequired
Customer that owns this method.
brandstringrequired
Card brand.
last4stringrequired
Last four digits only.
expMonthintegerrequired
Expiration month.
expYearintegerrequired
Four-digit expiration year.
isDefaultbooleanrequired
Whether this is the customer default.
createdAtstringrequired
ISO 8601 creation timestamp.
Example response
{
  "id": "pm_01JEXAMPLE",
  "object": "payment_method",
  "customerId": "cus_01JEXAMPLE",
  "brand": "visa",
  "last4": "4242",
  "expMonth": 12,
  "expYear": 2030,
  "isDefault": true,
  "createdAt": "2026-08-10T20:49:51.653Z"
}
Error responses
401authentication_failed

The key is missing, malformed, revoked, or invalid for this environment.

403permission_denied

The key does not have paymentMethods.setDefault.

404not_found

The resource does not exist for this merchant.

422invalid_request

One or more request fields are invalid.