Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
reserves
Create Reserve
curl --request POST \
  --url https://api.cadanapay.com/v1/businesses/{businessId}/reserves \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": "LOCK",
  "type": "SECURITY_DEPOSIT",
  "personId": "550e8400-e29b-41d4-a716-446655440000",
  "amount": {
    "value": "10.00",
    "currency": "USD"
  },
  "idempotencyKey": "550e8400-e29b-41d4-a716-446655440002",
  "description": "Security deposit for new employee"
}
'
import requests

url = "https://api.cadanapay.com/v1/businesses/{businessId}/reserves"

payload = {
"action": "LOCK",
"type": "SECURITY_DEPOSIT",
"personId": "550e8400-e29b-41d4-a716-446655440000",
"amount": {
"value": "10.00",
"currency": "USD"
},
"idempotencyKey": "550e8400-e29b-41d4-a716-446655440002",
"description": "Security deposit for new employee"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'LOCK',
type: 'SECURITY_DEPOSIT',
personId: '550e8400-e29b-41d4-a716-446655440000',
amount: {value: '10.00', currency: 'USD'},
idempotencyKey: '550e8400-e29b-41d4-a716-446655440002',
description: 'Security deposit for new employee'
})
};

fetch('https://api.cadanapay.com/v1/businesses/{businessId}/reserves', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadanapay.com/v1/businesses/{businessId}/reserves",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'LOCK',
'type' => 'SECURITY_DEPOSIT',
'personId' => '550e8400-e29b-41d4-a716-446655440000',
'amount' => [
'value' => '10.00',
'currency' => 'USD'
],
'idempotencyKey' => '550e8400-e29b-41d4-a716-446655440002',
'description' => 'Security deposit for new employee'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.cadanapay.com/v1/businesses/{businessId}/reserves"

payload := strings.NewReader("{\n \"action\": \"LOCK\",\n \"type\": \"SECURITY_DEPOSIT\",\n \"personId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": {\n \"value\": \"10.00\",\n \"currency\": \"USD\"\n },\n \"idempotencyKey\": \"550e8400-e29b-41d4-a716-446655440002\",\n \"description\": \"Security deposit for new employee\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.cadanapay.com/v1/businesses/{businessId}/reserves")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"LOCK\",\n \"type\": \"SECURITY_DEPOSIT\",\n \"personId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": {\n \"value\": \"10.00\",\n \"currency\": \"USD\"\n },\n \"idempotencyKey\": \"550e8400-e29b-41d4-a716-446655440002\",\n \"description\": \"Security deposit for new employee\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cadanapay.com/v1/businesses/{businessId}/reserves")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"LOCK\",\n \"type\": \"SECURITY_DEPOSIT\",\n \"personId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"amount\": {\n \"value\": \"10.00\",\n \"currency\": \"USD\"\n },\n \"idempotencyKey\": \"550e8400-e29b-41d4-a716-446655440002\",\n \"description\": \"Security deposit for new employee\"\n}"

response = http.request(request)
puts response.read_body
{
  "disbursementId": "550e8400-e29b-41d4-a716-446655440001"
}
{
"code": "invalid_request_body",
"message": "The request body provided is not valid",
"params": {
"field": "Value is invalid."
}
}
{
"code": "resource_not_found",
"message": "Requested resource could not be found."
}
{
"code": "internal_error",
"message": "An unexpected error occurred. Please try again later."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-MultiTenantKey
string

Required when using a Platform API token. The tenant key identifying which business to operate on.

Path Parameters

businessId
string
required

The unique identifier for the business

Body

application/json
action
enum<string>
required

The reserve action to perform

Available options:
LOCK,
RELEASE
Example:

"LOCK"

type
enum<string>
required

The type of reserve

Available options:
SECURITY_DEPOSIT,
SEVERANCE,
NOTICE_PERIOD
Example:

"SECURITY_DEPOSIT"

personId
string<uuid>
required

The person this reserve is for

Example:

"550e8400-e29b-41d4-a716-446655440000"

amount
object
required
idempotencyKey
string<uuid>
required

Idempotency key for the request

Example:

"550e8400-e29b-41d4-a716-446655440002"

description
string
required

Description of the reserve action

Example:

"Security deposit for new employee"

Response

reserve action response

disbursementId
string<uuid>

The ID of the created disbursement

Example:

"550e8400-e29b-41d4-a716-446655440001"