KNET for API only
Last updated: August 28, 2024
KNET payments follow a two-step process:
For the full API specification, see the API reference.
post
https://api.checkout.com/payments
Note
When sending a payment request that includes source.card_token
, you can optionally pay via KFast. If the token is new, the first payment will happen via the usual flow, but with the option to "register for KFast" before submitting. This flow is not testable in the sandbox environment because the registration for KFast requires the customer to enter a one-time password sent to the mobile phone number registered with the bank, which is not present in sandbox.
1{2"amount": 1000,3"currency": "KWD",4"source": {5"type": "knet",6"language": "en",7"user_defined_field1": "first user defined field",8"user_defined_field2": "second user defined field",9"card_token": "01234567",10"user_defined_field4": "fourth user defined field",11"ptlf": "96033587c7b5"12}13}
If you receive a 202 Success
response containing a status
field set to Pending
, your request was successful.
1{2"id": "pay_4gubyq2w335upc54dx7a4257lq",3"status": "Pending",4"customer": {5"id": "cus_r3cajfpbj3ju7jyq7afcg3qc4a"6},7"_links": {8"self": {9"href": "https://api.sandbox.checkout.com/payments/pay_4gubyq2w335upc54dx7a4257lq"10},11"redirect": {12"href": "https://sbapi.ckotech.co/knet-external/redirect/tok_tl6kftlhdpzephqelsbpyovl4i/pay"13}14}15}
Redirect your customer to the redirect
link’s href in the response. This will allow the customer to authorize the payment, before they are transferred to your predefined success or failure URL.
You can retrieve details about an existing KNET payment with the following endpoint.
Use the following details to set up your request.
For the full API specification, see the API reference.
post
https://api.checkout.com/payments/{id}
1{2"id": "pay_4gubyq2w335upc54dx7a4257lq",3"requested_on": "2024-05-23T17:04:05Z",4"source": {5"type": "knet",6"language": "en",7"user_defined_field1": "first user defined field",8"user_defined_field2": "second user defined field",9"user_defined_field4": "fourth user defined field",10"card_token": "01234567",11"ptlf": "96033587c7b5",12"knet_payment_id": "100201914315601265",13"knet_result": "Captured",14"bank_reference": "914310000349",15"knet_transaction_id": "201914384388126",16"auth_code": "B00775",17"post_date": "0524",18"avr": "N"19},20"amount": 1000,21"currency": "KWD",22"payment_type": "Regular",23"status": "Captured",24"approved": true,25"risk": {26"flagged": false27},28"customer": {29"id": "cus_kx75h5tcegyednxeyvtn6vy3sq"30},31"_links": {32"self": {33"href": "https://api.sandbox.checkout.com/payments/pay_c2ynk5nnjacuxia3r4matf5wmu"34},35"actions": {36"href": "https://api.sandbox.checkout.com/payments/pay_c2ynk5nnjacuxia3r4matf5wmu/actions"37}38}39}
KNET supports full, partial and multiple partial refunds. Refund a payment through the Dashboard or by using our Refund API.
Note
Before you can refund KNET payments, you need to contact your bank and ask them to enable refunds. Your bank will then send a request to KNET to activate the refund API.
If, after landing on the KNET payment page, the customer attempts to complete the payment after seven minutes, we will automatically void the payment and send a payment_expired
webhook.
If the customer cancels their payment, we will send a payment_canceled
webhook.
Note
To start testing, you'll need to contact your account manager or Integrations engineer to activate KNET payments in the sandbox environment.
- Create a KNET transaction following the steps on this page, and open the redirect link in the response to KNET's website.
- Enter the following details:
- Select your bank – Knet Test Card [KNET1]
- Card number –
888888 000 000 000 1
- Expiration date –
09 | 2025
- PIN –
1234
- Select Submit and then Confirm. You should then be redirected to your predefined success URL.