{"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. Productos, variantes, precios e inventario son globales al Business y no requieren x-workspace-id. 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."},{"name":"Products","description":"Catalogo, variantes y precios globales del Business."},{"name":"Inventory","description":"Stock por ubicacion y ajustes idempotentes del Business."}],"security":[{"BusinessApiKey":[]}],"components":{"securitySchemes":{"BusinessApiKey":{"type":"http","scheme":"bearer","bearerFormat":"pk_test_… / pk_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]},"revoke_phone_verification":{"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"},"phone_verification":{"type":"object","properties":{"phone":{"type":"string"},"verified_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))$"},"source":{"type":"string","enum":["whatsapp"]}},"required":["phone","verified_at","source"]},"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"},"phone":{"type":"string"},"phone_verified_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))$"},"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"},"phone_verification":{"type":"object","properties":{"phone":{"type":"string"},"verified_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))$"},"source":{"type":"string","enum":["whatsapp"]}},"required":["phone","verified_at","source"]},"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"},"phone":{"type":"string"},"phone_verified_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))$"},"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":{"description":"Nombre obligatorio solo si payment_coupon_code no corresponde a un contacto activo del negocio.","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,"description":"Descripción obligatoria del cobro que se comunica al banco."},"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","description","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},"PaymentCouponBulkCreateInput":{"type":"object","properties":{"coupons":{"minItems":1,"maxItems":100,"type":"array","items":{"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":{"description":"Nombre obligatorio solo si payment_coupon_code no corresponde a un contacto activo del negocio.","type":"string","minLength":1,"maxLength":200},"payment_coupon_code":{"type":"string","minLength":1,"maxLength":14,"pattern":"^[A-Za-z0-9]+$"},"amount":{"type":"number","minimum":5,"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,"description":"Descripción obligatoria del cobro que se comunica al banco."},"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)))$"},"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)))$"}},"required":["amount","external_ref","description","expiry_date"],"additionalProperties":false}}},"required":["coupons"],"additionalProperties":false},"PaymentCouponBulkAmountInput":{"type":"object","properties":{"coupons":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1,"maxLength":160},"amount":{"type":"number","minimum":5,"maximum":999999999999.99,"multipleOf":0.01},"source_revision":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"Versión creciente por cupón, administrada por el consumidor. Repetir versión y monto es un replay; una versión anterior o repetida con otro monto produce conflicto."}},"required":["external_ref","amount","source_revision"],"additionalProperties":false}}},"required":["coupons"],"additionalProperties":false},"PaymentCouponBulkSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"external_ref":{"type":"string"},"success":{"type":"boolean"},"status":{"type":"integer","minimum":200,"maximum":599},"idempotent_replay":{"type":"boolean"},"payment_coupon_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string","enum":["PEN"]},"coupon_status":{"type":"string","enum":["active","pending_confirmation","paid","voided"]},"payment_reference":{"type":"string"},"payment_coupon_code":{"type":"string"},"source_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payment_url":{"type":"string","format":"uri"},"bank_deeplinks":{"type":"object","properties":{"bcp":{"nullable":true,"type":"string","format":"uri"},"yape":{"nullable":true,"type":"string","format":"uri"},"interbank":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al esquema interbank://; requiere la app instalada.","type":"string","format":"uri"},"bbva":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al menú genérico de BBVA, sin precargar el código.","type":"string","format":"uri"},"scotiabank":{"nullable":true,"description":"Actualmente null: pago manual; consultar la guía en payment_url.","type":"string","format":"uri"}},"required":["bcp","yape","interbank","bbva","scotiabank"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"additionalProperties":false}},"required":["index","external_ref","success","status"],"additionalProperties":false}}},"required":["total","succeeded","failed","results"],"additionalProperties":false}},"required":["success","data"],"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},"payment_url":{"type":"string","format":"uri","description":"Enlace público canónico de pago en https://360pay.pe/p/<token> en producción. No tiene caducidad propia; puede revocarse."},"bank_deeplinks":{"type":"object","properties":{"bcp":{"nullable":true,"type":"string","format":"uri"},"yape":{"nullable":true,"type":"string","format":"uri"},"interbank":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al esquema interbank://; requiere la app instalada.","type":"string","format":"uri"},"bbva":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al menú genérico de BBVA, sin precargar el código.","type":"string","format":"uri"},"scotiabank":{"nullable":true,"description":"Actualmente null: pago manual; consultar la guía en payment_url.","type":"string","format":"uri"}},"required":["bcp","yape","interbank","bbva","scotiabank"],"additionalProperties":false,"description":"URLs HTTPS durables de 360Pay por banco. Redirigen sin pantalla después de validar cupón, revocación y catálogo; no habilitan bancos deshabilitados."},"expiry_policy":{"type":"string","enum":["enforced","informational"],"description":"informational conserva expiry_date como fecha mostrada al banco y permite pagar el cupón activo después de ella; enforced mantiene el vencimiento estricto."},"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","payment_url","bank_deeplinks","expiry_policy"],"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},"payment_url":{"type":"string","format":"uri","description":"Enlace público canónico de pago en https://360pay.pe/p/<token> en producción. No tiene caducidad propia; puede revocarse."},"bank_deeplinks":{"type":"object","properties":{"bcp":{"nullable":true,"type":"string","format":"uri"},"yape":{"nullable":true,"type":"string","format":"uri"},"interbank":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al esquema interbank://; requiere la app instalada.","type":"string","format":"uri"},"bbva":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al menú genérico de BBVA, sin precargar el código.","type":"string","format":"uri"},"scotiabank":{"nullable":true,"description":"Actualmente null: pago manual; consultar la guía en payment_url.","type":"string","format":"uri"}},"required":["bcp","yape","interbank","bbva","scotiabank"],"additionalProperties":false,"description":"URLs HTTPS durables de 360Pay por banco. Redirigen sin pantalla después de validar cupón, revocación y catálogo; no habilitan bancos deshabilitados."},"expiry_policy":{"type":"string","enum":["enforced","informational"],"description":"informational conserva expiry_date como fecha mostrada al banco y permite pagar el cupón activo después de ella; enforced mantiene el vencimiento estricto."},"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","payment_url","bank_deeplinks","expiry_policy"],"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},"payment_url":{"type":"string","format":"uri","description":"Enlace público canónico de pago en https://360pay.pe/p/<token> en producción. No tiene caducidad propia; puede revocarse."},"bank_deeplinks":{"type":"object","properties":{"bcp":{"nullable":true,"type":"string","format":"uri"},"yape":{"nullable":true,"type":"string","format":"uri"},"interbank":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al esquema interbank://; requiere la app instalada.","type":"string","format":"uri"},"bbva":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al menú genérico de BBVA, sin precargar el código.","type":"string","format":"uri"},"scotiabank":{"nullable":true,"description":"Actualmente null: pago manual; consultar la guía en payment_url.","type":"string","format":"uri"}},"required":["bcp","yape","interbank","bbva","scotiabank"],"additionalProperties":false,"description":"URLs HTTPS durables de 360Pay por banco. Redirigen sin pantalla después de validar cupón, revocación y catálogo; no habilitan bancos deshabilitados."},"expiry_policy":{"type":"string","enum":["enforced","informational"],"description":"informational conserva expiry_date como fecha mostrada al banco y permite pagar el cupón activo después de ella; enforced mantiene el vencimiento estricto."},"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","payment_url","bank_deeplinks","expiry_policy"],"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},"CouponBatchCreateInput":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":160},"coupons":{"minItems":1,"maxItems":5000,"type":"array","items":{"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":{"description":"Nombre obligatorio solo si payment_coupon_code no corresponde a un contacto activo del negocio.","type":"string","minLength":1,"maxLength":200},"payment_coupon_code":{"type":"string","minLength":1,"maxLength":14,"pattern":"^[A-Za-z0-9]+$"},"amount":{"type":"number","minimum":5,"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,"description":"Descripción obligatoria del cobro que se comunica al banco."},"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)))$"},"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)))$"}},"required":["amount","external_ref","description","expiry_date"],"additionalProperties":false}}},"required":["idempotency_key","coupons"],"additionalProperties":false},"CouponBatchAmountInput":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":160},"coupons":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1,"maxLength":160},"amount":{"type":"number","minimum":5,"maximum":999999999999.99,"multipleOf":0.01},"source_revision":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"Versión creciente por cupón, administrada por el consumidor. Repetir versión y monto es un replay; una versión anterior o repetida con otro monto produce conflicto."}},"required":["external_ref","amount","source_revision"],"additionalProperties":false}}},"required":["idempotency_key","coupons"],"additionalProperties":false},"CouponBatchAnnulInput":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":160},"coupons":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"external_ref":{"type":"string","minLength":1,"maxLength":160}},"required":["external_ref"],"additionalProperties":false}}},"required":["idempotency_key","coupons"],"additionalProperties":false},"CouponBatchSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"operation":{"type":"string","enum":["create","amount","annul"]},"status":{"type":"string","enum":["queued","processing","completed","completed_with_errors","failed"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"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))$"},"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))$"},"completed_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))$"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["id","operation","status","total","processed","succeeded","failed","remaining"],"additionalProperties":false},"meta":{"type":"object","properties":{"idempotent_replay":{"type":"boolean"}},"required":["idempotent_replay"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"CouponBatchResultsSuccess":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"batch":{"type":"object","properties":{"id":{"type":"string"},"operation":{"type":"string","enum":["create","amount","annul"]},"status":{"type":"string","enum":["queued","processing","completed","completed_with_errors","failed"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"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))$"},"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))$"},"completed_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))$"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["id","operation","status","total","processed","succeeded","failed","remaining"],"additionalProperties":false},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"external_ref":{"type":"string"},"success":{"type":"boolean"},"status":{"type":"integer","minimum":200,"maximum":599},"idempotent_replay":{"type":"boolean"},"payment_coupon_id":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string","enum":["PEN"]},"coupon_status":{"type":"string","enum":["active","pending_confirmation","paid","voided"]},"payment_reference":{"type":"string"},"payment_coupon_code":{"type":"string"},"source_revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payment_url":{"type":"string","format":"uri"},"bank_deeplinks":{"type":"object","properties":{"bcp":{"nullable":true,"type":"string","format":"uri"},"yape":{"nullable":true,"type":"string","format":"uri"},"interbank":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al esquema interbank://; requiere la app instalada.","type":"string","format":"uri"},"bbva":{"nullable":true,"description":"URL HTTPS durable de 360Pay que redirige al menú genérico de BBVA, sin precargar el código.","type":"string","format":"uri"},"scotiabank":{"nullable":true,"description":"Actualmente null: pago manual; consultar la guía en payment_url.","type":"string","format":"uri"}},"required":["bcp","yape","interbank","bbva","scotiabank"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"additionalProperties":false}},"required":["index","external_ref","success","status"],"additionalProperties":false}},"next_offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["batch","results"],"additionalProperties":false},"meta":{"type":"object","properties":{"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["offset","limit"],"additionalProperties":false}},"required":["success","data","meta"],"additionalProperties":false},"CouponBatchRetryInput":{"type":"object","properties":{},"additionalProperties":false},"CouponBatchError":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"},"code":{"type":"string"},"required_scope":{"type":"string"},"required_scopes":{"type":"array","items":{"type":"string"}}},"required":["success","error"]},"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},"ProductInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":1000},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"unit_of_measure":{"default":"C62","type":"string","enum":["C62","XBG","KGM","GRM","MTR","CMT","MTK","MTQ","LTR","MLT","GLL","GLI","LBR","TNE","HUR","DAY"]},"product_type":{"type":"string","enum":["physical","service","digital"]},"track_stock":{"type":"boolean"},"status":{"type":"string","enum":["active","inactive"]},"available_for_assistant":{"default":true,"type":"boolean"},"category_ids":{"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}},"option_definitions":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"display_type":{"default":"text","type":"string","enum":["text","color"]},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"swatch":{"type":"string","maxLength":40},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","label"],"additionalProperties":false}}},"required":["key","label","values"],"additionalProperties":false}},"variants":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":80},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"status":{"type":"string","enum":["active","inactive"]}},"required":["sku","option_values","unit_price","status"],"additionalProperties":false}},"image_import":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":8,"maxLength":160},"images":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"source_url":{"type":"string","maxLength":2048,"format":"uri"},"alt_text":{"type":"string","minLength":1,"maxLength":160}},"required":["source_url","alt_text"],"additionalProperties":false}}},"required":["idempotency_key","images"],"additionalProperties":false}},"required":["name","currency","product_type","track_stock","status","option_definitions","variants"],"additionalProperties":false},"ProductCreateSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"category_ids":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"description":{"type":"string"},"currency":{"type":"string"},"unit_of_measure":{"type":"string","enum":["C62","XBG","KGM","GRM","MTR","CMT","MTK","MTQ","LTR","MLT","GLL","GLI","LBR","TNE","HUR","DAY"]},"product_type":{"type":"string","enum":["physical","service","digital"]},"track_stock":{"type":"boolean"},"status":{"type":"string","enum":["active","inactive"]},"available_for_assistant":{"type":"boolean"},"images":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"url":{"type":"string","format":"uri"},"content_type":{"type":"string","enum":["image/jpeg","image/png"]},"alt_text":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","url","content_type","alt_text","position"]}},"option_definitions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"display_type":{"default":"text","type":"string","enum":["text","color"]},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"swatch":{"type":"string","maxLength":40},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","label"],"additionalProperties":false}}},"required":["key","label","values"],"additionalProperties":false}},"variants":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"sku":{"type":"string"},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"name":{"type":"string"},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"effective_price":{"type":"number","minimum":0,"multipleOf":0.01},"available_stock":{"nullable":true,"type":"integer","minimum":0,"maximum":1000000},"status":{"type":"string","enum":["active","inactive"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"url":{"type":"string","format":"uri"},"content_type":{"type":"string","enum":["image/jpeg","image/png"]},"alt_text":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","url","content_type","alt_text","position"]}}},"required":["_id","version","sku","option_values","name","unit_price","effective_price","available_stock","status","images"]}},"price_min":{"type":"number","minimum":0,"multipleOf":0.01},"price_max":{"type":"number","minimum":0,"multipleOf":0.01},"available_stock":{"nullable":true,"type":"integer","minimum":0,"maximum":1000000}},"required":["_id","version","category_ids","name","currency","unit_of_measure","product_type","track_stock","status","available_for_assistant","images","option_definitions","variants","price_min","price_max","available_stock"]},"meta":{"type":"object","properties":{"image_import":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","completed_with_errors","failed"]},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"source_url":{"type":"string","format":"uri"},"alt_text":{"type":"string"},"status":{"type":"string","enum":["pending","completed","failed"]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"image_id":{"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)$"},"error_code":{"type":"string"},"error_message":{"type":"string"},"retryable":{"type":"boolean"},"completed_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))$"}},"required":["id","source_url","alt_text","status","attempts"]}},"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))$"},"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))$"},"completed_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))$"}},"required":["id","product_id","status","version","items"]}},"required":["image_import"]}},"required":["success","data"]},"ProductImageImportInput":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":8,"maxLength":160},"images":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"source_url":{"type":"string","maxLength":2048,"format":"uri"},"alt_text":{"type":"string","minLength":1,"maxLength":160}},"required":["source_url","alt_text"],"additionalProperties":false}}},"required":["idempotency_key","images"],"additionalProperties":false},"ProductImageImportSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","completed_with_errors","failed"]},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"items":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"source_url":{"type":"string","format":"uri"},"alt_text":{"type":"string"},"status":{"type":"string","enum":["pending","completed","failed"]},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"image_id":{"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)$"},"error_code":{"type":"string"},"error_message":{"type":"string"},"retryable":{"type":"boolean"},"completed_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))$"}},"required":["id","source_url","alt_text","status","attempts"]}},"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))$"},"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))$"},"completed_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))$"}},"required":["id","product_id","status","version","items"]},"meta":{"type":"object","properties":{"idempotent_replay":{"type":"boolean"}},"required":["idempotent_replay"]}},"required":["success","data"]},"ProductArchiveSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}},"required":["success","data"]},"ProductUpdateInput":{"type":"object","properties":{"expected_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":1000},"unit_of_measure":{"type":"string","enum":["C62","XBG","KGM","GRM","MTR","CMT","MTK","MTQ","LTR","MLT","GLL","GLI","LBR","TNE","HUR","DAY"]},"product_type":{"type":"string","enum":["physical","service","digital"]},"track_stock":{"type":"boolean"},"status":{"type":"string","enum":["active","inactive"]},"available_for_assistant":{"type":"boolean"},"category_ids":{"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}},"option_definitions":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"display_type":{"default":"text","type":"string","enum":["text","color"]},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"swatch":{"type":"string","maxLength":40},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","label"],"additionalProperties":false}}},"required":["key","label","values"],"additionalProperties":false}},"variants":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":80},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"status":{"type":"string","enum":["active","inactive"]},"_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"expected_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991}},"required":["sku","option_values","unit_price","status"],"additionalProperties":false}},"archive_variant_ids":{"maxItems":100,"type":"array","items":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}},"required":["expected_version"],"additionalProperties":false},"ProductVariantCreateInput":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":80},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"status":{"type":"string","enum":["active","inactive"]},"expected_product_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991}},"required":["sku","option_values","unit_price","status","expected_product_version"],"additionalProperties":false},"ProductVariantArchiveInput":{"type":"object","properties":{"expected_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"expected_product_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991}},"required":["expected_version","expected_product_version"],"additionalProperties":false},"ProductVariantPriceBulkUpdateInput":{"type":"object","properties":{"updates":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":80},"expected_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false}},"required":["sku","expected_version"],"additionalProperties":false}}},"required":["updates"],"additionalProperties":false},"ProductVariantPriceBulkUpdateSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"updates":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"variant_id":{"type":"string"},"sku":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"effective_price":{"type":"number","minimum":0,"multipleOf":0.01}},"required":["product_id","variant_id","sku","version","unit_price","promotion","effective_price"]}}},"required":["updates"]}},"required":["success","data"]},"ProductVariantUpdateInput":{"type":"object","properties":{"expected_version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"sku":{"type":"string","minLength":1,"maxLength":80},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"status":{"type":"string","enum":["active","inactive"]}},"required":["expected_version"],"additionalProperties":false},"ProductSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"category_ids":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"description":{"type":"string"},"currency":{"type":"string"},"unit_of_measure":{"type":"string","enum":["C62","XBG","KGM","GRM","MTR","CMT","MTK","MTQ","LTR","MLT","GLL","GLI","LBR","TNE","HUR","DAY"]},"product_type":{"type":"string","enum":["physical","service","digital"]},"track_stock":{"type":"boolean"},"status":{"type":"string","enum":["active","inactive"]},"available_for_assistant":{"type":"boolean"},"images":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"url":{"type":"string","format":"uri"},"content_type":{"type":"string","enum":["image/jpeg","image/png"]},"alt_text":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","url","content_type","alt_text","position"]}},"option_definitions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"display_type":{"default":"text","type":"string","enum":["text","color"]},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"swatch":{"type":"string","maxLength":40},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","label"],"additionalProperties":false}}},"required":["key","label","values"],"additionalProperties":false}},"variants":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"sku":{"type":"string"},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"name":{"type":"string"},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"effective_price":{"type":"number","minimum":0,"multipleOf":0.01},"available_stock":{"nullable":true,"type":"integer","minimum":0,"maximum":1000000},"status":{"type":"string","enum":["active","inactive"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"url":{"type":"string","format":"uri"},"content_type":{"type":"string","enum":["image/jpeg","image/png"]},"alt_text":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","url","content_type","alt_text","position"]}}},"required":["_id","version","sku","option_values","name","unit_price","effective_price","available_stock","status","images"]}},"price_min":{"type":"number","minimum":0,"multipleOf":0.01},"price_max":{"type":"number","minimum":0,"multipleOf":0.01},"available_stock":{"nullable":true,"type":"integer","minimum":0,"maximum":1000000}},"required":["_id","version","category_ids","name","currency","unit_of_measure","product_type","track_stock","status","available_for_assistant","images","option_definitions","variants","price_min","price_max","available_stock"]}},"required":["success","data"]},"ProductListSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"category_ids":{"type":"array","items":{"type":"string"}},"name":{"type":"string"},"description":{"type":"string"},"currency":{"type":"string"},"unit_of_measure":{"type":"string","enum":["C62","XBG","KGM","GRM","MTR","CMT","MTK","MTQ","LTR","MLT","GLL","GLI","LBR","TNE","HUR","DAY"]},"product_type":{"type":"string","enum":["physical","service","digital"]},"track_stock":{"type":"boolean"},"status":{"type":"string","enum":["active","inactive"]},"available_for_assistant":{"type":"boolean"},"images":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"url":{"type":"string","format":"uri"},"content_type":{"type":"string","enum":["image/jpeg","image/png"]},"alt_text":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","url","content_type","alt_text","position"]}},"option_definitions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"display_type":{"default":"text","type":"string","enum":["text","color"]},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991},"values":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"},"label":{"type":"string","minLength":1,"maxLength":80},"swatch":{"type":"string","maxLength":40},"status":{"default":"active","type":"string","enum":["active","inactive","archived"]},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["key","label"],"additionalProperties":false}}},"required":["key","label","values"],"additionalProperties":false}},"variants":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"sku":{"type":"string"},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"name":{"type":"string"},"unit_price":{"type":"number","minimum":0,"multipleOf":0.01},"promotion":{"nullable":true,"type":"object","properties":{"price":{"type":"number","minimum":0,"multipleOf":0.01},"starts_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)))$"},"ends_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)))$"},"show_original_price":{"default":true,"type":"boolean"}},"required":["price","ends_at"],"additionalProperties":false},"effective_price":{"type":"number","minimum":0,"multipleOf":0.01},"available_stock":{"nullable":true,"type":"integer","minimum":0,"maximum":1000000},"status":{"type":"string","enum":["active","inactive"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"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)$"},"url":{"type":"string","format":"uri"},"content_type":{"type":"string","enum":["image/jpeg","image/png"]},"alt_text":{"type":"string"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","url","content_type","alt_text","position"]}}},"required":["_id","version","sku","option_values","name","unit_price","effective_price","available_stock","status","images"]}},"price_min":{"type":"number","minimum":0,"multipleOf":0.01},"price_max":{"type":"number","minimum":0,"multipleOf":0.01},"available_stock":{"nullable":true,"type":"integer","minimum":0,"maximum":1000000}},"required":["_id","version","category_ids","name","currency","unit_of_measure","product_type","track_stock","status","available_for_assistant","images","option_definitions","variants","price_min","price_max","available_stock"]}}},"required":["success","data"]},"InventoryAdjustmentBatchInput":{"type":"object","properties":{"location_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"mode":{"type":"string","enum":["delta","physical_count"]},"reason":{"type":"string","enum":["restock","correction","damage","loss","return","other"]},"note":{"type":"string","minLength":1,"maxLength":240},"idempotency_key":{"type":"string","minLength":8,"maxLength":160},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"anyOf":[{"type":"object","properties":{"product_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"variant_id":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"},"quantity":{"type":"integer","minimum":-1000000,"maximum":1000000}},"required":["product_id","variant_id","quantity"],"additionalProperties":false},{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":80},"quantity":{"type":"integer","minimum":-1000000,"maximum":1000000}},"required":["sku","quantity"],"additionalProperties":false}]}}},"required":["mode","reason","idempotency_key","lines"],"additionalProperties":false},"InventoryAdjustmentBatchSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"batch_id":{"type":"string"},"location":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"}},"required":["_id","name"]},"mode":{"type":"string","enum":["delta","physical_count"]},"reason":{"type":"string","enum":["restock","correction","damage","loss","return","other"]},"note":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"variant_id":{"type":"string"},"previous_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resulting_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"movement":{"type":"object","properties":{"_id":{"type":"string"},"type":{"type":"string","enum":["manual_adjustment","physical_count"]},"created_at":{"type":"string"}},"required":["_id","type","created_at"]}},"required":["product_id","variant_id","previous_quantity","delta","resulting_quantity","movement"]}},"idempotent_replay":{"type":"boolean"}},"required":["batch_id","location","mode","reason","lines","idempotent_replay"]}},"required":["success","data"]},"InventoryOverviewSuccess":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"is_default":{"type":"boolean"},"status":{"type":"string","enum":["active","inactive"]},"type":{"type":"string","enum":["warehouse","store","fulfillment_point"]},"address":{"type":"object","properties":{"formatted_address":{"type":"string","minLength":5,"maxLength":500},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"validation_status":{"type":"string","enum":["verified","manual"]}},"required":["formatted_address","latitude","longitude","validation_status"],"additionalProperties":false},"capabilities":{"type":"object","properties":{"fulfillment":{"type":"boolean"},"pickup":{"type":"boolean"}},"required":["fulfillment","pickup"],"additionalProperties":false},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991}},"required":["_id","name","is_default","status","type","capabilities","version"]}},"active_location_id":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"product_name":{"type":"string"},"category_ids":{"type":"array","items":{"type":"string"}},"product_status":{"type":"string","enum":["active","inactive"]},"variant_id":{"type":"string"},"variant_name":{"type":"string"},"sku":{"type":"string"},"option_values":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:_[a-z0-9]+)*$"}},"variant_status":{"type":"string","enum":["active","inactive"]},"quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"reserved_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"available_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"total_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"quantities":{"type":"array","items":{"type":"object","properties":{"location_id":{"type":"string"},"quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"reserved_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991},"available_quantity":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["location_id","quantity","reserved_quantity","available_quantity"]}}},"required":["product_id","product_name","category_ids","product_status","variant_id","variant_name","sku","option_values","variant_status","quantity","reserved_quantity","available_quantity","total_quantity","quantities"]}}},"required":["locations","active_location_id","items"]}},"required":["success","data"]}},"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":{"/products":{"get":{"operationId":"listProducts","summary":"Listar productos con variantes, precios y stock disponible","tags":["Products"],"x-360studio-scope":"products:read","responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductListSuccess"},"example":{"success":true,"data":[{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12}]}}}},"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"}}},"post":{"operationId":"createProduct","summary":"Crear producto con sus variantes iniciales","description":"Cada producto simple requiere una variante. Un producto configurable admite hasta tres opciones y cien combinaciones. unit_price y promotion pertenecen a la variante; crear o editar catalogo no modifica stock. Opcionalmente, image_import permite enviar hasta diez URLs HTTPS publicas. El producto se crea de inmediato y las imagenes se descargan en segundo plano, se validan como JPEG o PNG (maximo 5 MB) y se copian al almacenamiento de 360studio. La respuesta conserva el producto en data y expone el lote asincrono en meta.image_import.","tags":["Products"],"x-360studio-scope":"products:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductInput"},"example":{"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"sku":"POLO-M","option_values":{"talla":"m"},"unit_price":59.9,"status":"active"}],"image_import":{"idempotency_key":"catalog-import-polo-classic-images-v1","images":[{"source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal"},{"source_url":"https://cdn.example.com/catalog/polo-classic-back.png","alt_text":"Polo clasico vista posterior"}]}}}}},"responses":{"201":{"description":"Recurso creado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12},"meta":{"image_import":{"id":"690000000000000000000017","product_id":"690000000000000000000012","status":"pending","version":1,"items":[{"id":"9a8ca70f-bfd2-4af4-a445-887e913bbe11","source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal","status":"pending","attempts":0}],"created_at":"2030-09-01T14:00:00.000Z","updated_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"}}}},"/products/inventory":{"get":{"operationId":"getInventory","summary":"Consultar stock por producto, variante y ubicacion","description":"quantity es el stock fisico, reserved_quantity el stock retenido y available_quantity el disponible. Los productos sin seguimiento de stock no aparecen en este inventario.","tags":["Inventory"],"x-360studio-scope":"inventory:read","responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryOverviewSuccess"},"example":{"success":true,"data":{"locations":[{"_id":"690000000000000000000014","name":"Principal","type":"warehouse","capabilities":{"fulfillment":true,"pickup":false},"is_default":true,"status":"active","version":1}],"active_location_id":"690000000000000000000014","items":[{"product_id":"690000000000000000000012","product_name":"Polo clasico","category_ids":[],"product_status":"active","variant_id":"690000000000000000000013","variant_name":"Talla: M","sku":"POLO-M","option_values":{"talla":"m"},"variant_status":"active","quantity":12,"reserved_quantity":0,"available_quantity":12,"total_quantity":12,"quantities":[{"location_id":"690000000000000000000014","quantity":12,"reserved_quantity":0,"available_quantity":12}]}]}}}}},"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"}}}},"/products/inventory/stock-adjustments":{"post":{"operationId":"adjustInventoryStock","summary":"Registrar un ajuste de stock idempotente","description":"mode=delta suma o resta quantity; mode=physical_count fija el conteo resultante. Si location_id se omite, el ajuste se aplica al almacen Principal del Business. Cada linea identifica una variante por sku o por product_id y variant_id; el lote admite hasta cien lineas y es atomico. idempotency_key es obligatoria y una repeticion con el mismo payload devuelve el mismo lote. El ajuste nunca puede dejar stock negativo ni por debajo de las reservas activas.","tags":["Inventory"],"x-360studio-scope":"inventory:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryAdjustmentBatchInput"},"example":{"mode":"delta","reason":"restock","idempotency_key":"erp-restock-20300901-001","lines":[{"sku":"POLO-M","quantity":12}]}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryAdjustmentBatchSuccess"},"example":{"success":true,"data":{"batch_id":"690000000000000000000015","location":{"_id":"690000000000000000000014","name":"Principal"},"mode":"delta","reason":"restock","lines":[{"product_id":"690000000000000000000012","variant_id":"690000000000000000000013","previous_quantity":0,"delta":12,"resulting_quantity":12,"movement":{"_id":"690000000000000000000016","type":"manual_adjustment","created_at":"2030-09-01T14:00: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"}}}},"/products/variants/prices":{"patch":{"operationId":"updateProductVariantPricesBySku","summary":"Actualizar precios de variantes por SKU de forma masiva","description":"Actualiza entre una y cien variantes en un unico lote atomico. Cada linea usa el SKU global dentro del Business y expected_version para control optimista; si una linea falla, ninguna actualizacion se aplica.","tags":["Products"],"x-360studio-scope":"products:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantPriceBulkUpdateInput"},"example":{"updates":[{"sku":"POLO-M","expected_version":1,"unit_price":54.9}]}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantPriceBulkUpdateSuccess"},"example":{"success":true,"data":{"updates":[{"product_id":"690000000000000000000012","variant_id":"690000000000000000000013","sku":"POLO-M","version":2,"unit_price":54.9,"promotion":null,"effective_price":54.9}]}}}}},"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"}}}},"/products/{id}":{"get":{"operationId":"getProduct","summary":"Obtener producto con variantes, precios y stock disponible","tags":["Products"],"x-360studio-scope":"products:read","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12}}}}},"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":"updateProduct","summary":"Actualizar datos generales y opciones de un producto","description":"expected_version aplica control optimista. Las variantes se crean o actualizan en sus endpoints dedicados; este endpoint no cambia stock.","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateInput"},"example":{"expected_version":1,"name":"Polo clasico premium"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12}}}}},"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"}}},"delete":{"operationId":"archiveProduct","summary":"Archivar un producto y sus variantes","description":"El producto deja de aparecer en el catalogo activo. La operacion conserva su historial.","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductArchiveSuccess"},"example":{"success":true,"data":{"product_id":"690000000000000000000012"}}}}},"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"}}}},"/products/{id}/variants":{"post":{"operationId":"createProductVariant","summary":"Crear una variante","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantCreateInput"},"example":{"expected_product_version":1,"sku":"POLO-L","option_values":{"talla":"l"},"unit_price":64.9,"status":"active"}}}},"responses":{"201":{"description":"Recurso creado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12}}}}},"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"}}}},"/products/{id}/images/imports":{"post":{"operationId":"importProductImages","summary":"Importar imagenes por URL a un producto existente","description":"Crea un lote asincrono e idempotente de hasta diez imagenes. Cada URL debe usar HTTPS publico, sin credenciales, fragmentos, puertos personalizados ni redirects. 360studio limita la descarga a 5 MB, valida la firma JPEG/PNG y guarda una copia propia; la URL de origen no se usa para servir el catalogo. Repetir idempotency_key con el mismo contenido devuelve el mismo lote; reutilizarla con otro contenido responde 409.","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImageImportInput"},"example":{"idempotency_key":"catalog-import-polo-classic-images-v1","images":[{"source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal"},{"source_url":"https://cdn.example.com/catalog/polo-classic-back.png","alt_text":"Polo clasico vista posterior"}]}}}},"responses":{"200":{"description":"Replay idempotente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImageImportSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000017","product_id":"690000000000000000000012","status":"pending","version":1,"items":[{"id":"9a8ca70f-bfd2-4af4-a445-887e913bbe11","source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal","status":"pending","attempts":0}],"created_at":"2030-09-01T14:00:00.000Z","updated_at":"2030-09-01T14:00:00.000Z"},"meta":{"idempotent_replay":false}}}}},"202":{"description":"Importacion aceptada para procesamiento.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImageImportSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000017","product_id":"690000000000000000000012","status":"pending","version":1,"items":[{"id":"9a8ca70f-bfd2-4af4-a445-887e913bbe11","source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal","status":"pending","attempts":0}],"created_at":"2030-09-01T14:00:00.000Z","updated_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"}}}},"/products/{id}/images/imports/{importId}":{"get":{"operationId":"getProductImageImport","summary":"Consultar el estado de una importacion de imagenes","description":"Devuelve el estado del lote y de cada URL. completed confirma que todas las imagenes ya aparecen en el producto; completed_with_errors conserva las imagenes exitosas e identifica las fallidas.","tags":["Products"],"x-360studio-scope":"products:read","parameters":[{"$ref":"#/components/parameters/Id"},{"name":"importId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}],"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImageImportSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000017","product_id":"690000000000000000000012","status":"pending","version":1,"items":[{"id":"9a8ca70f-bfd2-4af4-a445-887e913bbe11","source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal","status":"pending","attempts":0}],"created_at":"2030-09-01T14:00:00.000Z","updated_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"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/products/{id}/images/imports/{importId}/retry":{"post":{"operationId":"retryProductImageImport","summary":"Reintentar los elementos fallidos de una importacion","description":"Reprograma solo los elementos fallidos; las imagenes ya completadas no se descargan ni se duplican.","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"},{"name":"importId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}],"responses":{"202":{"description":"Reintento aceptado para procesamiento.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductImageImportSuccess"},"example":{"success":true,"data":{"id":"690000000000000000000017","product_id":"690000000000000000000012","status":"pending","version":1,"items":[{"id":"9a8ca70f-bfd2-4af4-a445-887e913bbe11","source_url":"https://cdn.example.com/catalog/polo-classic-front.png","alt_text":"Polo clasico vista frontal","status":"pending","attempts":0}],"created_at":"2030-09-01T14:00:00.000Z","updated_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"}}}},"/products/{id}/variants/{variantId}":{"patch":{"operationId":"updateProductVariant","summary":"Actualizar SKU, combinacion, precio, promocion o estado de una variante","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"},{"name":"variantId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantUpdateInput"},"example":{"expected_version":1,"unit_price":54.9}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12}}}}},"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"}}},"delete":{"operationId":"archiveProductVariant","summary":"Archivar una variante","description":"expected_version y expected_product_version aplican control optimista. Un producto debe conservar al menos una variante.","tags":["Products"],"x-360studio-scope":"products:write","parameters":[{"$ref":"#/components/parameters/Id"},{"name":"variantId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductVariantArchiveInput"},"example":{"expected_version":1,"expected_product_version":2}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccess"},"example":{"success":true,"data":{"_id":"690000000000000000000012","version":1,"category_ids":[],"name":"Polo clasico","description":"Polo de algodon disponible por talla.","currency":"PEN","unit_of_measure":"C62","product_type":"physical","track_stock":true,"status":"active","available_for_assistant":true,"images":[],"option_definitions":[{"key":"talla","label":"Talla","display_type":"text","status":"active","position":0,"values":[{"key":"m","label":"M","status":"active","position":0},{"key":"l","label":"L","status":"active","position":1}]}],"variants":[{"_id":"690000000000000000000013","version":1,"sku":"POLO-M","option_values":{"talla":"m"},"name":"Talla: M","unit_price":59.9,"promotion":null,"effective_price":59.9,"available_stock":12,"status":"active","images":[]}],"price_min":59.9,"price_max":59.9,"available_stock":12}}}}},"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"}}}},"/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":"A1B2C3D4E5F6G","payment_url":"https://360pay.pe/p/synthetic_coupon_token_00042","bank_deeplinks":{"bcp":"https://360pay.pe/l/synthetic_coupon_token_00042/bcp","yape":"https://360pay.pe/l/synthetic_coupon_token_00042/yape","interbank":"https://360pay.pe/l/synthetic_coupon_token_00042/interbank","bbva":"https://360pay.pe/l/synthetic_coupon_token_00042/bbva","scotiabank":null},"expiry_policy":"informational","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, customer_name es obligatorio para crearlo. 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. amount, external_ref, description y expiry_date son obligatorios. description contiene el concepto que recibe el banco. 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 es informativa: un cupón activo emitido por esta API sigue siendo pagable después de esa fecha (expiry_policy=informational). payment_url devuelve el enlace público de 360pay.pe, estable por cupón y sin caducidad propia. 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":"A1B2C3D4E5F6G","payment_url":"https://360pay.pe/p/synthetic_coupon_token_00042","bank_deeplinks":{"bcp":"https://360pay.pe/l/synthetic_coupon_token_00042/bcp","yape":"https://360pay.pe/l/synthetic_coupon_token_00042/yape","interbank":"https://360pay.pe/l/synthetic_coupon_token_00042/interbank","bbva":"https://360pay.pe/l/synthetic_coupon_token_00042/bbva","scotiabank":null},"expiry_policy":"informational","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":"A1B2C3D4E5F6G","payment_url":"https://360pay.pe/p/synthetic_coupon_token_00042","bank_deeplinks":{"bcp":"https://360pay.pe/l/synthetic_coupon_token_00042/bcp","yape":"https://360pay.pe/l/synthetic_coupon_token_00042/yape","interbank":"https://360pay.pe/l/synthetic_coupon_token_00042/interbank","bbva":"https://360pay.pe/l/synthetic_coupon_token_00042/bbva","scotiabank":null},"expiry_policy":"informational","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/batches":{"post":{"tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","operationId":"createCouponBatch","summary":"Encolar la creación de hasta 5000 cupones","description":"El Business deriva de la credencial; x-workspace-id es obligatorio y debe estar autorizado con Payments y entitlement vigentes. No acepta business_id/workspace_id en el body. Requiere payment_coupons:write. Acepta de 1 a 5000 filas y hasta 6 MiB de payload canónico. Valida el request completo antes de persistir el lote y responde 202 sin ejecutar cupones. idempotency_key es obligatoria, única dentro del Business/Workspace; reutilizarla con otro payload u operación devuelve 409. El worker conserva resultados y progreso transaccionales, procesa por tramos y recupera interrupciones con la entrega durable existente. Consultar estado y resultados paginados: HTTP 202 no confirma éxito de las filas. Se revalidan la credencial y el alcance al ejecutar cada entrega. Cada fila usa el contrato de emisión: referencia externa, deudor, descripción, monto y vencimiento. La creación del contacto conserva su flujo canónico; un contacto puede persistir si luego falla la emisión. Los cupones API tienen vencimiento informativo. Los links se resuelven al consultar los resultados.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchCreateInput"},"examples":{"selectedWorkspace":{"summary":"Un lote dentro de un Workspace autorizado","value":{"idempotency_key":"DEMO-CREATE-2028-01","coupons":[{"external_ref":"DEMO-2028-01-0001","payment_coupon_code":"DEM0001","customer_name":"Residente DEMO","amount":150.5,"description":"Cuota de enero","expiry_date":"2028-01-31T23:59:59-05:00"}]}}}}}},"responses":{"202":{"description":"Lote persistido y encolado. No significa que los cupones estén procesados. Reintentos con la misma idempotency_key y payload recuperan el mismo lote.","headers":{"Location":{"description":"Ruta de consulta del lote; conservar los headers de autenticación y Workspace.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Espera sugerida para consultar progreso."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchSuccess"}}}},"400":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"401":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"403":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"404":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"409":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"500":{"description":"Error interno sin detalles sensibles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}}}},"patch":{"tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","operationId":"updateCouponAmountsBatch","summary":"Encolar hasta 5000 actualizaciones de montos","description":"El Business deriva de la credencial; x-workspace-id es obligatorio y debe estar autorizado con Payments y entitlement vigentes. No acepta business_id/workspace_id en el body. Requiere payment_coupons:write. Acepta de 1 a 5000 filas y hasta 6 MiB de payload canónico. Valida el request completo antes de persistir el lote y responde 202 sin ejecutar cupones. idempotency_key es obligatoria, única dentro del Business/Workspace; reutilizarla con otro payload u operación devuelve 409. El worker conserva resultados y progreso transaccionales, procesa por tramos y recupera interrupciones con la entrega durable existente. Consultar estado y resultados paginados: HTTP 202 no confirma éxito de las filas. Se revalidan la credencial y el alcance al ejecutar cada entrega. Cada fila indica external_ref, amount total absoluto y source_revision creciente por cupón. Replays no acumulan mora. Una versión anterior o repetida con otro monto produce fallo por fila. Solo modifica cupones independientes activos, PEN/360Pay, sin liquidación ni dueño externo del monto; bloquea pagos confirmados y en curso.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchAmountInput"},"examples":{"selectedWorkspace":{"summary":"Un lote dentro de un Workspace autorizado","value":{"idempotency_key":"DEMO-AMOUNT-2028-01","coupons":[{"external_ref":"DEMO-2028-01-0001","amount":151.5,"source_revision":20280102}]}}}}}},"responses":{"202":{"description":"Lote persistido y encolado. No significa que los cupones estén procesados. Reintentos con la misma idempotency_key y payload recuperan el mismo lote.","headers":{"Location":{"description":"Ruta de consulta del lote; conservar los headers de autenticación y Workspace.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Espera sugerida para consultar progreso."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchSuccess"}}}},"400":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"401":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"403":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"404":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"409":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"500":{"description":"Error interno sin detalles sensibles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}}}}},"/payment-coupons/batches/annul":{"post":{"tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","operationId":"annulCouponBatch","summary":"Encolar hasta 5000 anulaciones de cupones","description":"El Business deriva de la credencial; x-workspace-id es obligatorio y debe estar autorizado con Payments y entitlement vigentes. No acepta business_id/workspace_id en el body. Requiere payment_coupons:write. Acepta de 1 a 5000 filas y hasta 6 MiB de payload canónico. Valida el request completo antes de persistir el lote y responde 202 sin ejecutar cupones. idempotency_key es obligatoria, única dentro del Business/Workspace; reutilizarla con otro payload u operación devuelve 409. El worker conserva resultados y progreso transaccionales, procesa por tramos y recupera interrupciones con la entrega durable existente. Consultar estado y resultados paginados: HTTP 202 no confirma éxito de las filas. Se revalidan la credencial y el alcance al ejecutar cada entrega. Cada fila identifica external_ref. Partner admite payment_coupons:delete como alternativa a write para anulación. Solo anula cupones independientes activos sin liquidación; bloquea paid, pending_confirmation y cupones pertenecientes a otros flujos. Repetir una cancelación ya aplicada no duplica auditoría ni eventos. Nunca equivale a una reversa de pago bancario.","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchAnnulInput"},"examples":{"selectedWorkspace":{"summary":"Un lote dentro de un Workspace autorizado","value":{"idempotency_key":"DEMO-ANNUL-2028-01","coupons":[{"external_ref":"DEMO-2028-01-0001"}]}}}}}},"responses":{"202":{"description":"Lote persistido y encolado. No significa que los cupones estén procesados. Reintentos con la misma idempotency_key y payload recuperan el mismo lote.","headers":{"Location":{"description":"Ruta de consulta del lote; conservar los headers de autenticación y Workspace.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Espera sugerida para consultar progreso."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchSuccess"}}}},"400":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"401":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"403":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"404":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"409":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"500":{"description":"Error interno sin detalles sensibles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}}}}},"/payment-coupons/batches/{batchId}":{"get":{"tags":["Payment Coupons"],"operationId":"getCouponBatch","summary":"Consultar estado y progreso del lote","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"batchId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}],"description":"Requiere payment_coupons:read o write (Partner admite también delete). Revalida el alcance de consulta. processed, succeeded, failed y remaining corresponden al avance persistido. completed_with_errors exige revisar las filas; failed puede dejar filas pendientes. Una entrega agotada se muestra como failed/delivery_exhausted, con reintento explícito.","responses":{"200":{"description":"Progreso actual, sin payload ni datos internos del worker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchSuccess"}}}},"400":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"401":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"403":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"404":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"409":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"500":{"description":"Error interno sin detalles sensibles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}}}}},"/payment-coupons/batches/{batchId}/results":{"get":{"tags":["Payment Coupons"],"operationId":"getCouponBatchResults","summary":"Consultar resultados paginados del lote","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"batchId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":5000,"default":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"description":"Mismos permisos y alcance que el progreso. Devuelve solo filas procesadas, con index absoluto y external_ref. next_offset indica otra página ya disponible. Consultar progreso mientras remaining sea mayor que cero; no saltar filas pendientes. Las emisiones exitosas incluyen payment_url y bank_deeplinks canónicos. Los resultados describen la operación registrada; el link refleja el estado actual del cupón. No devuelve los inputs originales, actor ni fingerprints.","responses":{"200":{"description":"Resultados disponibles y progreso del lote.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchResultsSuccess"}}}},"400":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"401":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"403":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"404":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"409":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"500":{"description":"Error interno sin detalles sensibles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}}}}},"/payment-coupons/batches/{batchId}/retry":{"post":{"tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","operationId":"retryCouponBatch","summary":"Reanudar un lote interrumpido desde la siguiente fila pendiente","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"batchId","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{24}$"}}],"description":"El Business deriva de la credencial; x-workspace-id es obligatorio y debe estar autorizado con Payments y entitlement vigentes. No acepta business_id/workspace_id en el body. Revalida al solicitante y reemplaza la entrega anterior con fencing durable. Solo admite lotes interrumpidos por autorización o entrega agotada, con filas pendientes. No vuelve a ejecutar filas confirmadas. Para reintentar filas fallidas de un lote completado, enviar esas filas en un lote nuevo con otra idempotency_key y las mismas referencias/versiones.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchRetryInput"},"examples":{"selectedWorkspace":{"summary":"Un lote dentro de un Workspace autorizado","value":{}}}}}},"responses":{"202":{"description":"Lote persistido y encolado. No significa que los cupones estén procesados. Reintentos con la misma idempotency_key y payload recuperan el mismo lote.","headers":{"Location":{"description":"Ruta de consulta del lote; conservar los headers de autenticación y Workspace.","schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string"},"description":"Espera sugerida para consultar progreso."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchSuccess"}}}},"400":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"401":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"403":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"404":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"409":{"description":"Solicitud inválida, no autorizada, recurso ajeno/inexistente o conflicto de idempotencia/estado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}},"500":{"description":"Error interno sin detalles sensibles.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponBatchError"}}}}}}},"/payment-coupons/bulk":{"post":{"operationId":"bulkCreatePaymentCoupons","summary":"Crear hasta 100 cupones por lote","description":"Procesa un lote dentro del Workspace autorizado. Valida todo el body antes de escribir; después cada cupón es independiente. HTTP 200 puede contener fallos: revisar data.results y data.failed. external_ref identifica la emisión dentro del Business/Workspace: repetir la solicitud original devuelve el cupón actual, incluso después de actualizar su monto; reutilizarla con otra solicitud devuelve conflicto por fila. La creación del contacto usa su transacción canónica y puede persistir si falla la emisión posterior. La respuesta incluye payment_url y bank_deeplinks. Para más cupones, dividir en lotes de hasta 100.","tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponBulkCreateInput"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponBulkSuccess"}}}},"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":"bulkUpdatePaymentCouponAmounts","summary":"Actualizar hasta 100 montos de cupones por lote","description":"Cada fila selecciona external_ref dentro del Workspace y envía el monto total absoluto, nunca un incremento. source_revision es un entero positivo creciente por cupón: la misma versión y monto es un replay sin escritura; una versión menor o repetida con otro monto produce conflicto. Solo modifica cupones independientes activos y sin liquidación; rechaza paid, voided, pending_confirmation y montos gobernados por otro flujo. Conserva la referencia bancaria y el enlace. La fecha de vencimiento de los cupones API es informativa. Revisar los resultados por fila incluso con HTTP 200. Los replays devuelven el estado actual sin reactivar ni modificar el cupón.","tags":["Payment Coupons"],"x-360studio-scope":"payment_coupons:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponBulkAmountInput"}}}},"responses":{"200":{"description":"Operación completada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCouponBulkSuccess"}}}},"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"}}}},"/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":"A1B2C3D4E5F6G","payment_url":"https://360pay.pe/p/synthetic_coupon_token_00042","bank_deeplinks":{"bcp":"https://360pay.pe/l/synthetic_coupon_token_00042/bcp","yape":"https://360pay.pe/l/synthetic_coupon_token_00042/yape","interbank":"https://360pay.pe/l/synthetic_coupon_token_00042/interbank","bbva":"https://360pay.pe/l/synthetic_coupon_token_00042/bbva","scotiabank":null},"expiry_policy":"informational","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":"A1B2C3D4E5F6G","payment_url":"https://360pay.pe/p/synthetic_coupon_token_00042","bank_deeplinks":{"bcp":"https://360pay.pe/l/synthetic_coupon_token_00042/bcp","yape":"https://360pay.pe/l/synthetic_coupon_token_00042/yape","interbank":"https://360pay.pe/l/synthetic_coupon_token_00042/interbank","bbva":"https://360pay.pe/l/synthetic_coupon_token_00042/bbva","scotiabank":null},"expiry_policy":"informational","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":"A1B2C3D4E5F6G","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"}}}}}}