API Reference

It will return payment link

Overview

Overview

📘

Request Header

Add "Authorization": "Bearer {Token}" to the request header.

Request Model

The request is a POST request with the following parameters:

Input ParameterTypeLengthDescription
productsobject, optional
products. namestring, optional255Pass product name here
products.descriptionstring, optional255Pass product description here
products.pricefloat, optional7Pass product price here
products.quantityinteger, optional7Pass quantity here
orderobject, mandatory
order.idstring, mandatory40Refers to the order or transaction ID in your system that you have sent in the request earlier
order.referencestring, optional255Refers to the order or transaction ID in your system that you have sent in the request earlier
order.descriptionstring, mandatory500Refers to the order description
order.currencystring, mandatory3
order.amountfloat, mandatory22The amount you are seeking to charge the customer accepts decimal values e.g. 2.50.
paymentGatewayobject, (Mandatory if you are White label user)
paymentGateway.srcstring, (Mandatory if you are White label user)11 (maximum)You need to pass payment source here like knet, cc, samsung-pay, apple-pay, google-pay and create-invoice
notificationType (for create-invoice)string, (Mandatory if using the above paymentGateway.src = create-invoice)5 (maximum)• email - send the invoice link by email only. You should provide the customer.email.
• sms - send the invoice link by SMS only. You should provide the customer.mobile.
• link - returns only the invoice URL through the response.
• all - send the invoice link by both email and SMS, you have to provide all the needed parameters.
languagestring, mandatory2en to display the checkout page in English
ar to display the checkout page in Arabic
tokensobject, mandatory
tokens.customerUniqueTokeninteger, optional8 (minimum)Pass customer unique token here. you will get saved card on payment page.
referenceobject, mandatory
reference.idstring, mandatory150Refers to the order or transaction ID in your own system we will save your ID for our reference.
customerobject, optional
customer.uniqueIdstring, optional150Pass customer unique ID for our reference
customer.namestring, optional50Pass customer name for our reference
customer.emailstring, optional50Pass customer email address here. If notificationType = email customer will receive the payment receipt on this email address.
customer.mobilestring, optional15Pass customer phone number here. If notificationType.mobile is true customer will receive the payment sms on this mobile number.
customerExtraDatastring, optionalWe can pass any User Define Data (UDF) here
extraMerchantDataobject, optional
extraMerchantData.amountfloat, optional10Pass merchant transaction amount.
extraMerchantData.knetChargefloat, optional2,2Main vendor Knet charge rate for the sub vendor. This is the merchant's (main vendor) commission for each transaction from the sub-vendor. This amount is credited to the main vendor
extraMerchantData.knetChargeTypestring, optional10Knet charge type (fixed or percentage)
extraMerchantData.ccChargefloat, optional2,2Main vendor Credit Card charge rate for the sub-vendor. This is the merchants' (main vendor) commission for each transaction from the sub-vendor. (Includes MasterCard, Visa, Samsung Pay, Google Pay, and Apple Pay). This amount is credited to the main vendor
extraMerchantData.ccChargeTypestring, optional10CreditCard charge type (fixed or percentage)
extraMerchantData.ibanNumberstring, optional25Sub-vendor IBAN Numbers. Defines which Sub vendor Bank account to deposit the Order amount after commisions are deducted.
returnUrlstring, mandatory250The return URL you like to have the successful payment
cancelUrlstring, mandatory250The cancel URL you like to have the cancel or failure payment
notificationUrlstring, mandatory250The notification URL will receive the webhook data
pluginobject, optional
plugin.srcstring, optional11Supported plugin opencart,whmcs,cscart,woocommerce,magento,ecwid,android-sdk,ios-sdk and flutter-sdk
paymentLinkExpiryInMinutesinteger, optionalIf you want to set the expiration for the payment link, you need to set this parameter value in minutes.
{
    "products": [
        {
            "name": "Logitech K380",
            "description": "Logitech K380 / Easy-Switch for Upto 3 Devices, Slim Bluetooth Tablet Keyboar ",
            "price": 10,
            "quantity": 1
        },
        {
            "name": "Logitech M171 Wireless Optical Mouse",
            "description": "Logitech M171 Wireless Optical Mouse  (2.4GHz Wireless, Blue Grey)",
            "price": 10,
            "quantity": 1
        }
    ],
    "order": {
        "id": "202210101255255144669",
        "reference": "11111991",
        "description": "Purchase order received for Logitech K380 Keyboard",
        "currency": "KWD",
        "amount": 20
    },
    "paymentGateway": {
        "src": "knet"
    },
    "language": "en",
    "reference": {
        "id": "202210101202210101"
    },
    "customer": {
        "uniqueId": "2129879kjbljg767881",
        "name": "Dharmendra Kakde",
        "email": "[email protected]",
        "mobile": "+96566336537"
    },
    "returnUrl": "https://upayments.com/en/",
    "cancelUrl": "https://error.com",
    "notificationUrl": "https://webhook.site/d7c6e1c8-b98b-4f77-8b51-b487540df336",
    "customerExtraData": "User define data"
}
{
    "products": [
        {
            "name": "Logitech K380",
            "description": "Logitech K380 / Easy-Switch for Upto 3 Devices, Slim Bluetooth Tablet Keyboar ",
            "price": 10,
            "quantity": 1
        },
        {
            "name": "Logitech M171 Wireless Optical Mouse",
            "description": "Logitech M171 Wireless Optical Mouse  (2.4GHz Wireless, Blue Grey)",
            "price": 10,
            "quantity": 1
        }
    ],
    "order": {
        "id": "202210101255255144669",
        "reference": "11111991",
        "description": "Purchase order received for Logitech K380 Keyboard",
        "currency": "KWD",
        "amount": 20
    },
    "language": "en",
    "reference": {
        "id": "202210101202210101"
    },
    "customer": {
        "uniqueId": "2129879kjbljg767881",
        "name": "Dharmendra Kakde",
        "email": "[email protected]",
        "mobile": "+96566336537"
    },
    "returnUrl": "https://upayments.com/en/",
    "cancelUrl": "https://error.com",
    "notificationUrl": "https://webhook.site/d7c6e1c8-b98b-4f77-8b51-b487540df336",
    "customerExtraData": "User define data"
}
{
    "products": [
        {
            "name": "Logitech K380",
            "description": "Logitech K380 / Easy-Switch for Upto 3 Devices, Slim Bluetooth Tablet Keyboar ",
            "price": 10,
            "quantity": 1
        },
        {
            "name": "Logitech M171 Wireless Optical Mouse",
            "description": "Logitech M171 Wireless Optical Mouse  (2.4GHz Wireless, Blue Grey)",
            "price": 10,
            "quantity": 1
        }
    ],
    "order": {
        "id": "202210101255255144669",
        "reference": "11111991",
        "description": "Purchase order received for Logitech K380 Keyboard",
        "currency": "KWD",
        "amount": 20
    },
    "language": "en",
    "reference": {
        "id": "202210101202210101"
    },
    "customer": {
        "uniqueId": "2129879kjbljg767881",
        "name": "Dharmendra Kakde",
        "email": "[email protected]",
        "mobile": "+96566336537"
    },
    "returnUrl": "https://upayments.com/en/",
    "cancelUrl": "https://error.com",
    "notificationUrl": "https://webhook.site/d7c6e1c8-b98b-4f77-8b51-b487540df336",
    "customerExtraData": "User define data",
    "extraMerchantData": [
      {
        "amount": 10,
        "knetCharge": 5,
        "knetChargeType": "fixed",
        "ccCharge": 10,
        "ccChargeType": "percentage",
        "ibanNumber": "KW91KFHO1122334455611223344556"
      },
      {
        "amount": 10,
        "knetCharge": 5,
        "knetChargeType": "fixed",
        "ccCharge": 7,
        "ccChargeType": "percentage",
        "ibanNumber": "KW31NBOK6677889910111213141516"
      }
	]
}

