Skip to content
Dashboard

Payment Flow

The recommended integration is server-side session creation plus hosted checkout.

1. Customer starts checkout
Your website or app collects cart/order details.
2. Your backend creates a session
Your backend calls HesabPay with your API key and order payload.
3. HesabPay returns a payment URL
Your backend returns the URL to your frontend or redirects the customer directly.
4. Customer pays on hosted checkout
The customer selects HesabPay wallet, AfPay card, or international card if enabled.
5. Customer is redirected
HesabPay sends the customer to your success or failure URL.
6. Your backend receives webhook
Use webhooks as the reliable source of payment status.

Hosted checkout keeps sensitive payment handling inside the payment gateway experience and gives customers a consistent payment page across devices.

Redirects are useful for customer experience, but a customer browser can close or lose network connectivity. Use webhooks to update orders, deliver products, or mark invoices paid.