Skip to main content
POST
/
customers
/
{id}
/
payment_methods
Attach Payment Method to Customer
curl --request POST \
  --url https://sandbox.api.hixbe.com/payment/customers/{id}/payment_methods \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Hixbe-Version: <hixbe-version>' \
  --data '
{
  "payment_method": "pm_card_123",
  "set_default": true
}
'
{
  "id": "cus_123",
  "email": "jsmith@example.com",
  "name": "<string>",
  "phone": "<string>",
  "metadata": {},
  "default_payment_method": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Use your secret API key. Example: Authorization: Bearer sk_test_xxx

Headers

Hixbe-Version
string
default:2026-01-01
required

API version header. Use '2026-01-01' for the latest version.

Path Parameters

id
string
required

Body

application/json
payment_method
string
required
set_default
boolean

Response

Customer updated

id
string
required
Example:

"cus_123"

email
string<email>
name
string
phone
string
metadata
object
default_payment_method
string | null
created_at
string<date-time>