# KNET Gateway
source: https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/cards/domestic-schemes/knet/index.md

## Overview {#overview}

KNET is the primary card-based payment method in Kuwait. All debit cards issued in the country carry the KNET brand. Approximately 80% of the 5 million cards issued are debit cards.

KNET uses advanced e-commerce and payment gateway technology with security controls designed to protect users from fraud and unauthorized access.

KNET allows customers to pay using locally issued debit cards from participating Kuwaiti banks.

For more information, visit [KNET](https://www.knet.com.kw/).

## Prerequisites {#prerequisites}

To offer KNET through the payment gateway:

1. Establish a merchant account with a participating KNET member bank and obtain your Merchant ID (MID) and credentials.
2. Register with your payment gateway service provider and provide your KNET MID, credentials, domain, and CNAME.
3. Ask your acquirer to configure your merchant profile to enable KNET acceptance.

Tip: Contact your local product team for additional support.

## KNET payer journey flow {#knet-payer-journey-flow}

This figure illustrates the KNET payer journey flow.

Figure: KNET payer journey flow

Diagram knet

![](https://static.developer.mastercard.com/content/mastercard-gateway/uploads/KnetPaymentWindow.png)

These stages describe the KNET payer journey:

1. Consumers must:
   1. Select products or services.
   2. Complete the checkout process.
   3. Provide basic customer information, such as first name, last name, email address, telephone number, and address details.
   4. Select **KNET** as the payment option.
2. The browser redirects the consumer to the KNET page.
3. The consumer enters card details and authenticates the payment.
4. The browser redirects the consumer to your page with the final payment status.

If the payment is unsuccessful, the consumer can retry using another payment method.
Tip: KNET does not support the AUTHORIZATION and CAPTURE model. It supports only the PAY model.

## KNET integration {#knet-integration}

### KNET through Direct Payment {#knet-through-direct-payment}

* Direct Payment integration enables you to offer KNET on your checkout page.
* KNET is supported from Gateway API version 100 and later.
* Submit an Initiate Browser Payment request with:
  * `sourceOfFunds.browserPayment.type = KNET`
  * `browserPayment.operation = PAY`

#### KNET transactions {#knet-transactions}

| Transaction Details  |                                         Value                                          |
|----------------------|----------------------------------------------------------------------------------------|
| Payment Type         | Debit Switch Gateway                                                                   |
| Supported Countries  | Kuwait                                                                                 |
| Supported Currencies | KWD                                                                                    |
| Supported Operations | Purchase (PAY), PARTIAL REFUND, REFUND                                                 |
| Refund Validity      | Refunds cannot be issued after 90 days from the purchase date, as per KNET guidelines. |
| Chargeback           | Not applicable                                                                         |

#### Specific parameter fields {#specific-parameter-fields}

In addition to the [standard fields](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/alt-pay-methods/imp-brow-pay-int/index.md) required in a browser payment request, include these parameters in the [Initiate Browser Payment](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#browser-payment) request for KNET.

|           Parameter Name            | Mandatory or Optional |             Description             |
|-------------------------------------|-----------------------|-------------------------------------|
| `order.amount`                      | Mandatory             | Specifies the transaction amount.   |
| `order.currency`                    | Mandatory             | Specifies the transaction currency. |
| `order.notificationUrl`             | Mandatory             | Specifies the notification URL.     |
| `sourceOfFunds.type`                | Mandatory             | Specifies the source of funds.      |
| `sourceOfFunds.browserPayment.type` | Mandatory             | Specifies the browser payment type. |
| `browserPayment.operation`          | Mandatory             | Specifies the payment operation.    |

### Initiate KNET payment request {#initiate-knet-payment-request}

```json
{
  "apiOperation": "INITIATE_BROWSER_PAYMENT",
  "billing": {
    "address": {
      "city": "Edinburgh",
      "company": "MPGS",
      "country": "KWT",
      "stateProvince": "Scotland",
      "street": "OceanPoint",
      "street2": "OceanDrive",
      "postcodeZip": "2000"
    }
  },
  "shipping": {
    "address": {
      "city": "Edinburgh",
      "company": "MPGS",
      "country": "KWT",
      "stateProvince": "Scotland",
      "street": "OceanPoint",
      "street2": "OceanDrive",
      "postcodeZip": "2000"
    }
  },
  "browserPayment": {
    "operation": "PAY",
    "returnUrl": "{{host}}/api/documentation/integrationGuidelines/index.html"
  },
  "customer": {
    "account": {
      "id": "customerAccount"
    },
    "dateOfBirth": "1xx9-1x-x1",
    "email": "axxsh.maxxli@mxxd.com",
    "firstName": "Axxsh",
    "lastName": "Maxxi",
    "mobilePhone": "07792xxxx55",
    "nationalId": "nationalId1",
    "phone": "9898xxxx98"
  },
  "order": {
    "reference": "TEST-SUCCEED",
    "amount": "90.00",
    "itemAmount": "90.00",
    "currency": "KWD",
    "item": [
      {
        "detail": {
          "unitTaxRate": "0"
        },
        "name": "Spud",
        "quantity": "1",
        "unitPrice": "45",
        "unitTaxAmount": "0.02",
        "unitDiscountAmount": "0.03",
        "description": "item1 description",
        "sku": "item1"
      },
      {
        "detail": {
          "unitTaxRate": "0"
        },
        "name": "item2",
        "quantity": "1",
        "unitPrice": "45",
        "unitTaxAmount": "0.02",
        "unitDiscountAmount": "0.03",
        "description": "item2 description",
        "sku": "item2"
      }
    ],
    "shippingAndHandlingAmount": "0.02",
    "taxAmount": "0.04",
    "description": "apmspi test order"
  },
  "sourceOfFunds": {
    "browserPayment": {
      "type": "KNET"
    },
    "type": "BROWSER_PAYMENT"
  }
}
```

### Initiate KNET payment response {#initiate-knet-payment-response}

```json
{
  "billing": {
    "address": {
      "city": "Edinburgh",
      "company": "MPGS",
      "country": "KWT",
      "postcodeZip": "2000",
      "stateProvince": "Scotland",
      "street": "OceanPoint",
      "street2": "OceanDrive"
    }
  },
  "browserPayment": {
    "interaction": {
      "status": "INITIATED",
      "timeInitiated": "2024-10-09T15:34:34.203Z"
    },
    "operation": "PAY",
    "redirectHtml": "&lt;div id=\"initiateRedirect\" xmlns=\"http://www.w3.org/1999/html\"&gt;&lt;iframe srcdoc=\"&lt;script src='https://drogon.ottu.dev/b/checkout/redirect/start/?session_id=713b7f6a052d431d84f5a98c1ab743cb79f94c38&pg_code=KNET'&gt;window.top.location.href='https://drogon.ottu.dev/b/checkout/redirect/start/?session_id=713b7f6a052d431d84f5a98c1ab743cb79f94c38&pg_code=KNET';&lt;/script&gt;\" id=\"redirectFrame\" name=\"redirectFrame\" height=\"100%\" width=\"100%\"&gt;&lt;/iframe&gt;&lt;/div&gt;",
    "returnUrl": "{{host}}/api/documentation/integrationGuidelines/index.html"
  },
  "customer": {
    "account": {
      "id": "customerAccount"
    },
    "email": "axxsh.mxxli@txx.com",
    "firstName": "Axxsh",
    "lastName": "Mxxli",
    "mobilePhone": "07792xxxx55",
    "nationalId": "nationalId1",
    "phone": "9898xxxx98"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "TEST_MERCHANT",
  "order": {
    "amount": 90,
    "chargeback": {
      "amount": 0,
      "currency": "KWD"
    },
    "creationTime": "2024-10-09T15:34:34.081Z",
    "currency": "AED",
    "description": "apmspi test order",
    "discount": {
      "amount": 30
    },
    "id": "5699400641",
    "item": [
      {
        "description": "item1 description",
        "detail": {
          "unitTaxRate": 0
        },
        "name": "Spud",
        "quantity": 1,
        "sku": "item1",
        "unitDiscountAmount": 10,
        "unitPrice": 20,
        "unitTaxAmount": 10
      },
      {
        "description": "item2 description",
        "detail": {
          "unitTaxRate": 0
        },
        "name": "item2",
        "quantity": 2,
        "sku": "item2",
        "unitDiscountAmount": 10,
        "unitPrice": 20,
        "unitTaxAmount": 10
      }
    ],
    "itemAmount": 60,
    "lastUpdatedTime": "2024-10-09T15:34:35.703Z",
    "merchantAmount": 70,
    "merchantCurrency": "AED",
    "reference": "TEST-SUCCEED",
    "shippingAndHandlingAmount": 10,
    "status": "INITIATED",
    "taxAmount": 30,
    "totalAuthorizedAmount": 0,
    "totalCapturedAmount": 0,
    "totalDisbursedAmount": 0,
    "totalRefundedAmount": 0
  },
  "response": {
    "acquirerCode": "ACCEPTED",
    "gatewayCode": "SUBMITTED",
    "gatewayRecommendation": "NO_ACTION"
  },
  "result": "SUCCESS",
  "shipping": {
    "address": {
      "city": "Edinburgh",
      "company": "MPGS",
      "country": "KWT",
      "postcodeZip": "2000",
      "stateProvince": "Scotland",
      "street": "OceanPoint",
      "street2": "OceanDrive"
    }
  },
  "sourceOfFunds": {
    "browserPayment": {
      "type": "KNET"
    },
    "type": "BROWSER_PAYMENT"
  },
  "timeOfLastUpdate": "2024-10-09T15:34:35.703Z",
  "timeOfRecord": "2024-10-09T15:34:34.194Z",
  "transaction": {
    "acquirer": {
      "id": "OTTU_SPI",
      "merchantId": "drogon-ottu-dev"
    },
    "amount": 70,
    "currency": "KWD",
    "id": "4551482213",
    "source": "INTERNET",
    "stan": "0",
    "type": "PAYMENT"
  },
  "version": "100"
}
```

### Interpretation of the transaction result {#interpretation-of-the-transaction-result}

This tables explain the possible transaction response codes after initiating a KNET payment.

| Initiate Browser Payment Response  |  Result   |                      What This Means                       |
|------------------------------------|-----------|------------------------------------------------------------|
| `response.gatewayCode = SUBMITTED` | `SUCCESS` | Redirect the payer using the URL provided in the response. |

|       Retrieve Transaction or Retrieve Order Response        |  Result   |                                                                                        What This Means                                                                                        |
|--------------------------------------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `response.gatewayCode = APPROVED`                            | `SUCCESS` | The payment is successful.                                                                                                                                                                    |
| `response.gatewayCode = PENDING`                             | `PENDING` | The Mastercard Gateway is waiting for a notification from the acquirer about the payment result. Try `RETRIEVE_TRANSACTION` again later or listen for notifications from the payment gateway. |
| `response.gatewayCode = CANCELLED`                           | `FAILURE` | The payer cancelled the interaction for this payment.                                                                                                                                         |
| `response.gatewayCode = DECLINED` or `ACQUIRER_SYSTEM_ERROR` | `FAILURE` | The payment was declined. Offer the payer another payment method. If the response is `ACQUIRER_SYSTEM_ERROR`, contact the acquirer for the reason or try `RETRIEVE_TRANSACTION` again.        |
| `response.gatewayCode = TIMED_OUT`                           | `FAILURE` | Treat this as a declined payment. The payment gateway ensures the transaction is not successful or will reverse it.                                                                           |

### KNET through Hosted Checkout {#knet-through-hosted-checkout}

Hosted Checkout integration enables you to collect payment details from the payer through an interaction hosted and displayed by the payment gateway.

From Gateway API version 100 and later, KNET is automatically available as a payment method once your payment service provider enables and configures it for your account.

For more information, see [Browser Payments through Hosted Checkout integration](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/alt-pay-methods/imp-brow-pay-int/index.md#browser-payments-through-hosted-checkout-integration).

### Webhook notifications {#webhook-notifications}

If you subscribe to payment gateway webhook notifications, you will receive additional updates about the `paymentStatus`.
