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, apple-pay-knet, 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, example:https://upayments.com/en/?payment_id=100527020000000598&result=CAPTURED&post_date=0927 &tran_id=527020000293353&ref=527020000040&track_id=019988a5066a999800a57eb83d309bafv2 &auth=B54978&order_id=019988a5066a999800a57eb83d309bae&requested_order_id=202210101255255144669 &refund_order_id=019988a5066a999800a57eb83d309bae&payment_type=knet&invoice_id=6058253 &transaction_date=2025-09-27%2003%3A09%3A49&receipt_id=019988a5066a999800a57eb83d309bae&trn_udf=User%20define%20data |
| 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. |
