post
https://sandboxapi.upayments.com/api/v1/charge
It will return payment link
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Overview
Overview
Request HeaderAdd "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 |
|
| 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 | 35 | 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 | 50 | 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 the customer phone number here. If notificationType.mobile is true, the customer will receive the payment sms on this mobile number. Example of correct format: +12345678901 Example of incorrect format: +1 (234) 567-8901 |
| 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 |
|
| extraMerchantData.knetChargeType | string, optional | 10 | Knet charge type (fixed or percentage) |
| extraMerchantData.ccCharge | float, optional | 2,2 |
|
| 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:\ |
| 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. |
Explore Different Charge Types
400Bad Request
401Unauthenticated
403Forbidden
