direct_url that sends your customer straight to the chosen payment provider — K-Net or Credit Card — without an intermediate step. Choose this integration method when you want to present payment options in your own UI and route customers based on their selection.
When to Use Direct Integration
Use Direct Integration when:- You have a custom-designed checkout that already shows K-Net and Credit Card as separate buttons
- You want to eliminate the intermediate Payzah-hosted page from the redirect chain
- You need independent control over which payment methods are available at specific points in your flow
Direct Integration does not support Apple Pay. If you need Apple Pay, use the Transit Payment Page with
payment_type: "3" instead.How Direct Integration Works
1
Choose the Correct payment_type for Your Method
Direct Integration uses two distinct
payment_type values — one for K-Net and one for Credit Card. Select the value that matches the payment method your customer chose on your checkout page.You must set this value dynamically based on your customer’s selection before you send the initialization request.
2
Send the Initialization Request
From your server, send a
POST request to the Payzah initialization endpoint with the appropriate payment_type. The request structure is identical to the Transit integration — only the payment_type value changes.EndpointsHeaders
The tabs below show sample request bodies for each payment method:
- K-Net (payment_type 1)
- Credit Card (payment_type 2)
3
Read the direct_url from the Response
A successful initialization response returns The Comparing Transit and Direct response URLs
status: true with a populated direct_url field. The transit_url field will be empty — this is the opposite of what you see with Transit Integration.Success Response
direct_url already contains the PaymentID as a query parameter, pointing directly to the payment provider’s page. Store the PaymentID value from data.PaymentID before redirecting, so you can reconcile the callback with your order.If
status is false, do not redirect the customer. Display a user-friendly error, log the response details, and allow them to retry. Never redirect to a URL from a failed response.4
Redirect Your Customer to the direct_url
Redirect your customer’s browser to the The redirect URL follows this pattern:
direct_url returned in the response. They will land directly on the K-Net or Credit Card payment provider’s page.PHP Redirect
Express.js Redirect
5
Handle the Success and Error Redirects
Once your customer completes or abandons payment on the provider’s page, Payzah redirects them back to your
success_url or error_url with the transaction result appended as query parameters.Payment response fieldspaymentStatus valuesRequest Field Reference
Use this table when constructing your initialization request body for Direct Integration.Although
payment_type is technically optional, you should always supply it explicitly ("1" for K-Net or "2" for Credit Card) when using Direct Integration to ensure the correct provider page is returned in direct_url.
