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
notificationTypestring, (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, mandatory
customer.uniqueIdstring, mandatory150Pass customer unique ID for our reference
customer.namestring, mandatory50Pass customer name for our reference
customer.emailstring, mandatory50Pass customer email address here. If notificationType = email customer will receive the payment receipt on this email address.
customer.mobilestring, mandatory15Pass 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,2Merchant’s Knet charge rate for the vendor. Define your fees here which means it's your commission from each transaction.
extraMerchantData.knetChargeTypestring, optional10Knet charge type (fixed or percentage)
extraMerchantData.ccChargefloat, optional2,2Merchant’s Credit Card charge rate for the vendor. Define your fees here which means it's your commission from each transaction. Includes MasterCard, Visa, Samsung Pay, Google Pay, Apple Pay, and Amex.
extraMerchantData.ccChargeTypestring, optional10CreditCard charge type (fixed or percentage)
extraMerchantData.ibanNumberstring, optional25Pass merchant IBAN Number.
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 Keyboard ",
            "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",
    "paymentGateway": {
        "src": "knet"
    },
    "tokens": {
        "customerUniqueToken": 90908986
    },
    "reference": {
        "id": "202210101202210101"
    },
    "customer": {
        "uniqueId": "2129879kjbljg767881",
        "name": "Jhon Smith",
        "email": "[email protected]",
        "mobile": "+96512345678"
    },
    "returnUrl": "https://success.com",
    "cancelUrl": "https://error.com",
    "notificationUrl": "https://callback.com"
}
{
  "products": [
        {
            "name": "Logitech K380",
            "description": "Logitech K380 / Easy-Switch for Upto 3 Devices, Slim Bluetooth Tablet Keyboard ",
            "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": "Jhon Smith",
        "email": "[email protected]",
        "mobile": "+96512345678"
    },
    "returnUrl": "https://success.com",
    "cancelUrl": "https://error.com",
    "notificationUrl": "https://callback.com"
}
{
    "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",
    "tokens": {
        "customerUniqueToken": 90908986
    },
    "reference": {
        "id": "202210101202210101"
    },
    "customer": {
        "uniqueId": "2129879kjbljg767881",
        "name": "Jhon Smith",
        "email": "[email protected]",
        "mobile": "+96512345678"
    },
    "returnUrl": "https://upayments.com/en/",
    "cancelUrl": "https://developers.upayments.com/",
    "notificationUrl": "https://webhook.site/92eb6888-362b-4874-840f-3fff620f7cf4",
    "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=0c399ba69806a53e095952a7ca7ce1dc1f9abc35a06a5afd00ba8b941b48086da33836564d9c731427e89b4291d3f5826acdbaed91d529e1f04d4edd6d269a4f66509b05d0bb3dde9bf0a453ed2db7197234ae776aac3e5c212c0038f46f94f6ad32f73fbc219c396da9d0dfe0552437417928756222a0403b46774549ac3a6aecb41495e7490b28fc11adb13c8f044a8dbd68600b60331283b6ce3b7786fbc23c97851bda86b55aa91be155d330d368a7b8506ceab47988a9fea091ea8f73c2d61a72e237cedbb553c01a4183e40fd2fe5deb22ad3c39c5355366e1b7d1b4a6241c9917f42bff1c7638b13b9a442124ef514957513abd680ad4395526b0fb106a748d304b8883e3fea5ea30a0f5e70a6298bec8cc304a3aefc315c48d806bac&tranportalId=252501&responseURL=http://localhost:8000/get-knet-success-response&errorURL=http://localhost:8000/get-knet-error-response",
        "trackId": "20220647592811619337331833645"
    }
}
{
    "status": true,
    "message": "You are not white label user. To enable please contact to support",
    "data": {
        "link": "https://dev-apiv2api.upayments.com/?session_id=20230537070305505128902825657127217521553614135"
    }
}
{
    "status": true,
    "message": "You are not white label user. To enable please contact to support",
    "data": {
        "link": "https://dev-apiv2api.upayments.com/?session_id=20230537070305505128902825657127217521553614135"
    }
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!