post
https://sandboxapi.upayments.com/api/v1/auto-deduct
Auto Deduction API enables merchants to securely automate recurring billing and on-demand charges via payment tokenization. By safely saving a customer’s payment method during their initial authorized transaction, your system can trigger subsequent background payments without requiring manual re-entry or customer intervention. This streamlined API reduces churn, simplifies PCI-DSS compliance, and is ideal for subscription models, utility billing, and scheduled memberships.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
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 |
|---|---|---|---|
| order | array, mandatory | ||
| order.id | string, mandatory | 50 | Refers to the order or transaction ID in your system that you have sent in the request earlier |
| order.reference | string, mandatory | 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 | Pass your currency code here. You will get the Currency Code from here. |
| order.amount | string, mandatory | 22 | The amount you are seeking to charge the customer accepts decimal values e.g. 2.50. |
| language | string, mandatory | 2 |
|
| reference | array, 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 | array, mandatory | ||
| customer.name | string, mandatory | 50 | Pass customer name for our reference |
| customer.email | string, mandatory | 50 | Pass customer email address here. |
| customer.mobile | string, mandatory | 15 | Pass customer mobile number here. |
| customer.uniqueToken | integer, mandatory | Pass customer unique token here. you will get saved card on payment page. | |
| card | array, mandatory | ||
| card.token | string, mandatory | Pass the card token here. You will get the card token from Retrieve cards |
{
"order": {
"id": "20221010125525515728",
"reference": "202210101",
"description": "Merchant Order description",
"currency": "KWD",
"amount": "50.000"
},
"language": "en",
"reference": {
"id": "202210101202210101"
},
"customer": {
"uniqueToken": "94771608",
"name": "John Smith",
"email": "[email protected]",
"mobile": "+96512345678"
},
"card": {
"token": "9527876950966554"
}
}{
"status": true,
"message": "Your payment transaction was successful",
"data": {
"trackId": "20231154052601721123315963438",
"transaction": {
"invoiceId": 72620,
"trackId": "20231154052601721123315963438",
"amount": "50.000",
"currency": "KWD",
"sessionId": "SESSION0002843470869L91576269G8",
"status": "done",
"reference": "202210101202210101",
"paymentId": "HzYEZ2n6pMQZU2tWugeZEVPa25Sb7yAM",
"paymentType": "card",
"orderId": "20221010125525515728",
"result": "CAPTURED",
"transactionDate": "2023-01-26 11:54:11"
}
}
}