Method create
URL: POST - /partner/hold/create
Method allows to send a request to hold (reserve) a certain amount on the client’s bank card. The holding time for funds is indicated in minutes
If the request is successfully processed, the system returns a unique holding identifier.
The holding of funds is canceled immediately after the holding time expires, unless the partner has withdrawn the funds or canceled the holding.
Header parameters
| Parameter | Type | Description |
|---|---|---|
| client-id * | authorization | Unique Partner ID |
| client-secret * | authorization | Unique authentication key for VIA API |
Request parameters
| Parameter | Type | Description |
|---|---|---|
| merchantId * | string | VIA Merchant ID |
| cardToken * | string | Bank card Token |
| externalId * | string | Partner Request ID |
| amount * | integer | Holding amount in cents (1/100th of a base unit of currency) |
| currency * | string | Currency: «UZS» - Uzbek сум |
| note | string | Notes, remarks, etc. д. |
| accounts * | string | Data object regarding merchant services. The parameters and their values of the accounts object are determined depending on the merchant's service for which the payment is made. For example: A phone number is sent to pay for the mobile operator's service. |
| holdTime | integer | Holding time in minutes. |
Request sample
curl POST '/partner/hold/create' \
--header 'client-id: system' \
--header 'client-secret: system123' \
--data '{
"merchantId": "mrt_qwegFC1lHGaAzJIRphv4LdU10zX",
"externalId": "test_1"
"cardToken": "VLH8VNWKE3SBBBZEKA86T5PF72ZNTEST",
"amount": 10000,
"currency": "UZS",
"note": "",
"accounts": {
"account": "123123",
"myKey": "myValue"
},
"holdTime": 3600
}'
Response parameters
| Parameter | Type | Description |
|---|---|---|
| holdId | string | Holding request ID |
| status | string | Holding request execution status The following values are available: «NEW» - New holding request accepted «CREATE_SUCCESS» - Holding successful «CREATE_PENDING» - Holding request is pending «CREATE_ERROR» - Error occurred during holding request «CONFIRM_SUCCESS» - Withdrawal completed successfully «CONFIRM_PENDING» - Withdrawal process pending «CONFIRM_ERROR» - Error during withdrawal «CANCEL_SUCCESS» - Holding cancellation completed successfully «CANCEL_PENDING» - Cancellation process pending «CANCEL_ERROR» - Error while canceling holding «EXPIRED» - Holding period has expired |
Example response if successful
{
"data": {
"holdId": "phl_2RW4uL2eTpbCqyUjw9mZEOUgVYY",
"status": "NEW"
}
}
Example response in case of error
{
"status": {
"code": "1234",
"message": "Error while executing the request"
},
"error": {
"path": "URL Path",
"message": {
"uz": "Error message in Uzbek",
"ru": "Error message in Russian",
"en": "Error message in English"
}
}
}