Skip to main content
Direct Integration gives you precise control over which payment method your customer uses. Instead of routing through Payzah’s hosted Transit Payment Page, Payzah returns a 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
Your private key must never appear in client-side code, front-end JavaScript, or mobile app binaries. Always make this request from your backend server.
The tabs below show sample request bodies for each payment method:
3

Read the direct_url from the Response

A successful initialization response returns 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
The 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.
Comparing Transit and Direct response URLs
4

Redirect Your Customer to the direct_url

Redirect your customer’s browser to the 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
The redirect URL follows this pattern:
In production, the domain changes but the path and query string format remain the same. Always use the direct_url value from the response rather than constructing the URL manually.
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 values
Only fulfil an order when paymentStatus is CAPTURED. A redirect to your success_url without a CAPTURED status does not confirm that funds were collected.

Request 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.