{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Fint API","description":"Fint API"},"servers":[{"url":"https://api.fint.app/api/v1","variables":{}}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{},"parameters":{}},"paths":{"/":{"get":{"description":"Verificación de salud de la Api Key","summary":"Verificación de salud de la Api Key","security":[{"ApiKeyAuth":[]}],"tags":["Health"],"responses":{"200":{"description":"Api Key health check","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/webhook":{"post":{"summary":"Crear un nuevo webhook","description":"Crear un nuevo webhook","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["payment.created","payment.voided","payment.chargeback","contact.status","contact.active","contact.inactive","subscription.created","subscription.updated","subscription.cancelled"]},"minItems":1},"externalReference":{"type":"string"}},"required":["url","events"]}}}},"responses":{"201":{"description":"Webhook creado con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}},"400":{"description":"Solicitud incorrecta, datos de entrada no válidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}},"get":{"summary":"Obtener lista de webhooks","description":"Obtener lista de webhooks","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"responses":{"200":{"description":"Webhooks recuperados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"url":{"type":"string"},"active":{"type":"boolean"},"events":{"type":"array","items":{"type":"string","enum":["payment.created","payment.voided","payment.chargeback","contact.status","contact.active","contact.inactive","subscription.created","subscription.updated","subscription.cancelled"]}},"createdAt":{"type":"string"},"externalReference":{"type":"string","nullable":true}},"required":["id","url","active","events","createdAt","externalReference"]}}},"required":["webhooks"]}}}},"400":{"description":"Solicitud incorrecta, parámetros de consulta no válidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/webhook/:webhookId":{"get":{"summary":"Obtener webhook por ID","description":"Obtener detalles del webhook por ID","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"webhookId","in":"path"}],"responses":{"200":{"description":"Webhook recuperado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"url":{"type":"string"},"active":{"type":"boolean"},"events":{"type":"array","items":{"type":"string","enum":["payment.created","payment.voided","payment.chargeback","contact.status","contact.active","contact.inactive","subscription.created","subscription.updated","subscription.cancelled"]}},"createdAt":{"type":"string"},"externalReference":{"type":"string","nullable":true}},"required":["id","url","active","events","createdAt","externalReference"]}}}},"404":{"description":"Webhook no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}},"put":{"summary":"Actualizar webhook por ID","description":"Actualizar detalles del webhook por ID","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"webhookId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["payment.created","payment.voided","payment.chargeback","contact.status","contact.active","contact.inactive","subscription.created","subscription.updated","subscription.cancelled"]},"minItems":1},"active":{"type":"boolean"}},"required":["url","events","active"]}}}},"responses":{"200":{"description":"Webhook actualizado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"400":{"description":"Solicitud incorrecta, datos de entrada no válidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"404":{"description":"Webhook no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}},"delete":{"summary":"Eliminar webhook por ID","description":"Eliminar un webhook específico por su ID","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"webhookId","in":"path"}],"responses":{"200":{"description":"Webhook eliminado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Webhook no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/webhook/:webhookId/replay-missed-payments":{"post":{"summary":"Reenviar webhooks faltantes de pagos","description":"Busca pagos de la organizacion desde una fecha que no tengan log payment.created para este webhook y los reencola","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"webhookId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string"}},"required":["startDate"]}}}},"responses":{"200":{"description":"Webhooks de pago reencolados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"webhookId":{"type":"number"},"replayedCount":{"type":"number"},"paymentIds":{"type":"array","items":{"type":"number"}},"startDate":{"type":"string"}},"required":["message","webhookId","replayedCount","paymentIds","startDate"]}}}},"400":{"description":"Solicitud incorrecta, datos de entrada no válidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"404":{"description":"Webhook no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/webhook/log":{"get":{"summary":"Obtener lista de registros de webhook","description":"Registro de cada webhook que se ha enviado en su respectivo estado y evento el cual lo generó","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"number","nullable":true,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["success","error","ongoing"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Registros de webhook recuperados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"webhookId":{"type":"number"},"status":{"type":"string","enum":["success","error","ongoing"]},"createdAt":{"type":"string"},"currentAttempt":{"type":"number"},"maxAttempts":{"type":"number"},"event":{"type":"string","enum":["payment.created","payment.voided","payment.chargeback","contact.status","contact.active","contact.inactive","subscription.created","subscription.updated","subscription.cancelled"]},"url":{"type":"string"},"lastAttempt":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["success","error","ongoing"]},"request":{"nullable":true},"response":{"type":"string","nullable":true},"createdAt":{"type":"string"},"attempt":{"type":"number"}},"required":["status","response","createdAt","attempt"]}},"required":["id","webhookId","status","createdAt","currentAttempt","maxAttempts","event","url","lastAttempt"]}},"total":{"type":"number"},"totalPages":{"type":"number"},"currentPage":{"type":"number"},"limit":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["data","total","totalPages","currentPage","limit","hasNextPage","hasPreviousPage"]}},"required":["logs"]}}}},"400":{"description":"Solicitud incorrecta, parámetros de consulta no válidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/webhook/log/:webhookLogId":{"get":{"summary":"Obtener registro de webhook por ID","description":"Obtener detalles del registro de webhook por ID","security":[{"ApiKeyAuth":[]}],"tags":["Webhook"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"webhookLogId","in":"path"}],"responses":{"200":{"description":"Registro de webhook recuperado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"webhookId":{"type":"number"},"status":{"type":"string","enum":["success","error","ongoing"]},"createdAt":{"type":"string"},"currentAttempt":{"type":"number"},"maxAttempts":{"type":"number"},"event":{"type":"string","enum":["payment.created","payment.voided","payment.chargeback","contact.status","contact.active","contact.inactive","subscription.created","subscription.updated","subscription.cancelled"]},"url":{"type":"string"},"attempts":{"type":"array","nullable":true,"items":{"type":"object","properties":{"status":{"type":"string","enum":["success","error","ongoing"]},"request":{"nullable":true},"response":{"type":"string","nullable":true},"createdAt":{"type":"string"},"attempt":{"type":"number"}},"required":["status","response","createdAt","attempt"]}}},"required":["id","webhookId","status","createdAt","currentAttempt","maxAttempts","event","url","attempts"]}}}},"404":{"description":"Registro de webhook no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/payment/:paymentId":{"get":{"summary":"Obtener pago por ID","description":"Obtener detalles de pago por ID","security":[{"ApiKeyAuth":[]}],"tags":["Pagos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"paymentId","in":"path"}],"responses":{"200":{"description":"Pago recuperado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"date":{"type":"string"},"status":{"type":"string","enum":["PAID","VOIDED","CHARGEBACK"]},"method":{"type":"string","enum":["DEBIT_CARD","CREDIT_CARD","DIRECT_DEBIT","CARD","PAGO_FACIL","RAPI_PAGO","PAGO_MIS_CUENTAS","LINK_PAGO","TRANSFER","CASH","MERCADO_PAGO","MERCADO_PAGO_POINT","SIRO"]},"totalAmount":{"type":"string"},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"documentType":{"type":"string","nullable":true},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"externalReference":{"type":"string","nullable":true}},"required":["id","name","lastName","documentType","documentNumber","address","externalReference"]}},"descriptions":{"type":"array","items":{"type":"string"}},"auditUser":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","lastName","email"]},"isManual":{"type":"boolean"},"payerContact":{"type":"object","nullable":true,"properties":{"id":{"type":"number","nullable":true},"name":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"whatsappNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"documentType":{"type":"string","nullable":true},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}},"required":["id","name","lastName","phoneNumber","whatsappNumber","email","documentType","documentNumber","address"]}},"required":["id","date","status","method","totalAmount","contacts","auditUser","isManual","payerContact"]}}}},"404":{"description":"Pago no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Payment not found"}}}}}}},"/contact":{"post":{"summary":"Crear un nuevo contacto","description":"Crear un nuevo contacto","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"externalReference":{"type":"string"},"name":{"type":"string"},"lastName":{"type":"string"},"documentType":{"type":"string","enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string"},"email":{"type":"string","format":"email"},"phoneNumber":{"type":"string"},"address":{"type":"string"},"country":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Informacion adicional que luego se puede consumir y llegara en los webhooks"},"payerContact":{"type":"object","properties":{"name":{"type":"string"},"lastName":{"type":"string"},"documentType":{"type":"string","enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string"},"email":{"type":"string","format":"email"},"phoneNumber":{"type":"string"},"address":{"type":"string"},"country":{"type":"string"}},"required":["name","lastName","documentType","documentNumber","email","phoneNumber"]},"tagGroup":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"sendPortalInvite":{"type":"boolean","default":true}},"required":["name","lastName"]}}}},"responses":{"201":{"description":"Contacto creado con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}},"400":{"description":"Solicitud incorrecta, datos de entrada no válidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}},"get":{"summary":"Obtener contactos paginados","description":"Obtener contactos paginados","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"number","nullable":true,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"document","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"number"}},"required":false,"name":"tagIds","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"includeAllTags","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"includeAllItems","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"active","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"number"}},"required":false,"name":"itemIds","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["ACCOUNT_OPENED","NOT_DUE","PAST_DUE","ACCOUNT_SETTLED"]}},"required":false,"name":"statuses","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"object","properties":{"customFieldId":{"type":"number"},"value":{"type":"string"},"operation":{"type":"string","enum":["=","<=","<",">",">=","like"],"default":"like"}},"required":["customFieldId","value"]}},"required":false,"name":"customFieldFilters","in":"query"}],"responses":{"200":{"description":"Contactos recuperados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"createdAt":{"type":"string"},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"age":{"type":"number","nullable":true},"phoneNumber":{"type":"string","nullable":true},"mobileNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"hasSiblings":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"group":{"type":"boolean"},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"required":["id","name","color","icon"]}},"required":["id","name","color","icon","group","parent"]}},"active":{"type":"boolean"},"activeStatus":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","active"]},"status":{"type":"string","enum":["ACCOUNT_OPENED","NOT_DUE","PAST_DUE","ACCOUNT_SETTLED"]},"items":{"type":"array","items":{"type":"number"}},"hash":{"type":"string","nullable":true},"customFieldValues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"fieldLabel":{"type":"string"},"fieldType":{"type":"string","enum":["text","select","multiselect","checkbox","number","date","phone-number","country","currency"]},"value":{"type":"string","nullable":true},"optionId":{"type":"number","nullable":true},"wasRequired":{"type":"boolean"}},"required":["id","customFieldId","fieldLabel","fieldType","value","optionId","wasRequired"]}}},"required":["id","name","lastName","createdAt","documentType","documentNumber","address","country","birthDate","age","phoneNumber","mobileNumber","email","hasSiblings","tags","active","activeStatus","status","items","hash","customFieldValues"]}},"total":{"type":"number"},"totalPages":{"type":"number"},"currentPage":{"type":"number"},"limit":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["data","total","totalPages","currentPage","limit","hasNextPage","hasPreviousPage"]}}},"required":["data"]}}}}}}},"/contact/:contactId":{"get":{"summary":"Obtener contacto por ID","description":"Obtener detalles de contacto por ID","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"contactId","in":"path"}],"responses":{"200":{"description":"Contacto recuperado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"createdAt":{"type":"string"},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"age":{"type":"number","nullable":true},"phoneNumber":{"type":"string","nullable":true},"mobileNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"hasSiblings":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"group":{"type":"boolean"},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"required":["id","name","color","icon"]}},"required":["id","name","color","icon","group","parent"]}},"active":{"type":"boolean"},"activeStatus":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","active"]},"siblings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"group":{"type":"boolean"},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"required":["id","name","color","icon"]}},"required":["id","name","color","icon","group","parent"]}}},"required":["id","name","lastName","tags"]}},"familyMembers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"type":{"type":"string"},"notify":{"type":"boolean"},"name":{"type":"string"},"lastName":{"type":"string"},"hash":{"type":"string","nullable":true},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"whatsappNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"portalUrl":{"type":"string"}},"required":["id","type","notify","name","lastName","hash","documentType","documentNumber","address","city","province","phoneNumber","whatsappNumber","email","portalUrl"]}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"amount":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","draft"]},"type":{"type":"string","enum":["credit","debit","mora"]},"frequencyType":{"type":"string","enum":["one_time","monthly","annually"]},"startDate":{"type":"string","nullable":true},"collectionCycles":{"type":"number","default":1},"generateInterestForLatePayment":{"type":"boolean","default":false},"moraDetails":{"type":"array","items":{"type":"object","properties":{"fromDay":{"type":"number"},"untilDay":{"type":"number"},"percentage":{"type":"string"},"daysToApply":{"type":"number","description":"Days to apply the interest"},"interestCalculated":{"type":"string","description":"Interest calculated for the mora"},"interestType":{"type":"string","enum":["FIXED","PERCENTAGE"]},"itemId":{"type":"number"},"configId":{"type":"number"},"baseAmount":{"type":"string"}},"required":["fromDay","untilDay","percentage","daysToApply","interestCalculated","interestType","itemId","configId","baseAmount"]}},"useCase":{"type":"string","enum":["subscription","settlement","event"]},"isIndefinite":{"type":"boolean"},"condition":{"type":"string","enum":["all","some","all_except","none"]},"amountType":{"type":"string","enum":["fixed","percentage"]},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"amount":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","draft"]},"type":{"type":"string","enum":["credit","debit","mora"]},"frequencyType":{"type":"string","enum":["one_time","monthly","annually"]},"startDate":{"type":"string"},"collectionCycles":{"type":"number","default":1}},"required":["id","name","amount","description","status","type","frequencyType","startDate"]}},"originalAmount":{"type":"string"},"imageUrl":{"type":"string","nullable":true}},"required":["id","name","amount","description","status","type","frequencyType","startDate","useCase","isIndefinite","condition","amountType","conditionItems","originalAmount","imageUrl"]}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"totalAmount":{"type":"string"},"totalPaid":{"type":"string"},"totalPending":{"type":"string"},"totalMora":{"type":"string"},"interestPaid":{"type":"string"},"interestSnapshot":{"type":"string"},"interestSnapshotDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PENDING","PAID","CANCELED","PARTIALLY_PAID","BONIFIED"]},"description":{"type":"string","nullable":true},"date":{"type":"string"},"expirationDate":{"type":"string"},"settlement":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"sentDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","SENDING","SENT","CANCELED"]}},"required":["id","name","sentDate","status"]},"lastPaymentDate":{"type":"string","nullable":true},"paymentMethod":{"type":"string","nullable":true},"isManualPayment":{"type":"boolean"},"uniqueId":{"type":"string","nullable":true},"applyInterest":{"type":"boolean"},"externalReference":{"type":"string","nullable":true}},"required":["id","totalAmount","totalPaid","totalPending","totalMora","interestPaid","interestSnapshot","interestSnapshotDate","status","description","date","expirationDate","settlement","lastPaymentDate","uniqueId","applyInterest","externalReference"]}},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"url":{"type":"string"}},"required":["id","createdAt","url"]}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"note":{"type":"string"},"user":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true}},"required":["id","name","lastName"]},"apiKey":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","createdAt","note","user","apiKey"]}},"teachableCourses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"expiresAt":{"type":"string"},"status":{"type":"string","enum":["ENROLLED","UNENROLLED"]},"teachableCourseId":{"type":"number"}},"required":["id","name","expiresAt","status","teachableCourseId"]}},"reminderEnable":{"type":"boolean"},"status":{"type":"string","enum":["ACCOUNT_OPENED","NOT_DUE","PAST_DUE","ACCOUNT_SETTLED"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"externalReference":{"type":"string","nullable":true},"hash":{"type":"string","nullable":true},"hasActiveSubscriptions":{"type":"boolean"}},"required":["id","name","lastName","createdAt","documentType","documentNumber","address","country","birthDate","age","phoneNumber","mobileNumber","email","hasSiblings","tags","active","activeStatus","reminderEnable","status","metadata","externalReference","hash","hasActiveSubscriptions"]}}}},"404":{"description":"Contacto no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Contact not found"}}}}}},"patch":{"summary":"Actualizar contacto por ID","description":"Actualizar detalles de contacto por ID","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"contactId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"address":{"type":"string"},"documentType":{"type":"string","enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string"},"country":{"type":"string"},"birthDate":{"type":"string"},"age":{"type":"number"},"phoneNumber":{"type":"string"},"mobileNumber":{"type":"string"},"reminderEnabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Informacion adicional que luego se puede consumir y llegara en los webhooks"},"activeStatusId":{"type":"number","description":"Id del estado activo del contacto, con esta opcion podemos activar/desactivar un contacto, los status por defecto son 1 activo y 2 inactivo, luego se pueden agregar mas estados customizables con otro nombre que representen esos estados."}}}}}},"responses":{"200":{"description":"Contacto actualizado con éxito por ID","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Contact updated successfully"}}}},"404":{"description":"Contacto no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Contact not found"}}}}}},"delete":{"summary":"Eliminar contacto por ID","description":"Eliminar el contact eliminara todas las facturas pendientes de pago asociadas al mismo.","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"contactId","in":"path"}],"responses":{"204":{"description":"Contacto eliminado con éxito","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"404":{"description":"Contacto no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Contact not found"}}}}}}},"/contact/external-reference/:externalReference":{"get":{"summary":"Obtener contacto por referencia externa","description":"Obtener detalles de contacto por referencia externa","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"externalReference","in":"path"}],"responses":{"200":{"description":"Contacto recuperado con éxito por referencia externa","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"createdAt":{"type":"string"},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"age":{"type":"number","nullable":true},"phoneNumber":{"type":"string","nullable":true},"mobileNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"hasSiblings":{"type":"boolean"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"group":{"type":"boolean"},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"required":["id","name","color","icon"]}},"required":["id","name","color","icon","group","parent"]}},"active":{"type":"boolean"},"activeStatus":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"active":{"type":"boolean"}},"required":["id","name","active"]},"siblings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"group":{"type":"boolean"},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true}},"required":["id","name","color","icon"]}},"required":["id","name","color","icon","group","parent"]}}},"required":["id","name","lastName","tags"]}},"familyMembers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"type":{"type":"string"},"notify":{"type":"boolean"},"name":{"type":"string"},"lastName":{"type":"string"},"hash":{"type":"string","nullable":true},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"whatsappNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"portalUrl":{"type":"string"}},"required":["id","type","notify","name","lastName","hash","documentType","documentNumber","address","city","province","phoneNumber","whatsappNumber","email","portalUrl"]}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"amount":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","draft"]},"type":{"type":"string","enum":["credit","debit","mora"]},"frequencyType":{"type":"string","enum":["one_time","monthly","annually"]},"startDate":{"type":"string","nullable":true},"collectionCycles":{"type":"number","default":1},"generateInterestForLatePayment":{"type":"boolean","default":false},"moraDetails":{"type":"array","items":{"type":"object","properties":{"fromDay":{"type":"number"},"untilDay":{"type":"number"},"percentage":{"type":"string"},"daysToApply":{"type":"number","description":"Days to apply the interest"},"interestCalculated":{"type":"string","description":"Interest calculated for the mora"},"interestType":{"type":"string","enum":["FIXED","PERCENTAGE"]},"itemId":{"type":"number"},"configId":{"type":"number"},"baseAmount":{"type":"string"}},"required":["fromDay","untilDay","percentage","daysToApply","interestCalculated","interestType","itemId","configId","baseAmount"]}},"useCase":{"type":"string","enum":["subscription","settlement","event"]},"isIndefinite":{"type":"boolean"},"condition":{"type":"string","enum":["all","some","all_except","none"]},"amountType":{"type":"string","enum":["fixed","percentage"]},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"amount":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","draft"]},"type":{"type":"string","enum":["credit","debit","mora"]},"frequencyType":{"type":"string","enum":["one_time","monthly","annually"]},"startDate":{"type":"string"},"collectionCycles":{"type":"number","default":1}},"required":["id","name","amount","description","status","type","frequencyType","startDate"]}},"originalAmount":{"type":"string"},"imageUrl":{"type":"string","nullable":true}},"required":["id","name","amount","description","status","type","frequencyType","startDate","useCase","isIndefinite","condition","amountType","conditionItems","originalAmount","imageUrl"]}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"totalAmount":{"type":"string"},"totalPaid":{"type":"string"},"totalPending":{"type":"string"},"totalMora":{"type":"string"},"interestPaid":{"type":"string"},"interestSnapshot":{"type":"string"},"interestSnapshotDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PENDING","PAID","CANCELED","PARTIALLY_PAID","BONIFIED"]},"description":{"type":"string","nullable":true},"date":{"type":"string"},"expirationDate":{"type":"string"},"settlement":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"sentDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","SENDING","SENT","CANCELED"]}},"required":["id","name","sentDate","status"]},"lastPaymentDate":{"type":"string","nullable":true},"paymentMethod":{"type":"string","nullable":true},"isManualPayment":{"type":"boolean"},"uniqueId":{"type":"string","nullable":true},"applyInterest":{"type":"boolean"},"externalReference":{"type":"string","nullable":true}},"required":["id","totalAmount","totalPaid","totalPending","totalMora","interestPaid","interestSnapshot","interestSnapshotDate","status","description","date","expirationDate","settlement","lastPaymentDate","uniqueId","applyInterest","externalReference"]}},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"url":{"type":"string"}},"required":["id","createdAt","url"]}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"note":{"type":"string"},"user":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true}},"required":["id","name","lastName"]},"apiKey":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","createdAt","note","user","apiKey"]}},"teachableCourses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"expiresAt":{"type":"string"},"status":{"type":"string","enum":["ENROLLED","UNENROLLED"]},"teachableCourseId":{"type":"number"}},"required":["id","name","expiresAt","status","teachableCourseId"]}},"reminderEnable":{"type":"boolean"},"status":{"type":"string","enum":["ACCOUNT_OPENED","NOT_DUE","PAST_DUE","ACCOUNT_SETTLED"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"externalReference":{"type":"string","nullable":true},"hash":{"type":"string","nullable":true},"hasActiveSubscriptions":{"type":"boolean"}},"required":["id","name","lastName","createdAt","documentType","documentNumber","address","country","birthDate","age","phoneNumber","mobileNumber","email","hasSiblings","tags","active","activeStatus","reminderEnable","status","metadata","externalReference","hash","hasActiveSubscriptions"]}}}},"404":{"description":"Contacto no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Contact not found"}}}}}}},"/contact/:contactId/item":{"post":{"summary":"Agregar o eliminar items a un contacto","description":"Agregar o eliminar items a un  contacto, estos items luego se usaran para generar facturas en las liquidaciones","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"contactId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemsToDelete":{"type":"array","items":{"type":"number"}},"itemsToAdd":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":"Items agregados o eliminados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"404":{"description":"Contacto o item no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Contact not found"}}}}}}},"/contact/active/status":{"post":{"summary":"Crear Estado Activo","description":"Permite crear un estado activo nuevo, este puede utilizarse para describir detalladamente la condición actual del contacto y si esta activo o no en la plataforma.","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"}},"required":["name","active"]}}}},"responses":{"201":{"description":"Estado activo creado exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}},"400":{"description":"Solicitud incorrecta, datos de entrada inválidos","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}},"get":{"summary":"Obtener estados activos para contactos","description":"Obtener los posibles estados activos para los contactos, con el id del estado podemos actualizar el contacto para desactivarlo / activarlo","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"responses":{"200":{"description":"Estados activos recuperados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["id","name","description","active"]}}},"required":["data"]}}}}}}},"/contact/document/:document/item":{"post":{"summary":"Agregar o eliminar items a un contacto por documento","description":"Agregar o eliminar items a un contacto por documento, si el contacto no existe no se agregara el item, si existe mas de un contacto con el mismo documento no se agregara el item a ninguno. \n Estos items luego se usaran para generar facturas en las liquidaciones","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"document","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemsToDelete":{"type":"array","items":{"type":"number"}},"itemsToAdd":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":"Items agregados o eliminados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"400":{"description":"Se encontraron mas de un contacto con el mismo documento, no es posible agregar el item a ninguno","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Contacto o item no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Contact not found"}}}}}}},"/contact/document/:document/tag":{"post":{"summary":"Agregar o eliminar tags a un contacto por documento","description":"Agregar o eliminar tags a un contacto por documento, si el contacto no existe o existe mas de un contacto con el mismo documento no se agregara ni eliminara ningun tag. \n Estos tags sirven para clasificar los contactos y luego poder filtrarlos por tags","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"document","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tagsToDelete":{"type":"array","items":{"type":"number"}},"tagsToAdd":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":"Tags agregados o eliminados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"400":{"description":"Se encontraron mas de un contacto con el mismo documento, no es posible agregar o eliminar tags","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Contacto o tag no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Contact not found"}}}}}}},"/contact/:contactId/tag":{"post":{"summary":"Agregar o eliminar tags a un contacto por id","description":"Agregar o eliminar tags a un contacto por id.","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"contactId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tagsToDelete":{"type":"array","items":{"type":"number"}},"tagsToAdd":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":"Tags agregados o eliminados con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Contacto o tag no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Contact not found"}}}}}}},"/contact/:contactId([0-9]+)/note":{"post":{"summary":"Crear una nota para un contacto","description":"Crear una nota para un contacto","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"contactId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string"}},"required":["note"]}}}},"responses":{"200":{"description":"Nota creada exitosamente para el contacto","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}},"404":{"description":"Contacto no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/contact/note/:noteId([0-9]+)":{"delete":{"summary":"Eliminar una nota de un contacto","description":"Eliminar una nota de un contacto","security":[{"ApiKeyAuth":[]}],"tags":["Contactos"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"noteId","in":"path"}],"responses":{"200":{"description":"Nota eliminada exitosamente del contacto","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Nota no encontrada","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/invoice":{"post":{"summary":"Crear una nueva factura","description":"Crear una nueva factura con la posibilidad de crear un contacto nuevo o usar uno existente","security":[{"ApiKeyAuth":[]}],"tags":["Facturas"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"type":"number"},"description":{"type":"string"},"date":{"type":"string"},"totalAmount":{"type":"number","description":"Monto total de la factura, si se envia items el monto va a ser ignorado"},"expirationDate":{"type":"string"},"externalReference":{"type":"string"},"newContact":{"type":"object","properties":{"externalReference":{"type":"string"},"name":{"type":"string"},"lastName":{"type":"string"},"documentType":{"type":"string","enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string"},"email":{"type":"string","format":"email"},"phoneNumber":{"type":"string"},"address":{"type":"string"},"country":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Informacion adicional que luego se puede consumir y llegara en los webhooks"},"payerContact":{"type":"object","properties":{"name":{"type":"string"},"lastName":{"type":"string"},"documentType":{"type":"string","enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string"},"email":{"type":"string","format":"email"},"phoneNumber":{"type":"string"},"address":{"type":"string"},"country":{"type":"string"}},"required":["name","lastName","documentType","documentNumber","email","phoneNumber"]},"tagGroup":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"sendPortalInvite":{"type":"boolean","default":true}},"required":["name","lastName"]},"sendEmail":{"type":"boolean","default":true,"description":"Envía email a los pagadores del contacto con acceso al portal para que page la factura."},"items":{"type":"array","nullable":true,"items":{"type":"object","properties":{"itemId":{"type":"number"},"quantity":{"type":"number","default":1,"description":"Cantidad de items a asociar a la factura"}},"required":["itemId"]},"description":"Items de tipo subscription (one_time) o settlement (condition: none). Todos los items deben tener el mismo useCase. Si items esta presente el totalAmount va a ser autocalculado."},"itemGroups":{"type":"array","nullable":true,"items":{"type":"object","properties":{"itemGroupId":{"type":"number"},"selectedItems":{"type":"array","nullable":true,"items":{"type":"object","properties":{"itemId":{"type":"number"},"quantity":{"type":"number","default":1,"description":"Cantidad de items a asociar a la factura"}},"required":["itemId"]}}},"required":["itemGroupId"]}},"serviceCost":{"type":"object","properties":{"cost":{"type":"number"},"percentage":{"type":"number"}},"required":["cost","percentage"]},"customItems":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"},"type":{"type":"string","enum":["credit","debit"]},"quantity":{"type":"number"},"details":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","enum":["item"]},"discountItemId":{"type":"number"},"amountType":{"type":"string"},"configuredAmount":{"type":"number"},"condition":{"type":"string"},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"baseAmount":{"type":"number","nullable":true},"appliedAmount":{"type":"number"},"maxDiscountAmount":{"type":"number","nullable":true},"cartItems":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"totalAmount":{"type":"number"}},"required":["itemId","totalAmount"]}},"breakdown":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"discountAmount":{"type":"number"}},"required":["itemId","discountAmount"]}}},"required":["source","discountItemId","amountType","configuredAmount","condition","conditionItems","baseAmount","appliedAmount","maxDiscountAmount","cartItems","breakdown"]},{"type":"object","properties":{"source":{"type":"string","enum":["manual"]},"condition":{"type":"string"},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"appliedAmount":{"type":"number"},"cartItems":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"totalAmount":{"type":"number"}},"required":["itemId","totalAmount"]}},"breakdown":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"discountAmount":{"type":"number"}},"required":["itemId","discountAmount"]}}},"required":["source"]}]}},"required":["name","amount","type","quantity"]}}},"required":["date","expirationDate"]}}}},"responses":{"201":{"description":"Factura creada con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"invoiceId":{"type":"number"},"contactId":{"type":"number"}},"required":["invoiceId","contactId"]}}}},"400":{"description":"Bad request, invalid input data","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message. Possible values:\n- \"Item in draft status cannot be added to an invoice\"\n- \"Item of type settlement cannot be added to an invoice manually yet\"\n- \"Item of type recurring cannot be added to an invoice manually yet\"\n- \"Total amount does not match the sum of the items\""}},"required":["message"]}}}},"404":{"description":"Resources not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error message. Format:\n- For items not found: \"Items not found: {itemId1},{itemId2},...\"\n- For single item: \"Item not found\"- For contact not found: \"Contact not found\""}},"required":["message"]}}}}}},"get":{"summary":"Obtener facturas paginadas","description":"Obtener facturas paginadas","security":[{"ApiKeyAuth":[]}],"tags":["Facturas"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"number","nullable":true,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":500},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string","nullable":true},"required":false,"name":"endDate","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"number"}},"required":false,"name":"settlementIds","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"number"}},"required":false,"name":"itemIds","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"includeAllItems","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"number"}},"required":false,"name":"tagIds","in":"query"},{"schema":{"type":"boolean","nullable":true},"required":false,"name":"includeAllTags","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"string","enum":["DRAFT","PENDING","PAID","CANCELED","PARTIALLY_PAID","BONIFIED","CANCELLED","EXPIRED"]}},"required":false,"name":"statuses","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"posPageId","in":"query"},{"schema":{"type":"array","nullable":true,"items":{"type":"object","properties":{"customFieldId":{"type":"number"},"value":{"type":"string"},"operation":{"type":"string","enum":["=","<=","<",">",">=","like"],"default":"like"}},"required":["customFieldId","value"]}},"required":false,"name":"customFieldFilters","in":"query"}],"responses":{"200":{"description":"Facturas paginadas","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"totalAmount":{"type":"string"},"totalPaid":{"type":"string"},"totalPending":{"type":"string"},"totalMora":{"type":"string"},"interestPaid":{"type":"string"},"interestSnapshot":{"type":"string"},"interestSnapshotDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PENDING","PAID","CANCELED","PARTIALLY_PAID","BONIFIED"]},"description":{"type":"string","nullable":true},"date":{"type":"string"},"expirationDate":{"type":"string"},"settlement":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"sentDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","SENDING","SENT","CANCELED"]}},"required":["id","name","sentDate","status"]},"lastPaymentDate":{"type":"string","nullable":true},"paymentMethod":{"type":"string","nullable":true},"isManualPayment":{"type":"boolean"},"uniqueId":{"type":"string","nullable":true},"applyInterest":{"type":"boolean"},"externalReference":{"type":"string","nullable":true},"contact":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true}},"required":["id","name","lastName"]},"source":{"type":"string","enum":["SETTLEMENT","IMPORT","MANUAL","SUBSCRIPTION","EVENT","POS"]},"eventPurchase":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"reference":{"type":"string"},"eventPageId":{"type":"number"},"pdfUrl":{"type":"string","nullable":true}},"required":["id","reference","eventPageId","pdfUrl"]},"customFieldValues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"fieldLabel":{"type":"string"},"fieldType":{"type":"string","enum":["text","select","multiselect","checkbox","number","date","phone-number","country","currency"]},"value":{"type":"string","nullable":true},"optionId":{"type":"number","nullable":true},"wasRequired":{"type":"boolean"}},"required":["id","customFieldId","fieldLabel","fieldType","value","optionId","wasRequired"]}}},"required":["id","totalAmount","totalPaid","totalPending","totalMora","interestPaid","interestSnapshot","interestSnapshotDate","status","description","date","expirationDate","settlement","lastPaymentDate","uniqueId","applyInterest","externalReference","contact","source","eventPurchase","customFieldValues"]}},"total":{"type":"number"},"totalPages":{"type":"number"},"currentPage":{"type":"number"},"limit":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["data","total","totalPages","currentPage","limit","hasNextPage","hasPreviousPage"]}}}}}}},"/invoice/{invoiceId}":{"get":{"summary":"Obtener una factura por ID","description":"Obtener una factura por su ID","security":[{"ApiKeyAuth":[]}],"tags":["Facturas"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"invoiceId","in":"path"}],"responses":{"200":{"description":"Retorna la factura solicitada","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"totalAmount":{"type":"string"},"totalPaid":{"type":"string"},"totalPending":{"type":"string"},"totalMora":{"type":"string"},"interestPaid":{"type":"string"},"interestSnapshot":{"type":"string"},"interestSnapshotDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","PENDING","PAID","CANCELED","PARTIALLY_PAID","BONIFIED"]},"description":{"type":"string","nullable":true},"date":{"type":"string"},"expirationDate":{"type":"string"},"settlement":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"},"sentDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["DRAFT","SENDING","SENT","CANCELED"]}},"required":["id","name","sentDate","status"]},"lastPaymentDate":{"type":"string","nullable":true},"paymentMethod":{"type":"string","nullable":true},"isManualPayment":{"type":"boolean"},"uniqueId":{"type":"string","nullable":true},"applyInterest":{"type":"boolean"},"externalReference":{"type":"string","nullable":true},"contact":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"lastName":{"type":"string","nullable":true},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true}},"required":["id","name","lastName","documentType","documentNumber"]},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"date":{"type":"string"},"status":{"type":"string","enum":["PAID","VOIDED","CHARGEBACK"]},"method":{"type":"string","enum":["DEBIT_CARD","CREDIT_CARD","DIRECT_DEBIT","CARD","PAGO_FACIL","RAPI_PAGO","PAGO_MIS_CUENTAS","LINK_PAGO","TRANSFER","CASH","MERCADO_PAGO","MERCADO_PAGO_POINT","SIRO"]},"totalAmount":{"type":"string"},"isManual":{"type":"boolean"},"reference":{"type":"string","nullable":true}},"required":["id","date","status","method","totalAmount","isManual","reference"]}},"payerContacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"type":{"type":"string"},"notify":{"type":"boolean"},"name":{"type":"string"},"lastName":{"type":"string"},"hash":{"type":"string","nullable":true},"documentType":{"type":"string","nullable":true,"enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"whatsappNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","type","notify","name","lastName","hash","documentType","documentNumber","address","city","province","phoneNumber","whatsappNumber","email"]}},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"url":{"type":"string"},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true}},"required":["id","name","lastName"]}},"required":["id","url","createdAt","user"]}},"activities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"activity":{"type":"string"},"createdAt":{"type":"string"},"type":{"type":"string","enum":["created","payment","payment_attempt","future_reminder","sent_reminder","settlement_sent"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"status":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","status","createdAt"]}},"reminder":{"type":"object","properties":{"id":{"type":"number"},"notificationType":{"type":"string","enum":["whatsapp","email","email-whatsapp"]},"type":{"type":"string","enum":["days_after","same_day","days_before"]},"days":{"type":"number"}},"required":["id","notificationType","type","days"]},"lastStatus":{"type":"string"}},"required":["id","activity","createdAt","type"]}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"amount":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","draft"]},"type":{"type":"string","enum":["credit","debit","mora"]},"frequencyType":{"type":"string","enum":["one_time","monthly","annually"]},"startDate":{"type":"string","nullable":true},"collectionCycles":{"type":"number","default":1},"generateInterestForLatePayment":{"type":"boolean","default":false},"moraDetails":{"type":"array","items":{"type":"object","properties":{"fromDay":{"type":"number"},"untilDay":{"type":"number"},"percentage":{"type":"string"},"daysToApply":{"type":"number","description":"Days to apply the interest"},"interestCalculated":{"type":"string","description":"Interest calculated for the mora"},"interestType":{"type":"string","enum":["FIXED","PERCENTAGE"]},"itemId":{"type":"number"},"configId":{"type":"number"},"baseAmount":{"type":"string"}},"required":["fromDay","untilDay","percentage","daysToApply","interestCalculated","interestType","itemId","configId","baseAmount"]}},"useCase":{"type":"string","enum":["subscription","settlement","event"]},"isIndefinite":{"type":"boolean"},"condition":{"type":"string","enum":["all","some","all_except","none"]},"amountType":{"type":"string","enum":["fixed","percentage"]},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"amount":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","draft"]},"type":{"type":"string","enum":["credit","debit","mora"]},"frequencyType":{"type":"string","enum":["one_time","monthly","annually"]},"startDate":{"type":"string"},"collectionCycles":{"type":"number","default":1}},"required":["id","name","amount","description","status","type","frequencyType","startDate"]}},"originalAmount":{"type":"string"},"imageUrl":{"type":"string","nullable":true},"quantity":{"type":"number"},"teachableCourseId":{"type":"number","nullable":true},"teachableCourseExpiresAt":{"type":"string","nullable":true},"details":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","enum":["item"]},"discountItemId":{"type":"number"},"amountType":{"type":"string"},"configuredAmount":{"type":"number"},"condition":{"type":"string"},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"baseAmount":{"type":"number","nullable":true},"appliedAmount":{"type":"number"},"maxDiscountAmount":{"type":"number","nullable":true},"cartItems":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"totalAmount":{"type":"number"}},"required":["itemId","totalAmount"]}},"breakdown":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"discountAmount":{"type":"number"}},"required":["itemId","discountAmount"]}}},"required":["source","discountItemId","amountType","configuredAmount","condition","conditionItems","baseAmount","appliedAmount","maxDiscountAmount","cartItems","breakdown"]},{"type":"object","properties":{"source":{"type":"string","enum":["manual"]},"condition":{"type":"string"},"conditionItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"appliedAmount":{"type":"number"},"cartItems":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"totalAmount":{"type":"number"}},"required":["itemId","totalAmount"]}},"breakdown":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"discountAmount":{"type":"number"}},"required":["itemId","discountAmount"]}}},"required":["source"]},{"nullable":true}]}},"required":["id","name","amount","description","status","type","frequencyType","startDate","useCase","isIndefinite","condition","amountType","conditionItems","originalAmount","imageUrl","quantity","teachableCourseId","teachableCourseExpiresAt"]}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"note":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true}},"required":["id","name","lastName"]}},"required":["id","createdAt","note","user"]}},"subscriptionId":{"type":"number","nullable":true},"source":{"type":"string","enum":["SETTLEMENT","IMPORT","MANUAL","SUBSCRIPTION","EVENT","POS"]},"serviceCost":{"type":"object","nullable":true,"properties":{"amount":{"type":"string"},"percentage":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["amount","percentage","description"]}},"required":["id","totalAmount","totalPaid","totalPending","totalMora","interestPaid","interestSnapshot","interestSnapshotDate","status","description","date","expirationDate","settlement","lastPaymentDate","uniqueId","applyInterest","externalReference","contact","items","subscriptionId","source","serviceCost"]}}}},"404":{"description":"Factura no encontrada","content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{"message":"Factura no encontrada"}}}}}},"delete":{"summary":"Eliminar una factura","description":"Eliminar una factura por su ID","security":[{"ApiKeyAuth":[]}],"tags":["Facturas"],"parameters":[{"schema":{"type":"number"},"required":true,"name":"invoiceId","in":"path"}],"responses":{"200":{"description":"Factura eliminada con éxito","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Factura eliminada correctamente"}}}},"404":{"description":"Factura no encontrada","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Factura no encontrada"}}}}}}},"/tag":{"post":{"summary":"Crear nueva etiqueta","description":"Crear una nueva etiqueta con la información proporcionada","security":[{"ApiKeyAuth":[]}],"tags":["Etiquetas"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"color":{"type":"string"},"icon":{"type":"string"},"group":{"type":"boolean"},"parentId":{"type":"number"}},"required":["name","color"]}}}},"responses":{"201":{"description":"Etiqueta creada exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}},"400":{"description":"Cuerpo de la solicitud inválido","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}},"required":["message","errors"]}}}}}},"get":{"summary":"Obtener etiquetas paginadas","description":"Recuperar una lista paginada de etiquetas con filtrado y ordenamiento opcional","security":[{"ApiKeyAuth":[]}],"tags":["Etiquetas"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"number","nullable":true,"default":0},"required":false,"name":"page","in":"query"},{"schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Etiquetas recuperadas exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"group":{"type":"boolean"},"contacts":{"type":"number","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string","nullable":true},"icon":{"type":"string","nullable":true},"contacts":{"type":"number"}},"required":["id","name","color","icon","contacts"]}}},"required":["id","name","color","icon","group","contacts","children"]}},"total":{"type":"number"},"totalPages":{"type":"number"},"currentPage":{"type":"number"},"limit":{"type":"number"},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["data","total","totalPages","currentPage","limit","hasNextPage","hasPreviousPage"]}}}},"400":{"description":"Parámetros de consulta inválidos","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}},"required":["message","errors"]}}}}}}},"/mercado-pago/point/device":{"get":{"summary":"Obtener dispositivos Point","description":"Recupera todos los dispositivos Point de Mercado Pago asociados con la organización","security":[{"ApiKeyAuth":[]}],"tags":["Mercado Pago Point"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"store_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pos_id","in":"query"}],"responses":{"200":{"description":"Dispositivos recuperados exitosamente","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"posId":{"type":"number"},"storeId":{"type":"number"},"externalPosId":{"type":"string"},"operatingMode":{"type":"string","enum":["PDV","STANDALONE"]}},"required":["id","posId","storeId","operatingMode"]}}}}},"400":{"description":"Solicitud incorrecta","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/mercado-pago/point/device/:deviceId/payment-intent":{"post":{"summary":"Crear intento de pago para dispositivo Point","description":"Crea un nuevo intento de pago que será procesado por un dispositivo Mercado Pago Point. Puedes seleccionar un contacto existente usando contactId o externalReference, o crear uno nuevo con los datos en newContact.","security":[{"ApiKeyAuth":[]}],"tags":["Mercado Pago Point"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"deviceId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number"},"description":{"type":"string"},"printOnTerminal":{"type":"boolean","default":true},"contactId":{"type":"number"},"invoiceId":{"type":"number"},"eventReference":{"type":"string"},"eventSessionId":{"type":"number"}},"required":["amount","description","contactId"]}}}},"responses":{"200":{"description":"Intento de pago creado exitosamente","content":{"application/json":{"schema":{"nullable":true}}}},"400":{"description":"Solicitud incorrecta o datos inválidos","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/mercado-pago/point/device/:deviceId/mode":{"patch":{"summary":"Establecer modo de operación del dispositivo","description":"Establece el modo de operación para un dispositivo Point específico (e.g., PDV, STANDALONE)","security":[{"ApiKeyAuth":[]}],"tags":["Mercado Pago Point"],"parameters":[{"schema":{"type":"string","description":"ID del dispositivo Mercado Pago Point"},"required":true,"description":"ID del dispositivo Mercado Pago Point","name":"deviceId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["PDV","STANDALONE"],"description":"The desired operating mode for the device (e.g., PDV, STANDALONE)"}},"required":["mode"]}}}},"responses":{"200":{"description":"Modo de operación establecido exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Solicitud incorrecta o datos inválidos","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Dispositivo no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/event/ticket/reference/{reference}":{"get":{"summary":"Obtener ticket de evento por referencia","description":"Obtener información detallada de un ticket de evento usando su referencia única","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"parameters":[{"schema":{"type":"string","description":"Referencia única del ticket","example":"TKT-ABC123"},"required":true,"name":"reference","in":"path"}],"responses":{"200":{"description":"Ticket recuperado exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"invoiceId":{"type":"number"},"buyerFirstName":{"type":"string"},"buyerLastName":{"type":"string"},"buyerDocument":{"type":"string","nullable":true},"buyerEmail":{"type":"string","nullable":true},"buyerPhone":{"type":"string","nullable":true},"totalAmount":{"type":"string"},"eventPageId":{"type":"number"},"pdfUrl":{"type":"string","nullable":true},"reference":{"type":"string"},"createdAt":{"type":"string"},"customFieldResponses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"fieldLabel":{"type":"string"},"fieldType":{"type":"string"},"value":{"type":"string","nullable":true},"optionId":{"type":"number","nullable":true},"wasRequired":{"type":"boolean"}},"required":["id","customFieldId","fieldLabel","fieldType","value","optionId","wasRequired"]}},"eventPage":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"reference":{"type":"string"}},"required":["id","name","reference"]},"attendee":{"type":"object","properties":{"id":{"type":"number"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"document":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"amount":{"type":"string"},"reference":{"type":"string"},"qrUrl":{"type":"string","nullable":true},"generateQr":{"type":"boolean"},"pdfUrl":{"type":"string","nullable":true},"askInformation":{"type":"boolean"},"isAdditional":{"type":"boolean"},"customFieldResponses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"fieldLabel":{"type":"string"},"fieldType":{"type":"string"},"value":{"type":"string","nullable":true},"optionId":{"type":"number","nullable":true},"wasRequired":{"type":"boolean"}},"required":["id","customFieldId","fieldLabel","fieldType","value","optionId","wasRequired"]}},"itemName":{"type":"string"}},"required":["id","firstName","lastName","document","email","status","amount","reference","qrUrl","generateQr","pdfUrl","askInformation","isAdditional","customFieldResponses","itemName"]},"isManual":{"type":"boolean"},"organizationId":{"type":"number"}},"required":["id","invoiceId","buyerFirstName","buyerLastName","buyerDocument","buyerEmail","buyerPhone","totalAmount","eventPageId","pdfUrl","reference","createdAt","customFieldResponses","eventPage","attendee","isManual","organizationId"]}}}},"404":{"description":"Ticket no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}},"put":{"summary":"Actualizar información del asistente del ticket","description":"Actualizar la información del asistente de un ticket de evento, incluyendo datos personales y respuestas a campos personalizados. Permite actualizar campos existentes (con id) y crear nuevas respuestas para campos agregados después de la compra (sin id).","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"parameters":[{"schema":{"type":"string","description":"Referencia única del ticket","example":"TKT-ABC123"},"required":true,"name":"reference","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"document":{"type":"string","nullable":true},"email":{"type":"string","nullable":true,"format":"email"},"status":{"type":"string","nullable":true,"enum":["NOT_ADMITTED","ADMITTED","CANCELLED"]},"customFieldResponses":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"value":{"type":"string"}},"required":["customFieldId","value"]}}},"example":{"firstName":"Juan","lastName":"Pérez","email":"juan.perez@example.com","document":"12345678","status":"ADMITTED","customFieldResponses":[{"id":123,"customFieldId":5,"value":"Vegano"},{"customFieldId":10,"value":"Talla L"},{"customFieldId":12,"value":"42"}]}}}}},"responses":{"200":{"description":"Ticket actualizado exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"invoiceId":{"type":"number"},"buyerFirstName":{"type":"string"},"buyerLastName":{"type":"string"},"buyerDocument":{"type":"string","nullable":true},"buyerEmail":{"type":"string","nullable":true},"buyerPhone":{"type":"string","nullable":true},"totalAmount":{"type":"string"},"eventPageId":{"type":"number"},"pdfUrl":{"type":"string","nullable":true},"reference":{"type":"string"},"createdAt":{"type":"string"},"customFieldResponses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"fieldLabel":{"type":"string"},"fieldType":{"type":"string"},"value":{"type":"string","nullable":true},"optionId":{"type":"number","nullable":true},"wasRequired":{"type":"boolean"}},"required":["id","customFieldId","fieldLabel","fieldType","value","optionId","wasRequired"]}},"eventPage":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"reference":{"type":"string"}},"required":["id","name","reference"]},"attendee":{"type":"object","properties":{"id":{"type":"number"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"document":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"amount":{"type":"string"},"reference":{"type":"string"},"qrUrl":{"type":"string","nullable":true},"generateQr":{"type":"boolean"},"pdfUrl":{"type":"string","nullable":true},"askInformation":{"type":"boolean"},"isAdditional":{"type":"boolean"},"customFieldResponses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"customFieldId":{"type":"number"},"fieldLabel":{"type":"string"},"fieldType":{"type":"string"},"value":{"type":"string","nullable":true},"optionId":{"type":"number","nullable":true},"wasRequired":{"type":"boolean"}},"required":["id","customFieldId","fieldLabel","fieldType","value","optionId","wasRequired"]}},"itemName":{"type":"string"}},"required":["id","firstName","lastName","document","email","status","amount","reference","qrUrl","generateQr","pdfUrl","askInformation","isAdditional","customFieldResponses","itemName"]},"isManual":{"type":"boolean"},"organizationId":{"type":"number"}},"required":["id","invoiceId","buyerFirstName","buyerLastName","buyerDocument","buyerEmail","buyerPhone","totalAmount","eventPageId","pdfUrl","reference","createdAt","customFieldResponses","eventPage","attendee","isManual","organizationId"]}}}},"400":{"description":"Datos de entrada inválidos","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}},"required":["message"]}}}},"404":{"description":"Ticket no encontrado","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/event/ticket/email/{email}":{"get":{"summary":"Buscar tickets por email del asistente","description":"Buscar todos los tickets donde el asistente tiene el email especificado. Útil para que los usuarios puedan encontrar todos sus tickets.","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"parameters":[{"schema":{"type":"string","format":"email","description":"Email del asistente","example":"attendee@example.com"},"required":true,"name":"email","in":"path"}],"responses":{"200":{"description":"Tickets encontrados exitosamente","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"document":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"amount":{"type":"string"},"reference":{"type":"string"},"itemName":{"type":"string"},"qrUrl":{"type":"string","nullable":true},"generateQr":{"type":"boolean"},"pdfUrl":{"type":"string","nullable":true},"purchaseId":{"type":"number"},"purchase":{"type":"object","properties":{"id":{"type":"number"},"reference":{"type":"string"},"buyerFirstName":{"type":"string"},"buyerLastName":{"type":"string"},"buyerEmail":{"type":"string","nullable":true},"totalAmount":{"type":"string"},"createdAt":{"type":"string"},"organizationId":{"type":"number"},"eventPageId":{"type":"number"},"eventPage":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"reference":{"type":"string"}},"required":["id","name","reference"]}},"required":["id","reference","buyerFirstName","buyerLastName","buyerEmail","totalAmount","createdAt","organizationId","eventPageId","eventPage"]}},"required":["id","firstName","lastName","document","email","status","amount","reference","itemName","qrUrl","generateQr","pdfUrl","purchaseId","purchase"]}}}}}}}},"/event/purchase/email/{email}":{"get":{"summary":"Buscar compras por email del comprador","description":"Buscar todas las compras donde el comprador tiene el email especificado. Incluye la lista de asistentes/tickets para cada compra.","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"parameters":[{"schema":{"type":"string","format":"email","description":"Email del comprador","example":"buyer@example.com"},"required":true,"name":"email","in":"path"}],"responses":{"200":{"description":"Compras encontradas exitosamente","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"reference":{"type":"string"},"buyerFirstName":{"type":"string"},"buyerLastName":{"type":"string"},"buyerDocument":{"type":"string","nullable":true},"buyerEmail":{"type":"string","nullable":true},"buyerPhone":{"type":"string","nullable":true},"totalAmount":{"type":"string"},"createdAt":{"type":"string"},"pdfUrl":{"type":"string","nullable":true},"organizationId":{"type":"number"},"eventPageId":{"type":"number"},"eventPage":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"reference":{"type":"string"}},"required":["id","name","reference"]},"attendees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"document":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"amount":{"type":"string"},"reference":{"type":"string"},"itemName":{"type":"string"},"qrUrl":{"type":"string","nullable":true},"generateQr":{"type":"boolean"},"pdfUrl":{"type":"string","nullable":true},"askInformation":{"type":"boolean"},"isAdditional":{"type":"boolean"}},"required":["id","firstName","lastName","document","email","status","amount","reference","itemName","qrUrl","generateQr","pdfUrl","askInformation","isAdditional"]}}},"required":["id","reference","buyerFirstName","buyerLastName","buyerDocument","buyerEmail","buyerPhone","totalAmount","createdAt","pdfUrl","organizationId","eventPageId","eventPage","attendees"]}}}}}}}},"/event/purchase/payment/{paymentId}":{"get":{"summary":"Buscar compras por payment ID","description":"Buscar todas las compras de tickets asociadas a un paymentId. Incluye la lista de asistentes/tickets para cada compra.","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"parameters":[{"schema":{"type":"number","description":"ID del pago","example":1234},"required":true,"name":"paymentId","in":"path"}],"responses":{"200":{"description":"Compras encontradas exitosamente","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"reference":{"type":"string"},"buyerFirstName":{"type":"string"},"buyerLastName":{"type":"string"},"buyerDocument":{"type":"string","nullable":true},"buyerEmail":{"type":"string","nullable":true},"buyerPhone":{"type":"string","nullable":true},"totalAmount":{"type":"string"},"createdAt":{"type":"string"},"pdfUrl":{"type":"string","nullable":true},"organizationId":{"type":"number"},"eventPageId":{"type":"number"},"eventPage":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"reference":{"type":"string"}},"required":["id","name","reference"]},"attendees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"document":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"amount":{"type":"string"},"reference":{"type":"string"},"itemName":{"type":"string"},"qrUrl":{"type":"string","nullable":true},"generateQr":{"type":"boolean"},"pdfUrl":{"type":"string","nullable":true},"askInformation":{"type":"boolean"},"isAdditional":{"type":"boolean"}},"required":["id","firstName","lastName","document","email","status","amount","reference","itemName","qrUrl","generateQr","pdfUrl","askInformation","isAdditional"]}}},"required":["id","reference","buyerFirstName","buyerLastName","buyerDocument","buyerEmail","buyerPhone","totalAmount","createdAt","pdfUrl","organizationId","eventPageId","eventPage","attendees"]}}}}}}}},"/event/checkout/ticket":{"post":{"summary":"Crear tickets manualmente (Admin)","description":"Crear tickets de evento manualmente con información del comprador y asistentes. Este endpoint permite a los administradores crear tickets sin pasar por el proceso de checkout normal.","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"pageId":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"quantity":{"type":"number","minimum":1}},"required":["itemId","quantity"]}},"itemGroups":{"type":"array","items":{"type":"object","properties":{"itemGroupId":{"type":"number"},"selectedItems":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"number"},"quantity":{"type":"number","minimum":1}},"required":["itemId","quantity"]}}},"required":["itemGroupId","selectedItems"]}},"buyer":{"type":"object","properties":{"name":{"type":"string"},"lastName":{"type":"string"},"documentType":{"type":"string","enum":["DNI","CUIT","CUIL","CDI","LE","LC","CI Extranjera","Pasaporte","CI Policía Federal","Certificado de Migración","RUT","Otro"]},"documentNumber":{"type":"string"},"email":{"type":"string","format":"email"},"phoneNumber":{"type":"string"},"address":{"type":"string"},"country":{"type":"string"}},"required":["name","lastName"]},"tickets":{"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"document":{"type":"string"},"email":{"type":"string"},"customFieldResponses":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"number"},"value":{"type":"string"}},"required":["customFieldId","value"]}},"itemId":{"type":"number"},"itemGroupId":{"type":"number"},"groupInstanceId":{"type":"string","description":"Unique ID to identify multiple instances of the same item group in a single purchase"}},"required":["email","itemId"]}},"pageCustomFieldResponses":{"type":"array","items":{"type":"object","properties":{"customFieldId":{"type":"number"},"value":{"type":"string"}},"required":["customFieldId","value"]}},"adminNotes":{"type":"string"},"totalAmount":{"type":"number"},"paymentMethod":{"type":"string","enum":["DEBIT_CARD","CREDIT_CARD","DIRECT_DEBIT","CARD","PAGO_FACIL","RAPI_PAGO","PAGO_MIS_CUENTAS","LINK_PAGO","TRANSFER","CASH","MERCADO_PAGO","MERCADO_PAGO_POINT","SIRO"]},"paymentDate":{"type":"string","nullable":true}},"required":["pageId","buyer","tickets","totalAmount","paymentMethod"],"example":{"pageId":1,"items":[{"itemId":10,"quantity":2}],"buyer":{"name":"Juan","lastName":"Pérez","documentType":"DNI","documentNumber":"12345678","email":"juan.perez@example.com","phoneNumber":"+5491123456789","address":"Calle Falsa 123","country":"Argentina"},"tickets":[{"firstName":"Juan","lastName":"Pérez","document":"12345678","email":"juan.perez@example.com","itemId":10,"customFieldResponses":[{"customFieldId":1,"value":"Vegetariano"}]},{"firstName":"María","lastName":"González","document":"87654321","email":"maria.gonzalez@example.com","itemId":10,"customFieldResponses":[{"customFieldId":1,"value":"Sin restricciones"}]}],"totalAmount":5000,"paymentMethod":"CASH","adminNotes":"Tickets creados manualmente por el administrador"}}}}},"responses":{"201":{"description":"Tickets creados exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"purchase":{"type":"object","properties":{"id":{"type":"number"},"reference":{"type":"string"}},"required":["id","reference"]}},"required":["success","purchase"]}}}},"400":{"description":"Datos de entrada inválidos o error en la creación","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}},"required":["message"]}}}},"404":{"description":"Página de evento no encontrada","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/event/page/{eventPageId}/custom-fields":{"get":{"summary":"Obtener campos personalizados de un evento","description":"Obtener todos los campos personalizados disponibles para un evento. Útil para conocer qué campos se pueden agregar a los tickets.","security":[{"ApiKeyAuth":[]}],"tags":["Eventos"],"parameters":[{"schema":{"type":"number","description":"ID de la página del evento","example":1},"required":true,"name":"eventPageId","in":"path"}],"responses":{"200":{"description":"Campos personalizados recuperados exitosamente","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"eventPageId":{"type":"number"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["text","select","multiselect","checkbox","number","date","phone-number","country"]},"isRequired":{"type":"boolean"},"whoType":{"type":"string","enum":["allItems","page","item"]},"order":{"type":"number"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"value":{"type":"string"},"label":{"type":"string"},"order":{"type":"number"}},"required":["id","value","label","order"]}},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["credit","debit"]},"amount":{"type":"number"},"status":{"type":"string","enum":["active","draft"]}},"required":["id","name","description","type","amount","status"]}},"active":{"type":"boolean"}},"required":["id","eventPageId","label","description","type","isRequired","whoType","order","active"]}}}}},"404":{"description":"Página de evento no encontrada","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}}}}