post
https://sandboxapi.upayments.com/api/v1/authorize
The Authorize API is used to reserve a specified amount of funds on the customer's payment method. It returns a payment link for the customer to complete the card details and confirms the authorization request.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Request Model
The request is a POST request with the following parameters:
| Input Parameter | Type | Length | Description |
|---|---|---|---|
| products | Array of Products (Product Model) | - | Details of the items being purchased. |
| order | Object (Order Model) | - | Order details including amount and currency for authorization. |
| paymentGateway | Object (PaymentGateway Model) | - | Payment gateway configuration. |
| language | String | 5 | Preferred language for the payment page (e.g., "en"). |
| reference.id | String | 50 | Unique reference ID for the specific authorization request. |
| customer | Object (Customer Model) | - | Customer contact and identifier information. |
| returnUrl | String (URL) | 255 | URL to redirect to upon successful payment completion. |
| cancelUrl | String (URL) | 255 | URL to redirect to if the customer cancels the payment. |
| notificationUrl | String (URL) | 255 | Merchant endpoint for receiving asynchronous status updates (webhook). |
{
"products": [
{
"name": "Logitech K380",
"description": "Easy-Switch for Up to 3 Devices, Slim Bluetooth Tablet Keyboard",
"price": 0.005,
"quantity": 1
},
{
"name": "Logitech M171 Wireless Optical Mouse",
"description": "2.4GHz Wireless, Blue Grey",
"price": 0.005,
"quantity": 1
}
],
"order": {
"id": "202210101255255144669",
"reference": "11111991",
"description": "Purchase order received for Logitech K380 Keyboard",
"currency": "KWD",
"amount": 65
},
"paymentGateway": {
"src": "cc"
},
"language" : "en",
"reference": {
"id": "202210101202210101"
},
"customer": {
"uniqueId": "2129879243767881",
"name": "Juliette Bonilla",
"email": "[email protected]",
"mobile": "+96566336537"
},
"returnUrl": "https://upayments.com/en/",
"cancelUrl": "https://error.com",
"notificationUrl": "https://webhook.site/2547b895-5899-4a21-a6f2-ed34c4228216"
}Response Model
| Input Parameter | Type | Max Length | Description |
|---|---|---|---|
| status | Boolean | 100 | true if the request was successfully processed (not necessarily authorized, but a link was generated). |
| message | String | 100 | A descriptive message regarding the operation. |
| data.link | String (URL) | 100 | The payment URL to which the customer must be redirected to complete the authorization. |
| data.trackId | String | 20 | A unique tracking ID for the authorization session. |
{
"status": true,
"message": "Payment link generated successfully",
"data": {
"link": "https://sandboxapi.upayments.com/merchant/?session_id=20250815013010856737489181515769970363960300194",
"trackId": "019a338a6f59089a392ac76862130dbf"
}
} 200