lianja / Razorpay APIs / Modify Transfer Settlement Hold
Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loHttp = createobject("CkHttp")
loHttp.BasicAuth = .T.
loHttp.Login = "username"
loHttp.Password = "password"
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "on_hold": 1,
// "on_hold_until": 1979691505
// }
loJson = createobject("CkJsonObject")
loJson.UpdateInt("on_hold",1)
loJson.UpdateInt("on_hold_until",1979691505)
loHttp.SetRequestHeader("content-type","application/json")
loSbRequestBody = createobject("CkStringBuilder")
loJson.EmitSb(loSbRequestBody)
loResp = loHttp.PTextSb("PATCH","https://api.razorpay.com/v1/transfers/{trf_id}",loSbRequestBody,"utf-8","application/json",.F.,.F.)
if (loHttp.LastMethodSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
release loJson
release loSbRequestBody
return
endif
? str(loResp.StatusCode)
? loResp.BodyStr
release loResp
release loHttp
release loJson
release loSbRequestBody
Curl Command
curl -X PATCH
-u 'username:password'
-H "content-type: application/json"
-d '{
"on_hold": 1,
"on_hold_until": 1979691505
}'
https://api.razorpay.com/v1/transfers/{trf_id}
Postman Collection Item JSON
{
"name": "Modify Transfer Settlement Hold",
"request": {
"method": "PATCH",
"header": [
{
"key": "content-type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"on_hold\": 1,\n \"on_hold_until\": 1979691505\n}"
},
"url": {
"raw": "https://api.razorpay.com/v1/transfers/{trf_id}",
"protocol": "https",
"host": [
"api",
"razorpay",
"com"
],
"path": [
"v1",
"transfers",
"{trf_id}"
]
},
"description": "Use this [API](https://razorpay.com/docs/api/route/#modify-settlement-hold-for-transfers) to modify the settlement configuration for a particular `transfer_id`. On a successful request, the API responds with the modified transfer entity."
},
"response": [
]
}