Response Model

{
    "status": true,
    "message": "Payment link generated successfully",
    "data": {
        "link": "https://kpaytest.com.kw/kpg/PaymentHTTP.htm?param=paymentInit&trandata=0c399ba69806a53e095952a7ca7ce1dc1f9abc35a06a5afd00ba8b941b48086da33836564d9c731427e89b4291d3f5826acdbaed91d529e1f04d4edd6d269a4f84c55ba74b3aa87ba72f1e197842c1250870b84b21aa01708e24d328ab507db22deffcf59d824144837ed98c48f7073bbcb6410ad9c3034039b7386aee44923ebb8189f93435a3c5fa0cbadeded97e49f5304fd609b9564c7a42e67b7e0f1ae35691bd8973aabfab5973fd196dae47aab42b4b5e047b3889d67842905948ead059e7cd2e5411cc6e596ad49663b1f8069fd0e22e87df0baf97278053f754baf246c1f68c0eeacc4d827fcab373ab264a3a6bbabb37e7d0b84b64cca404dbc92102d05aa2af28bc982f751de2581c45d5de68b32773304fa488f20f93e836f4f6990eab0fb285e68086c5dd828cdacc96a0c4f322f69ed643959e210efb29d66c4a2cc848b99edddb90a843545c3722bf4a4d4989321be12b2eb3c0b203c5299b&tranportalId=252501&responseURL=https://dev-apiv2api.upayments.com/get-knet-success-response&errorURL=http://dev-apiv2api.upayments.com/get-knet-error-response",
        "trackId": "23430708S412166VuC45126342261691450860S0"
    }
}
{
    "status": true,
    "message": "Data received successfully",
    "data": {
        "link": "https://sandbox.upayments.com?session_id=20230944381710911035600999484952060712837211701"
    }
}
{
    "status": true,
    "message": "Data received successfully",
    "data": {
        "link": "https://sandbox.upayments.com?session_id=20230944381710911035600999484952060712837211701"
    }
}
{
    "status": true,
    "message": "Data received successfully",
    "data": {
        "payMit": {
            "result": "SUCCESS",
            "order": {
                "status": "CAPTURED"
            }
        },
        "transactionData": {
            "order_id": "0192aec411cdc0cd3e815ba6880db1a4v2",
            "refund_order_id": "0192aec411cdc0cd3e815ba6880db1a4v2",
            "payment_id": "0192aec411cdc0cd3e815ba6880db1a3",
            "invoice_id": 6000555,
            "result": "CAPTURED",
            "payment_type": "card",
            "payment_method": "card",
            "track_id": "0192aec410551926b61c94a5c116294d",
            "tran_id": null,
            "auth": null,
            "ref": "0192aec411d006c44fad31a13bcef7d9",
            "post_date": null,
            "transaction_date": "2024-10-21 14:09:00",
            "payment_date": "2024-10-21 14:09:01",
            "is_save_card": false,
            "from_plugin": false,
            "product_details": "{\"title\":[\"Logitech K380\",\"Logitech M171 Wireless Optical Mouse\"],\"name\":[\"Logitech K380 \\/ Easy-Switch for Upto 3 Devices, Slim Bluetooth Tablet Keyboar\",\"Logitech M171 Wireless Optical Mouse  (2.4GHz Wireless, Blue Grey)\"],\"price\":[10,10],\"qty\":[1,1],\"more_details\":\"\"}",
            "reference": "202210101202210101",
            "total_paid_non_kwd": "20.00",
            "total_price": "20.000",
            "currency_type": "KWD",
            "status": "done",
            "session_id": "9a5cb19eda9f653082ffa76b46f5dfa5",
            "error_url": "https://error.com",
            "success_url": "https://upayments.com/en/",
            "redirect_url": "https://upayments.com/en/?payment_id=0192aec411cdc0cd3e815ba6880db1a3&result=CAPTURED&post_date=&tran_id=&ref=0192aec411d006c44fad31a13bcef7d9&track_id=0192aec410551926b61c94a5c116294d&auth=&order_id=0192aec411cdc0cd3e815ba6880db1a4v2&requested_order_id=202210101255255144669&refund_order_id=0192aec411cdc0cd3e815ba6880db1a4v2&payment_type=card&invoice_id=6000555&transaction_date=2024-10-21 02:10:09&receipt_id=0192aec411cdc0cd3e815ba6880db1a4v2&trn_udf=User define data",
            "notify_url": "https://webhook.site/d7c6e1c8-b98b-4f77-8b51-b487540df336",
            "notify_url_called": false,
            "notify_url_response": null,
            "whitelabled": true,
            "customer_id": 2962509,
            "customer_unique_id": "2129879kjbljg767881",
            "merchant_requested_order_id": "202210101255255144669",
            "extra_merchants_data": null,
            "is_paid_from_knet": false,
            "is_paid_from_cc": true,
            "is_from_nbk": false,
            "customer_extra_data": "User define data",
            "created_at": "2024-10-21 14:09:00",
            "customer": {
                "name": "Dharmendra Kakde",
                "email": "[email protected]",
                "mobile_number": "+96566336537"
            }
        }
    }
}
Language
Credentials
Header
Click Try It! to start a request and see the response here!