post https://sandboxapi.upayments.com/api/v1/charge
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 Parameter | Type | Length | Description |
---|---|---|---|
products | object, optional | ||
products. name | string, optional | 255 | Pass product name here |
products.description | string, optional | 255 | Pass product description here |
products.price | float, optional | 7 | Pass product price here |
products.quantity | integer, optional | 7 | Pass quantity here |
order | object, mandatory | ||
order.id | string, mandatory | 40 | Refers to the order or transaction ID in your system that you have sent in the request earlier |
order.reference | string, optional | 255 | Refers to the order or transaction ID in your system that you have sent in the request earlier |
order.description | string, mandatory | 500 | Refers to the order description |
order.currency | string, mandatory | 3 | |
order.amount | float, mandatory | 22 | The amount you are seeking to charge the customer accepts decimal values e.g. 2.50. |
paymentGateway | object, (Mandatory if you are White label user) | ||
paymentGateway.src | string, (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. |
language | string, mandatory | 2 | en to display the checkout page in English ar to display the checkout page in Arabic |
tokens | object, mandatory | ||
tokens.customerUniqueToken | integer, optional | 8 (minimum) | Pass customer unique token here. you will get saved card on payment page. |
reference | object, mandatory | ||
reference.id | string, mandatory | 150 | Refers to the order or transaction ID in your own system we will save your ID for our reference. |
customer | object, optional | ||
customer.uniqueId | string, optional | 150 | Pass customer unique ID for our reference |
customer.name | string, optional | 50 | Pass customer name for our reference |
customer.email | string, optional | 50 | Pass customer email address here. If notificationType = email customer will receive the payment receipt on this email address. |
customer.mobile | string, optional | 15 | Pass customer phone number here. If notificationType.mobile is true customer will receive the payment sms on this mobile number. |
customerExtraData | string, optional | We can pass any User Define Data (UDF) here | |
extraMerchantData | object, optional | ||
extraMerchantData.amount | float, optional | 10 | Pass merchant transaction amount. |
extraMerchantData.knetCharge | float, optional | 2,2 | Main 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.knetChargeType | string, optional | 10 | Knet charge type (fixed or percentage) |
extraMerchantData.ccCharge | float, optional | 2,2 | Main 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.ccChargeType | string, optional | 10 | CreditCard charge type (fixed or percentage) |
extraMerchantData.ibanNumber | string, optional | 25 | Sub-vendor IBAN Numbers. Defines which Sub vendor Bank account to deposit the Order amount after commisions are deducted. |
returnUrl | string, mandatory | 250 | The return URL you like to have the successful payment |
cancelUrl | string, mandatory | 250 | The cancel URL you like to have the cancel or failure payment |
notificationUrl | string, mandatory | 250 | The notification URL will receive the webhook data |
plugin | object, optional | ||
plugin.src | string, optional | 11 | Supported plugin opencart,whmcs,cscart,woocommerce,magento,ecwid,android-sdk,ios-sdk and flutter-sdk |
paymentLinkExpiryInMinutes | integer, optional | If 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"
}
}
}
}