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
Choose the Correct payment_type for Your Method
Direct Integration uses two distinct
You must set this value dynamically based on your customer’s selection before you send the initialization request.
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.| Payment method | payment_type value |
|---|---|
| K-Net | "1" |
| Credit Card (VISA / MasterCard) | "2" |
Send the Initialization Request
From your server, send a
Headers
The tabs below show sample request bodies for each payment method:
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.Endpoints| Environment | URL |
|---|---|
| Test | https://development.payzah.net/ws/paymentgateway/index |
| Production | https://payzah.net/production770/ws/paymentgateway/index |
| Header | Value |
|---|---|
Content-Type | application/json |
Authorization | base64_encode($privateKey) |
- K-Net (payment_type 1)
- Credit Card (payment_type 2)
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.| Field | Transit (payment_type 3) | Direct (payment_type 1 or 2) |
|---|---|---|
transit_url | Populated — redirect here | Empty |
direct_url | Empty | Populated — redirect here |
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
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 fields| Field | Description |
|---|---|
payzahReferenceCode | Payzah’s unique reference ID for this transaction |
trackId | The trackid value you sent in the initialization request |
knetPaymentId | Unique ID assigned by the payment gateway (K-Net or card network) |
transactionNumber | Unique identifier for this specific transaction |
trackingNumber | Track ID echoed back from your original request |
paymentDate | Date on which the payment was processed |
paymentStatus | Final outcome of the transaction (see table below) |
udf1–udf5 | Any user-defined fields you included in the initialization request |
paymentStatus values| Status | Meaning | Recommended action |
|---|---|---|
CAPTURED | Funds captured successfully | Fulfil the order |
VOIDED | Transaction voided before capture | Do not fulfil; notify customer |
NOT CAPTURED | Authorised but capture incomplete | Investigate before acting |
CANCELED | Customer cancelled on provider’s page | Allow customer to retry |
DENIED BY RISK | Blocked by fraud/risk controls | Do not fulfil; ask customer to contact support |
HOST TIMEOUT | Gateway timed out — outcome unknown | Hold the order and confirm status manually |
Request Field Reference
Use this table when constructing your initialization request body for Direct Integration.| Field | Type | Max length | Mandatory | Description |
|---|---|---|---|---|
trackid | Alphanumeric | 255 | Yes | Unique ID per transaction — must not be reused |
amount | Numeric | 10 | Yes | Transaction amount, e.g. 11.250 |
success_url | Alphanumeric | 255 | Yes | Your URL for successful payment callbacks |
error_url | Alphanumeric | 255 | Yes | Your URL for failed or cancelled payment callbacks |
currency | Numeric | 3 | Yes | ISO 4217 numeric code, e.g. 414 for KWD |
payment_type | Fixed | 1 | No* | "1" for K-Net, "2" for Credit Card |
language | Alpha | 3 | No | ENG or ARA |
kfast_id | Numeric | 8 | No | K-Net faster checkout identifier |
customer_name | Alphanumeric | 255 | No | Customer’s full name |
customer_phone | Alphanumeric | 255 | No | Customer’s phone number |
customer_email | Alphanumeric | 255 | No | Customer’s email address |
udf1–udf5 | Alphanumeric | 255 | No | Additional fields for your own reference |
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.