curl --request POST \
--url https://{tenant}.oclucrm.com/api/v1/expenses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Current-Org-Id: <current-org-id>' \
--data '
{
"cashbox_id": 1,
"expense_category_id": 6,
"amount": 1500.5,
"date": "2026-09-30",
"payment_method_id": 4,
"comment": "Luz de septiembre",
"cotization": 1452.25
}
'import requests
url = "https://{tenant}.oclucrm.com/api/v1/expenses"
payload = {
"cashbox_id": 1,
"expense_category_id": 6,
"amount": 1500.5,
"date": "2026-09-30",
"payment_method_id": 4,
"comment": "Luz de septiembre",
"cotization": 1452.25
}
headers = {
"Current-Org-Id": "<current-org-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Current-Org-Id': '<current-org-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cashbox_id: 1,
expense_category_id: 6,
amount: 1500.5,
date: '2026-09-30',
payment_method_id: 4,
comment: 'Luz de septiembre',
cotization: 1452.25
})
};
fetch('https://{tenant}.oclucrm.com/api/v1/expenses', 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://{tenant}.oclucrm.com/api/v1/expenses",
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([
'cashbox_id' => 1,
'expense_category_id' => 6,
'amount' => 1500.5,
'date' => '2026-09-30',
'payment_method_id' => 4,
'comment' => 'Luz de septiembre',
'cotization' => 1452.25
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Current-Org-Id: <current-org-id>"
],
]);
$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://{tenant}.oclucrm.com/api/v1/expenses"
payload := strings.NewReader("{\n \"cashbox_id\": 1,\n \"expense_category_id\": 6,\n \"amount\": 1500.5,\n \"date\": \"2026-09-30\",\n \"payment_method_id\": 4,\n \"comment\": \"Luz de septiembre\",\n \"cotization\": 1452.25\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Current-Org-Id", "<current-org-id>")
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://{tenant}.oclucrm.com/api/v1/expenses")
.header("Current-Org-Id", "<current-org-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cashbox_id\": 1,\n \"expense_category_id\": 6,\n \"amount\": 1500.5,\n \"date\": \"2026-09-30\",\n \"payment_method_id\": 4,\n \"comment\": \"Luz de septiembre\",\n \"cotization\": 1452.25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.oclucrm.com/api/v1/expenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Current-Org-Id"] = '<current-org-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cashbox_id\": 1,\n \"expense_category_id\": 6,\n \"amount\": 1500.5,\n \"date\": \"2026-09-30\",\n \"payment_method_id\": 4,\n \"comment\": \"Luz de septiembre\",\n \"cotization\": 1452.25\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 21,
"date": "2026-09-30",
"amount": 1500.5,
"currency_code": "ARS",
"cotization": 1452.25,
"comment": "Luz de septiembre",
"has_receipt": false,
"expense_category": {
"id": 123,
"name": "<string>"
},
"cashbox": {
"id": 123,
"name": "<string>"
},
"payment_method_id": 4,
"created_at": "2026-09-30 16:02:18"
}
}{
"error": {}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Registrar gasto
Requiere permiso write. Registra un egreso que sale de una caja o banco y se imputa a una categoría de gasto, igual que en Tesorería → Gastos. La caja y la categoría tienen que ser de la misma divisa. Para adjuntar el comprobante, mandá el pedido como multipart/form-data.
curl --request POST \
--url https://{tenant}.oclucrm.com/api/v1/expenses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Current-Org-Id: <current-org-id>' \
--data '
{
"cashbox_id": 1,
"expense_category_id": 6,
"amount": 1500.5,
"date": "2026-09-30",
"payment_method_id": 4,
"comment": "Luz de septiembre",
"cotization": 1452.25
}
'import requests
url = "https://{tenant}.oclucrm.com/api/v1/expenses"
payload = {
"cashbox_id": 1,
"expense_category_id": 6,
"amount": 1500.5,
"date": "2026-09-30",
"payment_method_id": 4,
"comment": "Luz de septiembre",
"cotization": 1452.25
}
headers = {
"Current-Org-Id": "<current-org-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Current-Org-Id': '<current-org-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cashbox_id: 1,
expense_category_id: 6,
amount: 1500.5,
date: '2026-09-30',
payment_method_id: 4,
comment: 'Luz de septiembre',
cotization: 1452.25
})
};
fetch('https://{tenant}.oclucrm.com/api/v1/expenses', 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://{tenant}.oclucrm.com/api/v1/expenses",
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([
'cashbox_id' => 1,
'expense_category_id' => 6,
'amount' => 1500.5,
'date' => '2026-09-30',
'payment_method_id' => 4,
'comment' => 'Luz de septiembre',
'cotization' => 1452.25
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Current-Org-Id: <current-org-id>"
],
]);
$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://{tenant}.oclucrm.com/api/v1/expenses"
payload := strings.NewReader("{\n \"cashbox_id\": 1,\n \"expense_category_id\": 6,\n \"amount\": 1500.5,\n \"date\": \"2026-09-30\",\n \"payment_method_id\": 4,\n \"comment\": \"Luz de septiembre\",\n \"cotization\": 1452.25\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Current-Org-Id", "<current-org-id>")
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://{tenant}.oclucrm.com/api/v1/expenses")
.header("Current-Org-Id", "<current-org-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cashbox_id\": 1,\n \"expense_category_id\": 6,\n \"amount\": 1500.5,\n \"date\": \"2026-09-30\",\n \"payment_method_id\": 4,\n \"comment\": \"Luz de septiembre\",\n \"cotization\": 1452.25\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.oclucrm.com/api/v1/expenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Current-Org-Id"] = '<current-org-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cashbox_id\": 1,\n \"expense_category_id\": 6,\n \"amount\": 1500.5,\n \"date\": \"2026-09-30\",\n \"payment_method_id\": 4,\n \"comment\": \"Luz de septiembre\",\n \"cotization\": 1452.25\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 21,
"date": "2026-09-30",
"amount": 1500.5,
"currency_code": "ARS",
"cotization": 1452.25,
"comment": "Luz de septiembre",
"has_receipt": false,
"expense_category": {
"id": 123,
"name": "<string>"
},
"cashbox": {
"id": 123,
"name": "<string>"
},
"payment_method_id": 4,
"created_at": "2026-09-30 16:02:18"
}
}{
"error": {}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
API key de la clínica. Header: Authorization: Bearer oclu_live_...
Headers
ID de la sede (ver GET /me)
1
Body
ID de la caja o banco (GET /cashboxes)
1
ID de la categoría de gasto (GET /expense-categories). Misma divisa que la caja.
6
Importe, mayor a 0, en la divisa de la caja
1500.5
Fecha del gasto (YYYY-MM-DD)
"2026-09-30"
Obligatorio si la caja tiene métodos de pago habilitados; tiene que ser uno de ellos
4
1000"Luz de septiembre"
Opcional. Si no se manda, se usa la cotización del día de OCLÜ
1452.25
Response
Creado
Show child attributes
Show child attributes