VietBilling

Checkout & Payments

Checkout được tạo từ một request idempotent.

Tạo checkout thanh toán bảo mật từ request idempotent. Xử lý timeout an toàn, đối soát trạng thái qua Checkout ID và bảo vệ chống trùng lặp đơn hàng.

Bắt đầu miễn phí

Kết quả

Retry cùng idempotency key không tạo thêm một Order logic mới.

01

Gửi checkout request

Backend gửi customer, price và redirect URL.

02

Chuyển tới checkout

Ứng dụng dùng checkout_url trong response.

03

Đối soát

Poll session khi request timeout hoặc trạng thái còn creating.

Tích hợp từ backend

API key là secret của server. Không đặt key trong browser hoặc mobile app.

curl -X POST "$BASE_URL/checkouts" \
  -H "Authorization: Bearer vb_live_..." \
  -H "Idempotency-Key: checkout_order_123" \
  -H "Content-Type: application/json" \
  -d '{"customer_id":"CUSTOMER_UUID","product_id":"PRODUCT_UUID","success_url":"https://app.example/success","cancel_url":"https://app.example/cancel"}'

FAQ

Nếu request timeout thì sao?

Poll Checkout hoặc retry cùng idempotency key; không tạo key mới cho cùng intent.

Checkout có thể tạo Customer không?

Có. Truyền external customer ID và email khi chưa có customer_id.