v1

latestOpenAPI 3.0.02026-07-24103118224.7 KB
Customer

Set a payment method as the default for its currency

Marks the specified payment method as the default for its currency (EUR or USD). Any previously default payment method for the same currency on this customer is automatically unset. Returns the updated payment method with isDefault: true.

patch/api/customer/{customerId}/payment-methods/{paymentMethodId}/set-default

Path parameters

customerIdstring required
Example:cus_abc123

Unique identifier of the customer (e.g. cus_abc123)

paymentMethodIdstring required
Example:cpm_xyz789

Unique identifier of the payment method to set as default (e.g. cpm_xyz789)

Response

The payment method has been set as default for its currency. Returns the updated payment method.

idstring required

Unique ID of the setup request.

statusstring required

Current status of the setup request (pending, completed, failed, requires_3ds).

currencystring required

Currency of the setup request (EUR or USD).

createdAtstring date-time required

When the request was created.

updatedAtstring date-time required

When the request was last updated.

completedAtstring date-time nullable required

When the request completed (success or failure), or null.

errorCodestring nullable required

Error code if the request failed, or null.

errorMessagestring nullable required

Error message if the request failed, or null.

paymentMethodIdstring nullable required

ID of the payment method created by this request, or null if not yet completed.

Example response

{
  "id": "setup_pm_req_abc123",
  "status": "completed",
  "currency": "EUR",
  "paymentMethodId": "cpm_xyz789"
}