comunidesk
Documentación

Egresos

Egresos y cuentas por pagar de la comunidad.

type: egreso EntitySet: Egresos App: /finanzas

Probar en Lab

Scopes

  • comunidesk:read
  • comunidesk:write

Endpoints

  • GET /v1/rest/Egresos

    Listar

    Scopes: comunidesk:read

  • GET /v1/rest/Egresos/{id}

    Obtener por id

    Scopes: comunidesk:read

  • POST /v1/rest/Egresos

    Crear

    Scopes: comunidesk:write

  • PATCH /v1/rest/Egresos/{id}

    Actualizar

    Scopes: comunidesk:write

Specs OpenAPI y SOAP

Descarga el contrato del módulo (JSON, YAML o WSDL) para importar en Postman, Insomnia o clientes SOAP.

Ejemplo de request

import Foundation

let oauthToken = "OAUTH_TOKEN"
let userJwt = "USER_JWT"
var req = URLRequest(url: URL(string: "https://gateway.comunidesk.com/v1/rest/Egresos")!)
req.httpMethod = "GET"
req.setValue("Bearer \(oauthToken)", forHTTPHeaderField: "Authorization")
req.setValue("Bearer \(userJwt)", forHTTPHeaderField: "x-comunidesk-user-authorization")
req.setValue("application/json", forHTTPHeaderField: "Accept")

let (data, response) = try await URLSession.shared.data(for: req)
let http = response as! HTTPURLResponse
print(http.statusCode, String(data: data, encoding: .utf8) ?? "")
// scope tipico: comunidesk:read

Apps nativas (iOS / Android)

Después del login, consulta /v1/me/capabilities y muestra solo los módulos disponibles para ese usuario.

import Foundation

let oauthToken = "OAUTH_TOKEN"
let userJwt = "USER_JWT"
var req = URLRequest(url: URL(string: "https://gateway.comunidesk.com/v1/me/capabilities")!)
req.httpMethod = "GET"
req.setValue("Bearer \(oauthToken)", forHTTPHeaderField: "Authorization")
req.setValue("Bearer \(userJwt)", forHTTPHeaderField: "x-comunidesk-user-authorization")

struct CapName: Decodable { let es: String; let en: String }
struct CapModule: Decodable {
  let id: String
  let entitySet: String
  let canRead: Bool
  let canWrite: Bool
  let name: CapName
}
struct Capabilities: Decodable { let modules: [CapModule] }

let (data, _) = try await URLSession.shared.data(for: req)
let caps = try JSONDecoder().decode(Capabilities.self, from: data)
let menu = caps.modules.filter { $0.canRead }
// menu.forEach { print($0.name.es, $0.entitySet) }

Campos de escritura

Campos aceptados en POST/PATCH.

CampoTipoObligatorioEnum
edificioIdstring
conceptostring
descripcionstringNo
tipoEgresostringmantencion | servicio | suministro | administracion | seguro | impuesto | salario | servicio_basico | mejora | fondo_reserva | otro
subcategoriaEgresostringNo
proveedorIdstringNo
montoTotalnumber
numeroCuotasnumber
fechaEmisionstring
fechaVencimientoOriginalstring
beneficiariostring
rutBeneficiariostringNo
datosBancariosobjectNo
numeroFacturastringNo
numeroOrdenComprastringNo
observacionesstringNo
notasInternasstringNo
origenFinanciamientostringNogasto_comun | fondo_reserva | mixto
fondoReservaIdstringNo
fondoReservaNombrestringNo
porcentajeFondoReservanumberNo
montoFondoReservanumberNo
grupoIdstringNo
grupoNombrestringNo
departamentoIdstringNo
departamentoNombrestringNo
esMultaAsociadabooleanNo
multasAsociadasIdsarrayNo
departamentosCargoarrayNo
cuotasarrayNo
estadostringNo
tieneCuotasbooleanNo

Solo lectura: _id, _rev, type, montoPagado, montoRestante, createdAt, updatedAt, createdBy

Portal: developers.comunidesk.com · Gateway: gateway.comunidesk.com