POST
/api/public/v1/billing/payment-methods/set-default

Set default payment method

Change which payment method is used as the default for charges.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

billing:write

Request Body

PropertyTypeDescription
paymentMethodIdstringStripe payment method ID.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/billing/payment-methods/set-default" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentMethodId": "pm_123"
  }'
200Example response
json
{
  "message": "Default payment method updated successfully!",
  "content": {
    "defaultPaymentMethodId": "pm_123"
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Billing
/billing
  1. Open the ⋯ menu beside a card → Set as default.