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
productsarray, optional
products. namestring, optional255Pass product name here
products.descriptionstring, optional255Pass product description here
products.pricefloat, optional7Pass product price here
products.quantityinteger, optional7Pass quantity here
orderarray, mandatory
order.idstring, mandatory50Refers 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.
paymentGatewayarray, (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
tokensarray, mandatory
tokens.customerUniqueTokeninteger, optional8 (minimum)Pass customer unique token here. you will get saved card on payment page.
referencearray, mandatory
reference.idstring, mandatory150Refers to the order or transaction ID in your own system we will save your ID for our reference.
customerarray, 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
extraMerchantDataarray, 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
pluginarray, optional
plugin.srcstring, optional11Supported plugin opencart,whmcs,cscart,woocommerce,magento,ecwid,android-sdk,ios-sdk and flutter-sdk
{
    "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": "KW91KFHO0000000000051010173254"
      },
      {
        "amount": 10,
        "knetCharge": 5,
        "knetChargeType": "fixed",
        "ccCharge": 7,
        "ccChargeType": "percentage",
        "ibanNumber": "KW31NBOK0000000000002010177457"
      }
	]
}

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"
    }
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!