{"openapi":"3.0.3","info":{"title":"360studio API","version":"1.0.0","description":"API para integraciones propias de clientes de 360studio. Usa API keys creadas en Configuración > Integraciones. El business se deriva siempre de la credencial; nunca se acepta business_id aportado por el consumidor. Tickets y cupones requieren x-workspace-id y validan el binding, la herramienta y el entitlement. Liquidaciones requiere settlements:read y permite consultar todo el Business, independientemente del binding de Workspaces. Los secretos sólo se muestran al crear o rotar una credencial. Los ejemplos son ficticios y realistas: reemplaza los IDs, cuentas, fechas, referencias y el prefijo ACA por los de tu entorno. Obtén los IDs de estados de Ticket mediante GET /tickets/configuration; no uses los IDs de ejemplo en producción."},"servers":[{"url":"https://api.360studio.app/v1","description":"360studio API"},{"url":"https://sandbox.api.360studio.app/v1","description":"Sandbox — usa credenciales de stage"}],"tags":[{"name":"Contacts","description":"Directorio transversal del Business."},{"name":"Tickets","description":"Trabajo operativo dentro de un Workspace con Cases habilitado."},{"name":"Payment Coupons","description":"Cupones de pago dentro de un Workspace con Payments habilitado."},{"name":"Settlements","description":"Liquidaciones de recaudo del Business. Solo lectura, sin campos internos de partners."}],"security":[{"BusinessApiKey":[]}],"components":{"securitySchemes":{"BusinessApiKey":{"type":"http","scheme":"bearer","bearerFormat":"studio_test_… / studio_live_…","description":"Envía `Authorization: Bearer <api-key>`. El header x-api-key no está soportado."}},"parameters":{"Id":{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}},"WorkspaceId":{"name":"x-workspace-id","in":"header","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"description":"Workspace autorizado por el binding de la credencial. No puede reemplazarse con workspace_id en el body."},"Page":{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]+$"},"description":"Clave estable del consumidor. Repetir la misma solicitud devuelve el mismo Ticket."}},"schemas":{"Error":{"type":"object","required":["success","error"],"properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"},"code":{"type":"string"},"required_scope":{"type":"string"}}},"ContactCreateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":32},"phone_country_code":{"type":"string","minLength":2,"maxLength":2},"document_type":{"type":"string","minLength":1,"maxLength":32},"document_number":{"type":"string","minLength":1,"maxLength":64},"payment_coupon_code":{"type":"string","minLength":1,"maxLength":14,"pattern":"^[A-Za-z0-9]+$"}},"required":["name"]},"ContactUpdateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":32},"phone_country_code":{"type":"string","minLength":2,"maxLength":2},"document_type":{"type":"string","minLength":1,"maxLength":32},"document_number":{"type":"string","minLength":1,"maxLength":64},"payment_coupon_code":{"type":"string","minLength":1,"maxLength":14,"pattern":"^[A-Za-z0-9]+$"},"clear_email":{"type":"boolean","enum":[true]},"clear_phone":{"type":"boolean","enum":[true]},"clear_document":{"type":"boolean","enum":[true]}}},"ContactSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"contact_external_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"phone_country_code":{"type":"string"},"document_type":{"type":"string"},"document_number":{"type":"string"},"payment_coupon_code":{"type":"string"},"tag_ids":{"type":"array","items":{"type":"string"}},"whatsapp":{"type":"object","properties":{"reachable":{"type":"boolean"},"has_phone":{"type":"boolean"},"username":{"type":"string"},"country_code":{"type":"string"}},"required":["reachable","has_phone"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"custom_fields":{"type":"array","items":{"type":"object","properties":{"field_id":{"type":"string"},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}}]}},"required":["field_id","value"]}}},"required":["_id","business_id","contact_external_id","name","tag_ids","custom_fields"]},"message":{"type":"string"}},"required":["success","data"]},"ContactListSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"contact_external_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"phone_country_code":{"type":"string"},"document_type":{"type":"string"},"document_number":{"type":"string"},"payment_coupon_code":{"type":"string"},"tag_ids":{"type":"array","items":{"type":"string"}},"whatsapp":{"type":"object","properties":{"reachable":{"type":"boolean"},"has_phone":{"type":"boolean"},"username":{"type":"string"},"country_code":{"type":"string"}},"required":["reachable","has_phone"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"custom_fields":{"type":"array","items":{"type":"object","properties":{"field_id":{"type":"string"},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}}]}},"required":["field_id","value"]}}},"required":["_id","business_id","contact_external_id","name","tag_ids","custom_fields"]}},"meta":{"type":"object","properties":{"total":{"type":"number","example":15},"page":{"type":"number","example":1},"limit":{"type":"number","example":10},"total_pages":{"type":"number","example":2}},"required":["total","page","limit","total_pages"]}},"required":["success","data","meta"]},"ContactArchiveSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]},"TicketCreateInput":{"type":"object","properties":{"contact_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"type_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"state_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"title":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"number","minimum":0,"maximum":999999999999.99,"multipleOf":0.01},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"category":{"type":"string","minLength":1,"maxLength":100},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"label_ids":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}},"required":["contact_id","title"],"additionalProperties":false},"TicketUpdateInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"value":{"nullable":true,"type":"number","minimum":0,"maximum":999999999999.99,"multipleOf":0.01},"currency":{"nullable":true,"type":"string","pattern":"^[A-Za-z]{3}$"},"category":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"label_ids":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}},"additionalProperties":false},"TicketTransitionInput":{"type":"object","properties":{"to_state_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"expected_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"idempotency_key":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":80},"closing_summary":{"type":"string","minLength":1,"maxLength":2000},"outcome_reason_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"outcome_reason_note":{"type":"string","minLength":1,"maxLength":2000},"outcome_suggestion_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}},"required":["to_state_id","expected_version","idempotency_key"],"additionalProperties":false},"TicketSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"contact_id":{"type":"string"},"type_id":{"type":"string"},"state_id":{"type":"string"},"title":{"type":"string"},"organization_id":{"type":"string"},"product_id":{"type":"string"},"product_selection_id":{"type":"string"},"product_selection":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"variant_id":{"type":"string"},"sku":{"type":"string"},"product_name":{"type":"string"},"variant_name":{"type":"string"},"quantity":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"unit_price":{"type":"number","minimum":0},"line_total":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["product_id","variant_id","sku","product_name","variant_name","quantity","unit_price","line_total","currency"]}},"total":{"type":"number","minimum":0},"currency":{"type":"string"},"confirmed_at":{"type":"string"}},"required":["lines","total","currency","confirmed_at"]},"order_id":{"type":"string"},"conversation_id":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"category":{"type":"string"},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"label_ids":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"field_id":{"type":"string"},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}}]}},"required":["field_id","value"]}},"responsible_user_id":{"type":"string"},"responsible_team_id":{"type":"string"},"responsible_user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":"string"}},"required":["id","email"]},"responsible_team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","archived"]}},"required":["id","name","status"]},"status":{"type":"string","enum":["open","closed"]},"classification":{"type":"string"},"outcome":{"type":"string","enum":["positive","negative","cancelled","neutral"]},"closing_summary":{"type":"string"},"outcome_reason_id":{"type":"string"},"outcome_reason_snapshot":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["objection","qualification","contactability","competition","operational","other"]},"outcome":{"type":"string","enum":["negative","cancelled","neutral"]}},"required":["code","name","category","outcome"]},"outcome_reason_note":{"type":"string"},"outcome_reason_source":{"type":"string","enum":["manual","assistant","automation"]},"outcome_suggestion_id":{"type":"string"},"outcome_reason_confidence":{"type":"number","minimum":0,"maximum":1},"outcome_reason_evidence_message_ids":{"type":"array","items":{"type":"string"}},"objection_occurrence_id":{"type":"string"},"source":{"type":"string","enum":["manual","inbound_message","assistant","automation","handoff","form","calendar","products"]},"payment_coupon_id":{"type":"string"},"payment_status":{"type":"string","enum":["active","paid","voided"]},"payment_paid_at":{"type":"string"},"closed_at":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"created_by":{"type":"string"},"created_by_kind":{"type":"string","enum":["business_user","business_api_key"]},"updated_by":{"type":"string"},"updated_by_kind":{"type":"string","enum":["business_user","business_api_key"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"attribution":{"type":"object","properties":{"first_touch":{"type":"object","properties":{"_id":{"type":"string"},"source":{"type":"string","enum":["direct","organic","paid","referral","social","email","partner","offline","other"]},"medium":{"type":"string"},"campaign":{"type":"string"},"channel":{"type":"string"},"external_source_ref":{"type":"string"},"external_campaign_ref":{"type":"string"},"occurred_at":{"type":"string"}},"required":["_id","source","occurred_at"]},"last_touch":{"type":"object","properties":{"_id":{"type":"string"},"source":{"type":"string","enum":["direct","organic","paid","referral","social","email","partner","offline","other"]},"medium":{"type":"string"},"campaign":{"type":"string"},"channel":{"type":"string"},"external_source_ref":{"type":"string"},"external_campaign_ref":{"type":"string"},"occurred_at":{"type":"string"}},"required":["_id","source","occurred_at"]}},"required":["first_touch","last_touch"]}},"required":["_id","business_id","workspace_id","contact_id","type_id","state_id","title","status","source","version","created_by","created_by_kind"]},"message":{"type":"string"}},"required":["success","data"]},"TicketListSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"contact_id":{"type":"string"},"type_id":{"type":"string"},"state_id":{"type":"string"},"title":{"type":"string"},"organization_id":{"type":"string"},"product_id":{"type":"string"},"product_selection_id":{"type":"string"},"product_selection":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"variant_id":{"type":"string"},"sku":{"type":"string"},"product_name":{"type":"string"},"variant_name":{"type":"string"},"quantity":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"unit_price":{"type":"number","minimum":0},"line_total":{"type":"number","minimum":0},"currency":{"type":"string"}},"required":["product_id","variant_id","sku","product_name","variant_name","quantity","unit_price","line_total","currency"]}},"total":{"type":"number","minimum":0},"currency":{"type":"string"},"confirmed_at":{"type":"string"}},"required":["lines","total","currency","confirmed_at"]},"order_id":{"type":"string"},"conversation_id":{"type":"string"},"value":{"type":"number"},"currency":{"type":"string"},"category":{"type":"string"},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"label_ids":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"field_id":{"type":"string"},"value":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}}]}},"required":["field_id","value"]}},"responsible_user_id":{"type":"string"},"responsible_team_id":{"type":"string"},"responsible_user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"display_name":{"type":"string"}},"required":["id","email"]},"responsible_team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","archived"]}},"required":["id","name","status"]},"status":{"type":"string","enum":["open","closed"]},"classification":{"type":"string"},"outcome":{"type":"string","enum":["positive","negative","cancelled","neutral"]},"closing_summary":{"type":"string"},"outcome_reason_id":{"type":"string"},"outcome_reason_snapshot":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["objection","qualification","contactability","competition","operational","other"]},"outcome":{"type":"string","enum":["negative","cancelled","neutral"]}},"required":["code","name","category","outcome"]},"outcome_reason_note":{"type":"string"},"outcome_reason_source":{"type":"string","enum":["manual","assistant","automation"]},"outcome_suggestion_id":{"type":"string"},"outcome_reason_confidence":{"type":"number","minimum":0,"maximum":1},"outcome_reason_evidence_message_ids":{"type":"array","items":{"type":"string"}},"objection_occurrence_id":{"type":"string"},"source":{"type":"string","enum":["manual","inbound_message","assistant","automation","handoff","form","calendar","products"]},"payment_coupon_id":{"type":"string"},"payment_status":{"type":"string","enum":["active","paid","voided"]},"payment_paid_at":{"type":"string"},"closed_at":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"created_by":{"type":"string"},"created_by_kind":{"type":"string","enum":["business_user","business_api_key"]},"updated_by":{"type":"string"},"updated_by_kind":{"type":"string","enum":["business_user","business_api_key"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"attribution":{"type":"object","properties":{"first_touch":{"type":"object","properties":{"_id":{"type":"string"},"source":{"type":"string","enum":["direct","organic","paid","referral","social","email","partner","offline","other"]},"medium":{"type":"string"},"campaign":{"type":"string"},"channel":{"type":"string"},"external_source_ref":{"type":"string"},"external_campaign_ref":{"type":"string"},"occurred_at":{"type":"string"}},"required":["_id","source","occurred_at"]},"last_touch":{"type":"object","properties":{"_id":{"type":"string"},"source":{"type":"string","enum":["direct","organic","paid","referral","social","email","partner","offline","other"]},"medium":{"type":"string"},"campaign":{"type":"string"},"channel":{"type":"string"},"external_source_ref":{"type":"string"},"external_campaign_ref":{"type":"string"},"occurred_at":{"type":"string"}},"required":["_id","source","occurred_at"]}},"required":["first_touch","last_touch"]}},"required":["_id","business_id","workspace_id","contact_id","type_id","state_id","title","status","source","version","created_by","created_by_kind"]}},"meta":{"type":"object","properties":{"total":{"type":"number","example":15},"page":{"type":"number","example":1},"limit":{"type":"number","example":10},"total_pages":{"type":"number","example":2}},"required":["total","page","limit","total_pages"]}},"required":["success","data","meta"]},"TicketTransitionSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"transition":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"case_id":{"type":"string"},"from_state_id":{"type":"string"},"to_state_id":{"type":"string"},"actor_kind":{"type":"string","enum":["business_user","business_api_key"]},"actor_id":{"type":"string"},"origin":{"type":"string","enum":["manual","assistant","automation"]},"correlation_id":{"type":"string"},"causation_id":{"type":"string"},"idempotency_key":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":80},"from_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"to_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"resulting_status":{"type":"string","enum":["open","closed"]},"resulting_classification":{"type":"string"},"resulting_outcome":{"type":"string","enum":["positive","negative","cancelled","neutral"]},"resulting_order_id":{"type":"string"},"closing_summary":{"type":"string"},"outcome_reason_id":{"type":"string"},"outcome_reason_snapshot":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["objection","qualification","contactability","competition","operational","other"]},"outcome":{"type":"string","enum":["negative","cancelled","neutral"]}},"required":["code","name","category","outcome"]},"outcome_reason_note":{"type":"string"},"outcome_reason_source":{"type":"string","enum":["manual","assistant","automation"]},"outcome_suggestion_id":{"type":"string"},"outcome_reason_confidence":{"type":"number","minimum":0,"maximum":1},"outcome_reason_evidence_message_ids":{"type":"array","items":{"type":"string"}},"objection_occurrence_id":{"type":"string"},"occurred_at":{"type":"string"},"created_at":{"type":"string"}},"required":["_id","business_id","workspace_id","case_id","from_state_id","to_state_id","actor_kind","actor_id","origin","idempotency_key","from_version","to_version","resulting_status","occurred_at"]},"idempotent_replay":{"type":"boolean"}},"required":["transition","idempotent_replay"]},"message":{"type":"string"}},"required":["success","data"]},"TicketTransitionListSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"case_id":{"type":"string"},"from_state_id":{"type":"string"},"to_state_id":{"type":"string"},"actor_kind":{"type":"string","enum":["business_user","business_api_key"]},"actor_id":{"type":"string"},"origin":{"type":"string","enum":["manual","assistant","automation"]},"correlation_id":{"type":"string"},"causation_id":{"type":"string"},"idempotency_key":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","minLength":1,"maxLength":80},"from_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"to_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"resulting_status":{"type":"string","enum":["open","closed"]},"resulting_classification":{"type":"string"},"resulting_outcome":{"type":"string","enum":["positive","negative","cancelled","neutral"]},"resulting_order_id":{"type":"string"},"closing_summary":{"type":"string"},"outcome_reason_id":{"type":"string"},"outcome_reason_snapshot":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["objection","qualification","contactability","competition","operational","other"]},"outcome":{"type":"string","enum":["negative","cancelled","neutral"]}},"required":["code","name","category","outcome"]},"outcome_reason_note":{"type":"string"},"outcome_reason_source":{"type":"string","enum":["manual","assistant","automation"]},"outcome_suggestion_id":{"type":"string"},"outcome_reason_confidence":{"type":"number","minimum":0,"maximum":1},"outcome_reason_evidence_message_ids":{"type":"array","items":{"type":"string"}},"objection_occurrence_id":{"type":"string"},"occurred_at":{"type":"string"},"created_at":{"type":"string"}},"required":["_id","business_id","workspace_id","case_id","from_state_id","to_state_id","actor_kind","actor_id","origin","idempotency_key","from_version","to_version","resulting_status","occurred_at"]}},"meta":{"type":"object","properties":{"total":{"type":"number","example":15},"page":{"type":"number","example":1},"limit":{"type":"number","example":10},"total_pages":{"type":"number","example":2}},"required":["total","page","limit","total_pages"]}},"required":["success","data","meta"]},"TicketConfigurationSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"icon":{"type":"string"},"is_default":{"type":"boolean"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","business_id","workspace_id","name","is_default","created_by"]}},"labels":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","business_id","workspace_id","name","created_by"]}},"states":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"state_type":{"type":"string","enum":["open","terminal"]},"terminal_classification":{"type":"string","minLength":1,"maxLength":80},"terminal_outcome":{"type":"string","enum":["positive","negative","cancelled","neutral"]},"requires_outcome_reason":{"type":"boolean"},"entry_action":{"type":"string","enum":["create_order"]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"is_default":{"type":"boolean"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"supports_api_key_transition":{"type":"boolean"}},"required":["_id","business_id","workspace_id","name","position","state_type","is_default","created_by","supports_api_key_transition"]}},"outcome_reasons":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"workspace_id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["objection","qualification","contactability","competition","operational","other"]},"applies_to_outcomes":{"type":"array","items":{"type":"string","enum":["negative","cancelled","neutral"]}},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"requires_note":{"type":"boolean"},"ai_guidance":{"type":"string"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","business_id","workspace_id","code","name","category","applies_to_outcomes","position","requires_note","created_by"]}}},"required":["types","labels","states","outcome_reasons"]}},"required":["success","data"]},"PaymentCouponCreateInput":{"type":"object","properties":{"contact_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"organization_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"customer_name":{"type":"string","minLength":1,"maxLength":200},"payment_coupon_code":{"type":"string","minLength":1,"maxLength":14,"pattern":"^[A-Za-z0-9]+$"},"amount":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":999999999999.99,"multipleOf":0.01},"currency":{"type":"string","enum":["PEN"],"description":"360Pay opera actualmente solo en soles peruanos (PEN)."},"external_ref":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","minLength":1,"maxLength":500},"expiry_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["amount","external_ref","expiry_date"],"additionalProperties":false},"PaymentCouponUpdateInput":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"expiry_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"additionalProperties":false},"PaymentCouponSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"workspace_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"contact_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"organization_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"amount":{"type":"number"},"currency":{"type":"string","enum":["PEN"],"description":"360Pay opera actualmente solo en soles peruanos (PEN)."},"description":{"type":"string"},"status":{"type":"string","enum":["active","pending_confirmation","paid","voided"]},"external_ref":{"type":"string"},"payment_coupon_code":{"type":"string"},"payment_reference":{"type":"string","minLength":1,"maxLength":14},"bank_transaction_id":{"type":"string","description":"Identificador de la transacción de pago informado por el banco. Es un string y conserva ceros iniciales. Puede compartirse entre cupones pagados en una misma operación. Se omite si no está registrado; no es payment_reference ni el identificador del abono de la liquidación.","example":"0001234567","readOnly":true},"operation_number":{"type":"string","description":"Número de operación adicional cuando la integración lo registra explícitamente. Se omite si no está disponible; no se infiere de bank_transaction_id ni de payment_reference. Conserva ceros iniciales.","example":"0009876543","readOnly":true},"issue_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expiry_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"payment_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"paid_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","amount","currency","status","payment_reference"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"PaymentCouponMutationSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"workspace_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"contact_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"organization_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"amount":{"type":"number"},"currency":{"type":"string","enum":["PEN"],"description":"360Pay opera actualmente solo en soles peruanos (PEN)."},"description":{"type":"string"},"status":{"type":"string","enum":["active","pending_confirmation","paid","voided"]},"external_ref":{"type":"string"},"payment_coupon_code":{"type":"string"},"payment_reference":{"type":"string","minLength":1,"maxLength":14},"bank_transaction_id":{"type":"string","description":"Identificador de la transacción de pago informado por el banco. Es un string y conserva ceros iniciales. Puede compartirse entre cupones pagados en una misma operación. Se omite si no está registrado; no es payment_reference ni el identificador del abono de la liquidación.","example":"0001234567","readOnly":true},"operation_number":{"type":"string","description":"Número de operación adicional cuando la integración lo registra explícitamente. Se omite si no está disponible; no se infiere de bank_transaction_id ni de payment_reference. Conserva ceros iniciales.","example":"0009876543","readOnly":true},"issue_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expiry_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"payment_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"paid_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","amount","currency","status","payment_reference"],"additionalProperties":false},"meta":{"type":"object","properties":{"idempotent_replay":{"type":"boolean"}},"required":["idempotent_replay"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false},"PaymentCouponListSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"workspace_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"contact_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"organization_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"amount":{"type":"number"},"currency":{"type":"string","enum":["PEN"],"description":"360Pay opera actualmente solo en soles peruanos (PEN)."},"description":{"type":"string"},"status":{"type":"string","enum":["active","pending_confirmation","paid","voided"]},"external_ref":{"type":"string"},"payment_coupon_code":{"type":"string"},"payment_reference":{"type":"string","minLength":1,"maxLength":14},"bank_transaction_id":{"type":"string","description":"Identificador de la transacción de pago informado por el banco. Es un string y conserva ceros iniciales. Puede compartirse entre cupones pagados en una misma operación. Se omite si no está registrado; no es payment_reference ni el identificador del abono de la liquidación.","example":"0001234567","readOnly":true},"operation_number":{"type":"string","description":"Número de operación adicional cuando la integración lo registra explícitamente. Se omite si no está disponible; no se infiere de bank_transaction_id ni de payment_reference. Conserva ceros iniciales.","example":"0009876543","readOnly":true},"issue_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"expiry_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"payment_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"paid_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","amount","currency","status","payment_reference"],"additionalProperties":false}},"meta":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100},"total_pages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["total","page","limit","total_pages"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false},"SettlementSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"destination_account":{"type":"string"},"destination_bank":{"type":"string"},"payment_coupons_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"total_amount":{"type":"number"},"commission_amount":{"type":"number"},"total_paid":{"type":"number"},"currency":{"type":"string","enum":["PEN"]},"status":{"type":"string","enum":["IN_PROCESS","COMPLETED","REJECTED"]},"transaction_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"bank_transaction_id":{"type":"string"},"batch_id":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","destination_account","destination_bank","payment_coupons_count","total_amount","commission_amount","total_paid","currency","status"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"SettlementListSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"destination_account":{"type":"string"},"destination_bank":{"type":"string"},"payment_coupons_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"total_amount":{"type":"number"},"commission_amount":{"type":"number"},"total_paid":{"type":"number"},"currency":{"type":"string","enum":["PEN"]},"status":{"type":"string","enum":["IN_PROCESS","COMPLETED","REJECTED"]},"transaction_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"bank_transaction_id":{"type":"string"},"batch_id":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","destination_account","destination_bank","payment_coupons_count","total_amount","commission_amount","total_paid","currency","status"],"additionalProperties":false}},"meta":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100},"total_pages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["total","page","limit","total_pages"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false},"SettlementCouponListSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"settlement_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"workspace_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"amount":{"type":"number"},"currency":{"type":"string","enum":["PEN"]},"status":{"type":"string","enum":["active","pending_confirmation","paid","voided"]},"payment_coupon_code":{"type":"string"},"payment_reference":{"type":"string"},"bank_transaction_id":{"type":"string","description":"Identificador de la transacción de pago informado por el banco. Es un string y conserva ceros iniciales. Puede compartirse entre cupones pagados en una misma operación. Se omite si no está registrado; no es payment_reference ni el identificador del abono de la liquidación.","example":"0001234567","readOnly":true},"operation_number":{"type":"string","description":"Número de operación adicional cuando la integración lo registra explícitamente. Se omite si no está disponible; no se infiere de bank_transaction_id ni de payment_reference. Conserva ceros iniciales.","example":"0009876543","readOnly":true},"external_ref":{"type":"string"},"payment_date":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"paid_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","settlement_id","amount","currency","status"],"additionalProperties":false}},"meta":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"page":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100},"total_pages":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["total","page","limit","total_pages"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false}},"responses":{"BadRequest":{"description":"Solicitud inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"API key ausente, inválida, revocada o vencida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Scope, binding, herramienta o entitlement insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Recurso inexistente dentro del scope autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Conflicto de versión o idempotencia.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Límite de solicitudes excedido; revisa Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/contacts":{"get":{"operationId":"listContacts","summary":"Listar contactos","tags":["Contacts"],"x-360studio-scope":"contacts:read","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListSuccess"},"example":{"success":true,"data":[{"_id":"690000000000000000000001","business_id":"690000000000000000000006","contact_external_id":"690000000000000000000001","name":"María Torres (ejemplo)","email":"maria.torres@example.com","payment_coupon_code":"ACA000042","tag_ids":[],"custom_fields":[],"created_at":"2030-09-01T14:00:00.000Z"}],"meta":{"total":1,"page":1,"limit":20,"total_pages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createContact","summary":"Crear contacto","tags":["Contacts"],"x-360studio-scope":"contacts:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactCreateInput"},"example":{"name":"María Torres (ejemplo)","email":"maria.torres@example.com","payment_coupon_code":"ACA000042"}}}},"responses":{"201":{"description":"Recurso creado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000001","business_id":"690000000000000000000006","contact_external_id":"690000000000000000000001","name":"María Torres (ejemplo)","email":"maria.torres@example.com","payment_coupon_code":"ACA000042","tag_ids":[],"custom_fields":[],"created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/search":{"get":{"operationId":"searchContacts","summary":"Buscar contactos","tags":["Contacts"],"x-360studio-scope":"contacts:read","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"},{"name":"q","in":"query","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListSuccess"},"example":{"success":true,"data":[{"_id":"690000000000000000000001","business_id":"690000000000000000000006","contact_external_id":"690000000000000000000001","name":"María Torres (ejemplo)","email":"maria.torres@example.com","payment_coupon_code":"ACA000042","tag_ids":[],"custom_fields":[],"created_at":"2030-09-01T14:00:00.000Z"}],"meta":{"total":1,"page":1,"limit":20,"total_pages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{id}":{"get":{"operationId":"getContact","summary":"Obtener contacto","tags":["Contacts"],"x-360studio-scope":"contacts:read","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000001","business_id":"690000000000000000000006","contact_external_id":"690000000000000000000001","name":"María Torres (ejemplo)","email":"maria.torres@example.com","payment_coupon_code":"ACA000042","tag_ids":[],"custom_fields":[],"created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateContact","summary":"Actualizar contacto","tags":["Contacts"],"x-360studio-scope":"contacts:write","parameters":[{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactUpdateInput"},"example":{"name":"María Torres (ejemplo)","email":"maria.torres@example.com"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000001","business_id":"690000000000000000000006","contact_external_id":"690000000000000000000001","name":"María Torres (ejemplo)","email":"maria.torres@example.com","payment_coupon_code":"ACA000042","tag_ids":[],"custom_fields":[],"created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"operationId":"archiveContact","summary":"Archivar contacto","tags":["Contacts"],"x-360studio-scope":"contacts:write","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactArchiveSuccess"},"example":{"success":true,"message":"Contact archived"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/tickets/configuration":{"get":{"operationId":"getTicketConfiguration","summary":"Consultar tipos, estados, etiquetas y motivos","tags":["Tickets"],"x-360studio-scope":"tickets:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketConfigurationSuccess"},"example":{"success":true,"data":{"types":[{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000008","name":"Soporte","is_default":true}],"states":[{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000009","name":"Nuevo","position":0,"state_type":"open","is_default":true,"supports_api_key_transition":true},{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000005","name":"En atención","position":1,"state_type":"open","is_default":false,"supports_api_key_transition":true}],"labels":[],"outcome_reasons":[]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/tickets":{"get":{"operationId":"listTickets","summary":"Listar Tickets","tags":["Tickets"],"x-360studio-scope":"tickets:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketListSuccess"},"example":{"success":true,"data":[{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000010","contact_id":"690000000000000000000001","type_id":"690000000000000000000008","state_id":"690000000000000000000009","title":"Consulta sobre matrícula de septiembre","status":"open","source":"manual","version":1,"created_by_kind":"business_api_key","created_at":"2030-09-01T14:00:00.000Z"}],"meta":{"total":1,"page":1,"limit":20,"total_pages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createTicket","summary":"Crear Ticket idempotente","tags":["Tickets"],"x-360studio-scope":"tickets:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCreateInput"},"example":{"contact_id":"690000000000000000000001","title":"Consulta sobre matrícula de septiembre","priority":"normal"}}}},"responses":{"201":{"description":"Recurso creado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSuccess"},"example":{"success":true,"data":{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000010","contact_id":"690000000000000000000001","type_id":"690000000000000000000008","state_id":"690000000000000000000009","title":"Consulta sobre matrícula de septiembre","status":"open","source":"manual","version":1,"created_by_kind":"business_api_key","created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/tickets/{id}":{"get":{"operationId":"getTicket","summary":"Obtener Ticket","tags":["Tickets"],"x-360studio-scope":"tickets:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSuccess"},"example":{"success":true,"data":{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000010","contact_id":"690000000000000000000001","type_id":"690000000000000000000008","state_id":"690000000000000000000009","title":"Consulta sobre matrícula de septiembre","status":"open","source":"manual","version":1,"created_by_kind":"business_api_key","created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updateTicket","summary":"Actualizar Ticket","tags":["Tickets"],"x-360studio-scope":"tickets:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketUpdateInput"},"example":{"title":"Matrícula de septiembre: documentos recibidos","priority":"high"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketSuccess"},"example":{"success":true,"data":{"business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","created_by":"690000000000000000000007","_id":"690000000000000000000010","contact_id":"690000000000000000000001","type_id":"690000000000000000000008","state_id":"690000000000000000000009","title":"Consulta sobre matrícula de septiembre","status":"open","source":"manual","version":1,"created_by_kind":"business_api_key","created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/tickets/{id}/transitions":{"get":{"operationId":"listTicketTransitions","summary":"Listar transiciones","tags":["Tickets"],"x-360studio-scope":"tickets:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Id"},{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTransitionListSuccess"},"example":{"success":true,"data":[{"_id":"690000000000000000000011","business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","case_id":"690000000000000000000010","from_state_id":"690000000000000000000009","to_state_id":"690000000000000000000005","actor_kind":"business_api_key","actor_id":"690000000000000000000007","origin":"manual","idempotency_key":"7e328a69-fef1-4c2e-8d27-e9dd04a8f921","from_version":1,"to_version":2,"resulting_status":"open","occurred_at":"2030-09-01T14:05:00.000Z"}],"meta":{"total":1,"page":1,"limit":20,"total_pages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"transitionTicket","summary":"Transicionar Ticket de forma idempotente","tags":["Tickets"],"x-360studio-scope":"tickets:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTransitionInput"},"example":{"to_state_id":"690000000000000000000005","expected_version":1,"idempotency_key":"7e328a69-fef1-4c2e-8d27-e9dd04a8f921"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketTransitionSuccess"},"example":{"success":true,"data":{"transition":{"_id":"690000000000000000000011","business_id":"690000000000000000000006","workspace_id":"690000000000000000000002","case_id":"690000000000000000000010","from_state_id":"690000000000000000000009","to_state_id":"690000000000000000000005","actor_kind":"business_api_key","actor_id":"690000000000000000000007","origin":"manual","idempotency_key":"7e328a69-fef1-4c2e-8d27-e9dd04a8f921","from_version":1,"to_version":2,"resulting_status":"open","occurred_at":"2030-09-01T14:05:00.000Z"},"idempotent_replay":false}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/payment-coupons":{"get":{"operationId":"listPaymentCoupons","summary":"Listar cupones de pago","tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponListSuccess"},"example":{"success":true,"data":[{"id":"690000000000000000000003","workspace_id":"690000000000000000000002","contact_id":"690000000000000000000001","amount":150,"currency":"PEN","description":"Academia Horizonte — mensualidad de septiembre","status":"paid","external_ref":"MENSUALIDAD-2030-09-00042","payment_coupon_code":"ACA000042","payment_reference":"A1B2C3D4E5F6G7","issue_date":"2030-09-01T14:00:00.000Z","expiry_date":"2030-09-30T23:59:59.000Z","created_at":"2030-09-01T14:00:00.000Z","bank_transaction_id":"0001234567","payment_date":"2030-09-02T16:30:00.000Z","paid_at":"2030-09-02T16:30:05.000Z"}],"meta":{"total":1,"page":1,"limit":20,"total_pages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"createPaymentCoupon","summary":"Crear cupón idempotente por external_ref","description":"contact_id es opcional. Sin él, se busca un contacto activo del Business por payment_coupon_code (normalizado a mayúsculas); si no existe, se crea con customer_name o, si se omite, con el código como nombre. No se modifican los datos de un contacto existente. Con contact_id, el contacto debe pertenecer al Business y su código debe coincidir o estar aún vacío; no se permite cambiar un código ya asignado. Basta payment_coupons:write para esta creación limitada del contacto. El código debe comenzar con el prefijo de recaudo asignado al Business. external_ref identifica el cobro dentro del Workspace: reutilizarlo con los mismos datos devuelve 200; con otros datos, 409. customer_name solo se usa al crear el contacto y no altera un replay. expiry_date debe estar en el futuro. La creación del contacto tiene su propia transacción durable; si después falla la emisión, el contacto puede permanecer y se reutiliza al reintentar. Un código reservado por un contacto archivado devuelve 409.","tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponCreateInput"},"example":{"payment_coupon_code":"ACA000042","customer_name":"María Torres (ejemplo)","amount":150,"currency":"PEN","external_ref":"MENSUALIDAD-2030-09-00042","description":"Academia Horizonte — mensualidad de septiembre","expiry_date":"2030-09-30T23:59:59.000Z"}}}},"responses":{"200":{"description":"Replay idempotente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponMutationSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000003","workspace_id":"690000000000000000000002","contact_id":"690000000000000000000001","amount":150,"currency":"PEN","description":"Academia Horizonte — mensualidad de septiembre","status":"active","external_ref":"MENSUALIDAD-2030-09-00042","payment_coupon_code":"ACA000042","payment_reference":"A1B2C3D4E5F6G7","issue_date":"2030-09-01T14:00:00.000Z","expiry_date":"2030-09-30T23:59:59.000Z","created_at":"2030-09-01T14:00:00.000Z"},"meta":{"idempotent_replay":true}}}}},"201":{"description":"Recurso creado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponMutationSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000003","workspace_id":"690000000000000000000002","contact_id":"690000000000000000000001","amount":150,"currency":"PEN","description":"Academia Horizonte — mensualidad de septiembre","status":"active","external_ref":"MENSUALIDAD-2030-09-00042","payment_coupon_code":"ACA000042","payment_reference":"A1B2C3D4E5F6G7","issue_date":"2030-09-01T14:00:00.000Z","expiry_date":"2030-09-30T23:59:59.000Z","created_at":"2030-09-01T14:00:00.000Z"},"meta":{"idempotent_replay":false}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/payment-coupons/{id}":{"get":{"operationId":"getPaymentCoupon","summary":"Obtener cupón de pago","description":"bank_transaction_id identifica el pago informado por el banco; operation_number se incluye solo cuando se registra por separado. Ambos son de solo lectura, conservan ceros iniciales y se omiten si no están disponibles. payment_reference identifica el cupón antes del pago y no es el número de transacción bancaria.","tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000003","workspace_id":"690000000000000000000002","contact_id":"690000000000000000000001","amount":150,"currency":"PEN","description":"Academia Horizonte — mensualidad de septiembre","status":"paid","external_ref":"MENSUALIDAD-2030-09-00042","payment_coupon_code":"ACA000042","payment_reference":"A1B2C3D4E5F6G7","issue_date":"2030-09-01T14:00:00.000Z","expiry_date":"2030-09-30T23:59:59.000Z","created_at":"2030-09-01T14:00:00.000Z","bank_transaction_id":"0001234567","payment_date":"2030-09-02T16:30:00.000Z","paid_at":"2030-09-02T16:30:05.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"operationId":"updatePaymentCoupon","summary":"Actualizar un cupón activo","tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponUpdateInput"},"example":{"description":"Mensualidad de septiembre — plazo ampliado","expiry_date":"2030-10-05T23:59:59.000Z"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000003","workspace_id":"690000000000000000000002","contact_id":"690000000000000000000001","amount":150,"currency":"PEN","description":"Academia Horizonte — mensualidad de septiembre","status":"active","external_ref":"MENSUALIDAD-2030-09-00042","payment_coupon_code":"ACA000042","payment_reference":"A1B2C3D4E5F6G7","issue_date":"2030-09-01T14:00:00.000Z","expiry_date":"2030-09-30T23:59:59.000Z","created_at":"2030-09-01T14:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/settlements":{"get":{"operationId":"listSettlements","summary":"Listar liquidaciones","description":"Consulta el Business de la credencial, sin x-workspace-id. Orden: created_at descendente, luego id descendente. status usa IN_PROCESS, COMPLETED o REJECTED; batch_id filtra por coincidencia exacta. total_amount es el importe recaudado, commission_amount la comisión del Business y total_paid el importe neto. Los importes están expresados en soles, no céntimos. COMPLETED confirma la liquidación; los otros estados no confirman un abono.","tags":["Settlements"],"x-360studio-scope":"settlements:read","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"},{"name":"status","in":"query","schema":{"type":"string","enum":["IN_PROCESS","COMPLETED","REJECTED"]},"example":"COMPLETED"},{"name":"batch_id","in":"query","schema":{"type":"string","maxLength":160},"example":"LOTE-20300902-001"}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementListSuccess"},"example":{"success":true,"data":[{"id":"690000000000000000000004","destination_account":"19100000000001","destination_bank":"BCP","payment_coupons_count":10,"total_amount":1500,"commission_amount":45,"total_paid":1455,"currency":"PEN","status":"COMPLETED","transaction_date":"2030-09-03T15:30:00.000Z","bank_transaction_id":"DEMO-ABONO-20300903-001","batch_id":"LOTE-20300902-001","created_at":"2030-09-03T14:00:00.000Z","updated_at":"2030-09-03T15:30:00.000Z"}],"meta":{"total":1,"page":1,"limit":20,"total_pages":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/settlements/{id}":{"get":{"operationId":"getSettlement","summary":"Obtener liquidación","description":"Devuelve 404 si el ID no existe o pertenece a otro Business. No requiere x-workspace-id.","tags":["Settlements"],"x-360studio-scope":"settlements:read","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000004","destination_account":"19100000000001","destination_bank":"BCP","payment_coupons_count":10,"total_amount":1500,"commission_amount":45,"total_paid":1455,"currency":"PEN","status":"COMPLETED","transaction_date":"2030-09-03T15:30:00.000Z","bank_transaction_id":"DEMO-ABONO-20300903-001","batch_id":"LOTE-20300902-001","created_at":"2030-09-03T14:00:00.000Z","updated_at":"2030-09-03T15:30:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/settlements/{id}/payment-coupons":{"get":{"operationId":"listSettlementPaymentCoupons","summary":"Listar cupones de una liquidación","description":"Desglose financiero de todos los cupones asociados a la liquidación del Business de la credencial. Requiere únicamente settlements:read; no requiere payment_coupons:read ni x-workspace-id. El binding de Workspaces y el header x-workspace-id no filtran este desglose: incluye historial de Workspaces archivados o con Pagos deshabilitado, y cupones archivados que sigan asociados. No concede acceso operativo al cupón ni expone datos personales del contacto o comisiones internas. amount está expresado en soles, no céntimos. Orden: created_at descendente, luego id descendente. page inicia en 1; limit permite 1–100 (20 por defecto). Devuelve data vacía si no hay cupones o la página excede el total, y 404 si la liquidación no existe o pertenece a otro Business. El estado del cupón no confirma el abono: consulta el estado de la liquidación. El ejemplo muestra la primera página (limit=1) de diez mensualidades de S/ 150 de Academia Horizonte.","tags":["Settlements"],"x-360studio-scope":"settlements:read","parameters":[{"$ref":"#/components/parameters/Id"},{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Página de resultados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementCouponListSuccess"},"example":{"success":true,"data":[{"id":"690000000000000000000003","settlement_id":"690000000000000000000004","workspace_id":"690000000000000000000002","amount":150,"currency":"PEN","status":"paid","payment_coupon_code":"ACA000042","payment_reference":"A1B2C3D4E5F6G7","bank_transaction_id":"0001234567","external_ref":"MENSUALIDAD-2030-09-00042","payment_date":"2030-09-02T16:30:00.000Z","paid_at":"2030-09-02T16:30:05.000Z"}],"meta":{"total":10,"page":1,"limit":1,"total_pages":10}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}