VietBilling

Customers

One customer ID connects your user to the billing lifecycle.

Create a customer once, save the ID in your application database, and reuse it for later checkouts.

Start for free

Outcome

The same user is not duplicated merely because a request is retried.

01

Map the user

Use your internal user ID in a stable idempotency key.

02

Create customer

Send name, email, and necessary metadata from your backend.

03

Store customer_id

Use the returned ID for every checkout by that user.

Integrate from your backend

API keys are server secrets. Never expose them in browser or mobile code.

curl -X POST "$BASE_URL/customers" \
  -H "Authorization: Bearer vb_live_..." \
  -H "Idempotency-Key: customer_user_123" \
  -H "Content-Type: application/json" \
  -d '{"name":"Nguyen Van A","email":"[email protected]"}'

FAQ

Should I create a customer for every checkout?

No. Create it once and keep customer_id in your application database.

Can a retry create duplicates?

An identical request with the same idempotency key returns the original customer.