{"openapi":"3.1.0","paths":{"/health":{"get":{"operationId":"HealthController_check","parameters":[],"responses":{"200":{"description":"Adapter listo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatusDto"}}}},"503":{"description":"S/4 en uso sin configuracion completa: mismo cuerpo con status=degraded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatusDto"}}}}},"summary":"Health check (modo y configuracion de S/4 cargados al arrancar)","tags":["health"]}},"/health/ready":{"get":{"operationId":"HealthController_ready","parameters":[],"responses":{"200":{"description":""}},"summary":"Readiness probe","tags":["health"]}},"/erp/customers":{"post":{"description":"Alta del cliente en S/4 con RFC generico (D-19). Responde `[{ id: customerSap, type: Cliente }]`. El contrato trae `id` + `creationDateTime` (sobre comun D-13).","operationId":"S4hController_createCustomer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 0 — Crear Cliente","tags":["s4h"]},"put":{"description":"Servicio nuevo, separado del alta (D-19): mismo cuerpo que el Contrato 0 mas `environmentId` y `shipToAddress` con el folio `noShipTo`. Responde `[{ id: customerSap, type: Cliente }]` (D-22).","operationId":"S4hController_updateCustomer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 7 — Actualizar Cliente","tags":["s4h"]}},"/erp/first-rent-charges":{"post":{"description":"Crea el deposito en garantia y el ShipTo. Responde dos documentos: `DepositoGarantia` (folio que despues viaja en `depositDocumentNumber`) y `ShipTo`.","operationId":"S4hController_firstRentCharge","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstRentChargeDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 1 — FIRST_RENT_CHARGE: primer cargo / deposito en garantia","tags":["s4h"]}},"/erp/installations":{"post":{"description":"Instalacion normal (`reinstalled: false`, con bloque de cobro) o reinstalacion / refurbished (`reinstalled: true`, sin cobro, D-28; `cycle` = numero de asignacion del asset, P-20 — es tambien el C8 del Portal). Responde `[{ id: noPedido, type: NoDocumentoPedidoVentas }]`; factura, activo y consumo corren asincronos en SAP (D-16).","operationId":"S4hController_installed","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstalledDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 2 — INSTALLED: confirmacion de instalacion (crea el pedido SD)","tags":["s4h"]}},"/erp/goods-receipts":{"post":{"description":"El centro confirma que llego, posicion por posicion, con incidencias (P-06). Responde dos documentos (P-17): `DocumentoMaterialEntrada` (50xxxxxxxx) y `NoDocumentoPedidoTraslado` (la referencia del pedido, para correlacionar).","operationId":"S4hController_goodsReceipt","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoodsReceiptDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"C2 — Recepcion en centro (Portal -> CSB -> SAP, MIGO 101)","tags":["s4h"]}},"/erp/pre-installation-cancellations":{"post":{"description":"Reversa el deposito en garantia (`originalReferenceDocument` = folio `DepositoGarantia` del FRC, D-15). Responde `[{ id, type: NoDocumentoPedidoVentas }]`. La cancelacion POST es `subscription-cancellations`.","operationId":"S4hController_preInstallationCancellation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreInstallationCancellationDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 3 — CANCELED: cancelacion PRE-instalacion","tags":["s4h"]}},"/erp/order-queries":{"post":{"description":"Por `sapOrderNumber` o por `serialNumber18d` (al menos uno). Responde un documento por dato: `OrdenInterna`, `Activo`, `DocumentoFactura`, `UUID` y `DocumentoMovimientoInventario` (consumo).","operationId":"S4hController_orderQuery","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderQueryDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 4 — Consulta: toda la data del pedido","tags":["s4h"]}},"/erp/monthly-payments":{"post":{"description":"`reference` MONTHLY_PAYMENT (al corriente), MANUAL_PAYMENT_DEBT (deuda con pago manual, v1.7) o PAYMENT_DEBT (deuda: un request por mensualidad, mismo `chargeReference`, dedup por `id`). Responde `[{ id: noPedido, type: NoDocumentoPedidoVentas }]`.","operationId":"S4hController_monthlyPayment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyPaymentDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 5 — Pago Mensualidad (cobro recurrente y pago de deuda)","tags":["s4h"]}},"/erp/invoice-queries":{"post":{"description":"Factura del pedido de una mensualidad (Contrato 5). Responde `DocumentoFactura`, `UUID` (fiscal, D-21), `DocumentoPago` y el CFDI en base64: `ArchivoXML` y `ArchivoPDF` (`id` = `<uuid>.xml|.pdf`, D-10).","operationId":"S4hController_invoiceQuery","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceQueryDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 6 — Consulta Factura por pedido de venta","tags":["s4h"]}},"/erp/credit-note-requests":{"post":{"description":"`reference` y `documentClasse` REFUND o CHARGEBACK; `refundType` TOTAL o PARTIAL (en PARTIAL manda `refundedAmount`, D-23). Responde `[{ id, type: SolNotaCredito }]`.","operationId":"S4hController_creditNoteRequest","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNoteRequestDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 8 — Reembolso / Contracargo: solicitud de nota de credito","tags":["s4h"]}},"/erp/subscription-cancellations":{"post":{"description":"Retiro del equipo instalado; sin devolucion del deposito (D-24d). Responde `[{ id, type: DocumentoMovimientoInventario }]`.","operationId":"S4hController_subscriptionCancellation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCancellationDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 9 — SUBSCRIPTION_CANCELED: cancelacion POST-instalacion","tags":["s4h"]}},"/erp/irrecoverable-equipment":{"post":{"description":"`assetStatus` fijo NREC. El bloque de cobro viaja en null si no se cobro (D-25b). Responde `DocumentoMovimientoInventario` y, solo si se cobro, `NoDocumentoPedidoVentas` (D-25a).","operationId":"S4hController_irrecoverableEquipment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IrrecoverableEquipmentDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 10 — IRRECOVERABLE_EQUIPMENT: baja de equipo irrecuperable","tags":["s4h"]}},"/erp/equipment-changes":{"post":{"description":"`remove` (sale) e `install` (entra), sin cobro (D-26e). Responde `DocumentoMaterialSalida` + `DocumentoMaterialEntrada` y, con `refurbished: false`, tambien `OrdenInterna` y `Activo` (D-26c).","operationId":"S4hController_equipmentChange","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EquipmentChangeDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 11 — EQUIPMENT_CHANGE: cambio de equipo o tecnologia","tags":["s4h"]}},"/erp/service-visits":{"post":{"description":"Instalacion FALLIDA, mantenimiento y casos especiales; la instalacion exitosa va por `installations`. Catalogo de `reference` por definir (D-27a). Responde solo `Acknowledge` (D-27d).","operationId":"S4hController_serviceVisit","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceVisitDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 12 — Servicio de Visitas (ordenes de servicio en campo)","tags":["s4h"]}},"/erp/address-change-pickups":{"post":{"description":"La parte 2 va por `installations` con `reinstalled: true` (D-28c). Responde `Acknowledge` + `DocumentoMovimientoInventario` del retiro (D-28d).","operationId":"S4hController_addressChangePickup","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressChangePickupDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Contrato 13 — ADDRESS_CHANGE_PICKUP: cambio de domicilio, parte 1 (recoleccion)","tags":["s4h"]}},"/erp/transfer-orders":{"post":{"description":"SAP crea el pedido de traspaso; cada posicion de `skus` lleva `serialNumbers` (obligatorio, v1.2). Responde `[{ id, type: NoDocumentoPedidoTraslado }]`. Abierto Q-12: el folio tarda ~15 min; la respuesta inmediata podria quedar en solo `Acknowledge`.","operationId":"S4hController_transferOrder","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOrderDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"C3 — Solicitud de pedido de traspaso Centro -> Planta maquila","tags":["s4h"]}},"/erp/goods-issues":{"post":{"description":"Con el pedido de C3 lleno en `purchaseOrder` (v1.8). Responde `DocumentoMaterialSalida` (49xxxxxxxx) y `NoDocumentoPedidoTraslado` con la referencia del pedido (P-17).","operationId":"S4hController_goodsIssue","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoodsIssueDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"C4 — Salida real del Centro con transportista (traslado 641)","tags":["s4h"]}},"/erp/technician-dispatches":{"post":{"description":"Sin seriales: la trazabilidad por etiqueta vive en el Portal (P-21). Responde `[{ id, type: DocumentoMaterialSalida }]`. Abierto Q-10: si SAP lo resuelve como traspaso 311.","operationId":"S4hController_technicianDispatch","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TechnicianDispatchDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"C6 — Despacho a tecnico (carga de camioneta)","tags":["s4h"]}},"/erp/technician-returns":{"post":{"description":"Un solo request mezcla `collected` true/false (P-18); cada renglon trae su `storageLocation` (DEV0 si collected, PT00 si no; v1.8). Responde `DocumentoMaterialEntrada` + `DocumentoMovimientoInventario` (traspaso). Abierto Q-16.","operationId":"S4hController_technicianReturn","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TechnicianReturnDto"}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"C7 — Devolucion del tecnico al Centro (drop-off)","tags":["s4h"]}},"/erp/inventory/asset-movements":{"post":{"description":"Cuerpo { cabecera: { Serie, Material, Movimiento, Centro, Almacen, Custodio, Tipo_custodio, Referencia, Fec_conta, Evento } }; `Evento` es la llave de idempotencia. Responde { documento, status: OK | ERROR, mensaje }. Heredado del gateway de SAP ECC: S/4HANA no tiene todavia contrato para el movimiento por serie (pendiente con KPMG), asi que en dummy responde desde su fixture.","operationId":"S4hController_assetMovement","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetMovementRequestDto"}}}},"responses":{"200":{"description":"Movimiento registrado (status OK)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetMovementResponseDto"}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"SAP rechazo el movimiento (status ERROR)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetMovementResponseDto"}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"CSB-01 — Movimiento de activo por serie","tags":["s4h"]}},"/erp/inventory/asset-movements/reverse":{"post":{"description":"Cuerpo { cabecera: { Documento, Motivo, Evento } }. Responde { documento, status: REVERSED | ERROR, mensaje }. Misma situacion que el movimiento: sin contrato S/4 todavia.","operationId":"S4hController_reverseAssetMovement","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetMovementReverseRequestDto"}}}},"responses":{"200":{"description":"Movimiento anulado (status REVERSED)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetMovementResponseDto"}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"SAP rechazo la anulacion (status ERROR)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetMovementResponseDto"}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"CSB-01 — Anulacion del movimiento de activo (compensacion)","tags":["s4h"]}},"/erp/{operation}":{"post":{"description":"Para operaciones fuera del catalogo (sin contrato en el HTML TO-BE): el cuerpo se acepta como `object` y se reenvia tal cual al cliente de S/4 (lineamiento de Hugo). En dummy responde un `Acknowledge` con el `id` del request. El nombre va en kebab-case, p. ej. `condonations`.","operationId":"S4hController_generic","parameters":[{"name":"operation","required":true,"in":"path","description":"kebab-case, 3-40 caracteres","schema":{"example":"condonations","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"SAP registro la operacion (documentos con severity I/S/W)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"400":{"description":"Cuerpo invalido contra el contrato (class-validator)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"422":{"description":"Rechazo de negocio de SAP (severity E/A); el cuerpo trae el motivo","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SapDocumentDto"}}}}},"429":{"description":"S/4HANA limito la tasa de peticiones; reintentar tras Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"502":{"description":"S/4HANA caido, inalcanzable, 5xx, 4xx sin JSON o credenciales rechazadas","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"503":{"description":"S/4HANA en modo live sin configurar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}},"504":{"description":"S/4HANA no respondio a tiempo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponseDto"}}}}},"security":[{"api-key":[]}],"summary":"Operacion sin DTO definido — bypass generico","tags":["s4h"]}}},"info":{"title":"ERP Adapter API","description":"Adapter de integracion SAP S/4HANA para Rotoplas Bebbia. Recibe llamadas sincronas del CSB (Cloud Workflows, OIDC) bajo /erp/*: los contratos del HTML TO-BE de Bebbia y del Portal tal cual, y responde el sobre comun [{ id, type, response, severity, error, messageError }]. El prefijo anterior /erp/s4h/* sigue vivo como alias deprecated mientras el CSB migra. NUNCA se expone directamente a internet.","version":"rtp-erp-adapter-dev-api-401add4","contact":{}},"tags":[{"name":"s4h","description":"S/4HANA — /erp/*: contratos 0-13 del HTML TO-BE de Bebbia, C2, C3, C4, C6, C7 del Portal, el movimiento de activo de CSB-01 (sin contrato S/4 todavia) y una ruta generica para operaciones fuera del catalogo. Modo dummy hasta tener credenciales"},{"name":"health","description":"Liveness / readiness"}],"servers":[],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Llave del adapter para el ambiente. Obligatoria en /erp/* cuando el guard esta encendido (API_KEY_GUARD_ENABLED=true)."}},"schemas":{"HealthChecksDto":{"type":"object","properties":{"s4h_config":{"type":"string","enum":["ok","incomplete"],"description":"Host, token URL y cliente OAuth de S/4 presentes (nunca muestra valores)"}},"required":["s4h_config"]},"HealthStatusDto":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"]},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"},"component":{"type":"string","enum":["csb-erp-adapter"]},"provider":{"type":"string","enum":["s4h"]},"mode":{"type":"string","enum":["dummy","live"]},"liveOperations":{"description":"Operaciones que van a S/4 aunque el modo sea dummy (S4H_LIVE_OPERATIONS)","example":["create-customer"],"type":"array","items":{"type":"string"}},"checks":{"$ref":"#/components/schemas/HealthChecksDto"}},"required":["status","timestamp","version","component","provider","mode","liveOperations","checks"]},"CustomerDto":{"type":"object","properties":{"name":{"type":"string","example":"NOMBRE APELLIDO","maxLength":35,"description":"SAP NAME1"},"legalName":{"type":"string","example":"NOMBRE APELLIDO","maxLength":35,"description":"Razon social (= name en persona fisica)"},"rfc":{"type":"string","example":"XAXX010101000","description":"Generico en el alta (D-19); real cuando pide factura"},"taxRegime":{"type":"string","example":"616","description":"SAT c_RegimenFiscal"},"cfdiUse":{"type":"string","example":"S01","description":"SAT c_UsoCFDI"},"paymentForm":{"type":"string","example":"04","description":"SAT c_FormaPago"},"paymentMethod":{"type":"string","example":"PUE","enum":["PUE","PPD"]},"email":{"type":"string","example":"cliente@ejemplo.com","maxLength":241},"phone":{"type":"string","example":"5500000000","description":"Solo digitos (10 nacional)"},"distributionChannel":{"type":"object","example":"09","nullable":true,"maxLength":2,"description":"VTWEG; catalogo pendiente (D-22); opcional (v1.7)"},"subchannel":{"type":"object","example":null,"nullable":true,"maxLength":4},"segment":{"type":"object","example":null,"nullable":true,"maxLength":10},"currency":{"type":"object","example":null,"nullable":true,"description":"ISO-4217 (MXN)"},"paymentTerms":{"type":"object","example":"Y000","nullable":true,"maxLength":4,"description":"Condicion de pago SAP (ZTERM); opcional (v1.7)"},"subscription":{"type":"object","example":"81120262815C","nullable":true,"maxLength":18,"description":"Id largo de la suscripcion; opcional, maximo 18 (v1.7)"},"subscriptionStatus":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Valores por definir; opcional (v1.7)"},"environmentId":{"type":"object","example":null,"nullable":true,"maxLength":21,"description":"nanoID (21); opcional y vacio hasta marzo 2027 (D-22, v1.7)"}},"required":["name","legalName","rfc","taxRegime","cfdiUse","paymentForm","paymentMethod","email","phone"]},"FiscalAddressDto":{"type":"object","properties":{"name":{"type":"object","example":null,"nullable":true,"maxLength":35,"description":"Nombre del destinatario (SAP NAME1)"},"street":{"type":"string","example":"Calle","maxLength":60},"number":{"type":"string","example":"10","maxLength":10,"description":"Numero exterior; string: admite \"10-B\", \"S/N\""},"interior":{"type":"object","example":"3B","nullable":true,"maxLength":10,"description":"Numero interior"},"neighborhood":{"type":"string","example":"Colonia","maxLength":40,"description":"Colonia (CITY2)"},"municipality":{"type":"string","example":"Municipio","maxLength":40},"state":{"type":"string","example":"MEX","description":"Clave de region SAP (catalogo por confirmar, Contrato 0)"},"postalCode":{"type":"string","example":"54715","description":"CP mexicano: 5 digitos, conserva ceros a la izquierda"},"country":{"type":"string","example":"MX","description":"ISO-3166-1 alpha-2"},"city":{"type":"string","example":"CDMX","maxLength":40,"description":"Ciudad; obligatoria en el Contrato 0 (v1.7)"}},"required":["street","number","neighborhood","municipality","state","postalCode","country","city"]},"CreateCustomerDto":{"type":"object","properties":{"id":{"type":"string","example":"9f1c2e4a-7b3d-4e8f-a1c5-2d9b6e0f4a71","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-10-09T16:52:10Z","description":"ISO-8601 UTC"},"customerKey":{"type":"string","example":"ABC12","maxLength":5,"description":"Id corto del CLIENTE en Bebbia (5 alfanumericos); no es la suscripcion"},"reference":{"type":"string","example":"CUSTOMER_CREATE","maxLength":40,"description":"Contrato Unificado v1.3: CUSTOMER_CREATE (Contrato 0) o CUSTOMER_UPDATE (Contrato 7); se reenvia tal cual a SAP"},"customer":{"$ref":"#/components/schemas/CustomerDto"},"fiscalAddress":{"$ref":"#/components/schemas/FiscalAddressDto"}},"required":["id","creationDateTime","customerKey","reference","customer","fiscalAddress"]},"SapDocumentDto":{"type":"object","properties":{"id":{"type":"string","example":"1406962719","description":"Folio limpio del documento SAP (vacio si hubo error)"},"type":{"type":"string","example":"NoDocumentoPedidoVentas","description":"Tipo del catalogo, en PascalCase"},"response":{"type":"string","example":"No Pedido 1406962719","description":"Mensaje humano con el folio legible"},"severity":{"type":"string","example":"S","description":"I | S | W | E | A"},"error":{"type":"string","example":"","description":"Codigo de error; \"\" si no hay"},"messageError":{"type":"string","example":"","description":"Detalle del error (longitud BAPI = 220)"}},"required":["id","type","response","severity","error","messageError"]},"ErrorDetailDto":{"type":"object","properties":{"message":{"description":"Que paso. En un 400 de validacion del cuerpo es la lista de mensajes del DTO.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error_code":{"type":"string","description":"Codigo estable del adapter: SAP_S4H_* (falla de S/4), VALIDATION_ERROR, SCHEMA_VALIDATION_FAILED, UNAUTHORIZED, PAYLOAD_TOO_LARGE o UNSUPPORTED_MEDIA_TYPE. No viene en un 500 ni en el 404 de una ruta que no existe.","example":"SAP_S4H_UNAVAILABLE"},"upstream_status":{"type":"number","description":"Status que respondio S/4HANA"},"upstream_body":{"type":"string","description":"Lo que respondio S/4HANA, como texto (a lo mas 500 caracteres)"},"retry_after":{"type":"string","description":"Retry-After de S/4HANA en un 429; tambien sale como header"},"operation":{"type":"string","description":"Operacion del catalogo sin iFlow conectado en este ambiente (SAP_S4H_NOT_CONNECTED)"}},"required":["message"]},"ErrorResponseDto":{"type":"object","properties":{"success":{"type":"boolean","example":false},"statusCode":{"type":"number"},"timestamp":{"type":"string","format":"date-time"},"path":{"type":"string","example":"/erp/customers"},"error":{"$ref":"#/components/schemas/ErrorDetailDto"}},"required":["success","statusCode","timestamp","path","error"]},"FirstRentChargeHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"9f1c2e4a-7b3d-4e8f-a1c5-2d9b6e0f4a71","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-08-11T15:00:00Z"},"customerSap":{"type":"string","example":"0004602025","description":"KUNNR, 10 digitos con ceros a la izquierda"},"subscription":{"type":"string","example":"81120262815C","maxLength":18,"description":"Id largo de la suscripcion; maximo 18 (v1.7)"},"customerKey":{"type":"string","example":"6CXNK","maxLength":5,"description":"Id corto del CLIENTE (Puertas v1.4)"},"reference":{"type":"string","example":"FIRST_RENT_CHARGE","enum":["FIRST_RENT_CHARGE"]},"reinstalled":{"type":"object","example":false,"nullable":true,"description":"true = reinstalacion/refurbished (D-28); opcional en FRC"},"cycle":{"type":"object","example":1,"nullable":true,"description":"Numero de asignacion del asset (P-20); opcional en FRC"},"orderId":{"type":"string","example":"81120262815C","maxLength":40,"description":"Asset / orden Bebbia"},"chargeReference":{"type":"string","example":"pay_6c762554958676439bhdjsuejsud","maxLength":64,"description":"Referencia del cargo en la pasarela"},"paymentGateway":{"type":"string","example":"OPENPAY","enum":["OPENPAY","KUSHKI","NOGATEWAY"],"description":"Obligatorio (v1.7); NOGATEWAY = monto cero, con chargeReference \"SinCargos\""},"paymentGatewayId":{"type":"string","example":"tr9384759342734","maxLength":64,"description":"Id de la transaccion en la pasarela; obligatorio (v1.7)"},"postingDate":{"type":"string","example":"2026-08-11","description":"Fecha de contabilizacion = dia del cobro (D-20)"},"documentDate":{"type":"object","example":null,"nullable":true},"paymentAmount":{"type":"string","example":"276.75","description":"NETO cobrado = materialAmount - materialDiscount (D-03)"},"currency":{"type":"string","example":"MXN","enum":["MXN"]},"depositDocumentNumber":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Vacio en el primer envio: SAP lo genera (D-02)"},"paymentForm":{"type":"string","example":"04","description":"SAT c_FormaPago (04 tarjeta)"},"distributionChannel":{"type":"object","example":null,"nullable":true,"maxLength":2},"subchannel":{"type":"object","example":null,"nullable":true,"maxLength":4},"segment":{"type":"object","example":null,"nullable":true,"maxLength":10}},"required":["id","creationDateTime","customerSap","subscription","customerKey","reference","orderId","chargeReference","paymentGateway","paymentGatewayId","postingDate","paymentAmount","currency","paymentForm"]},"FirstRentChargeItemDto":{"type":"object","properties":{"material":{"type":"object","example":"01tPc000001w1kjIAA","nullable":true,"maxLength":18,"description":"SKU de commercetools; opcional (Puertas v1.4)"},"serviceMaterial":{"type":"object","example":null,"nullable":true,"maxLength":18,"description":"Material de servicio (ej. 540320); vacio en FRC"},"asset":{"type":"object","example":"81120262815C","nullable":true,"maxLength":18,"description":"= orderId del header; opcional (Puertas v1.4)"},"quantity":{"type":"object","example":1,"nullable":true,"description":"Entero >= 1; opcional (Puertas v1.4)"},"serialNumber18d":{"type":"object","example":null,"nullable":true,"description":"BB + 16 digitos; null hasta que se asigna en la instalacion"},"materialAmount":{"type":"string","example":"369.00","description":"BRUTO (D-03)"},"materialDiscount":{"type":"string","example":"92.25","description":"Descuento (D-03): paymentAmount = materialAmount - materialDiscount"}},"required":["materialAmount","materialDiscount"]},"AddressDto":{"type":"object","properties":{"name":{"type":"object","example":null,"nullable":true,"maxLength":35,"description":"Nombre del destinatario (SAP NAME1)"},"street":{"type":"string","example":"Calle","maxLength":60},"number":{"type":"string","example":"10","maxLength":10,"description":"Numero exterior; string: admite \"10-B\", \"S/N\""},"interior":{"type":"object","example":"3B","nullable":true,"maxLength":10,"description":"Numero interior"},"neighborhood":{"type":"string","example":"Colonia","maxLength":40,"description":"Colonia (CITY2)"},"municipality":{"type":"string","example":"Municipio","maxLength":40},"state":{"type":"string","example":"MEX","description":"Clave de region SAP (catalogo por confirmar, Contrato 0)"},"postalCode":{"type":"string","example":"54715","description":"CP mexicano: 5 digitos, conserva ceros a la izquierda"},"country":{"type":"string","example":"MX","description":"ISO-3166-1 alpha-2"},"city":{"type":"object","example":"CDMX","nullable":true,"maxLength":40,"description":"Opcional (Puertas v1.4); obligatoria en fiscalAddress del Contrato 0 (v1.7)"}},"required":["street","number","neighborhood","municipality","state","postalCode","country"]},"FirstRentChargeDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/FirstRentChargeHeaderDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FirstRentChargeItemDto"}},"shipToAddress":{"description":"Bloque completo en las 3 operaciones (D-18)","allOf":[{"$ref":"#/components/schemas/AddressDto"}]}},"required":["header","items","shipToAddress"]},"InstalledHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"9f1c2e4a-7b3d-4e8f-a1c5-2d9b6e0f4a71","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-08-11T15:00:00Z"},"customerSap":{"type":"string","example":"0004602025"},"subscription":{"type":"string","example":"81120262815C","maxLength":18,"description":"Id de la suscripcion; maximo 18 (v1.7)"},"customerKey":{"type":"string","example":"6CXNK","maxLength":5,"description":"Id corto del CLIENTE (Puertas v1.5)"},"idSupplier":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Proveedor; acepta null (v1.7)"},"reference":{"type":"string","example":"INSTALLED","enum":["INSTALLED"],"description":"D-01: INSTALLED con doble L"},"reinstalled":{"type":"boolean","example":false,"description":"true = reinstalacion / refurbished => sin bloque de cobro (D-28)"},"cycle":{"type":"number","example":1,"description":"Numero de asignacion del asset (P-20): 1 = primera instalacion"},"orderId":{"type":"string","example":"81120262815C","maxLength":40},"chargeReference":{"type":"object","example":"pay_6c762554958676439bhdjsuejsud","nullable":true,"maxLength":64},"paymentGateway":{"type":"string","example":"OPENPAY","nullable":true,"enum":["OPENPAY","KUSHKI","NOGATEWAY"],"description":"Obligatorio salvo con reinstalled = true (D-28); NOGATEWAY = monto cero (v1.7)"},"paymentGatewayId":{"type":"object","example":"tr9384759342734","nullable":true,"maxLength":64,"description":"Obligatorio salvo con reinstalled = true (D-28b, v1.7)"},"postingDate":{"type":"string","example":"2026-08-11"},"documentDate":{"type":"object","example":"2026-08-11","nullable":true,"description":"Acepta null (v1.7)"},"paymentAmount":{"type":"object","example":"276.75","nullable":true,"description":"NETO; se omite con reinstalled = true"},"currency":{"type":"string","example":"MXN","enum":["MXN"]},"depositDocumentNumber":{"type":"object","example":"1406962719","nullable":true,"maxLength":10,"description":"Folio del deposito creado en FIRST_RENT_CHARGE (D-02); se omite con reinstalled = true"},"paymentForm":{"type":"object","example":"04","nullable":true,"description":"SAT c_FormaPago; se omite con reinstalled = true"},"distributionChannel":{"type":"object","example":null,"nullable":true,"maxLength":2},"subchannel":{"type":"object","example":null,"nullable":true,"maxLength":4},"segment":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Distinto de sector (D-05)"},"orderCost":{"type":"object","example":null,"nullable":true,"description":"Costo de la orden de instalacion; acepta null (v1.7)"},"orderDocumentClass":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"AUART"},"salesOrg":{"type":"string","example":"MX07","description":"VKORG"},"companyCode":{"type":"string","example":"MX07","description":"BUKRS"},"plant":{"type":"string","example":"CZCT","description":"WERKS: centro del que salio el producto"},"warehouse":{"type":"string","example":"ZC53","description":"LGORT"},"businessArea":{"type":"string","example":"Residencial","enum":["Residencial","Institucional","Horecas","Productos"],"nullable":true,"description":"Opcional en el Contrato v1.7 (—)"},"serviceOrder":{"type":"object","example":null,"nullable":true,"description":"Orden de servicio (hoy OSERV en WS11); sin longitud maxima (Puertas v1.5)"},"orderDescription":{"type":"object","example":null,"nullable":true,"maxLength":40},"noShipTo":{"type":"string","example":"1406962720","maxLength":10,"description":"Folio del ShipTo creado en FIRST_RENT_CHARGE (Puertas v1.5: antes shipToNumber)"},"subscriptionStatus":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Se queda (D-14); catalogo pendiente"},"installationDate":{"type":"object","example":null,"nullable":true,"description":"Fecha de instalacion (D-06)"},"plannedDate":{"type":"object","example":null,"nullable":true,"description":"Fecha acordada (D-06)"},"actualDate":{"type":"object","example":null,"nullable":true,"description":"Fecha efectiva (D-06)"}},"required":["id","creationDateTime","customerSap","subscription","customerKey","reference","reinstalled","cycle","orderId","postingDate","currency","salesOrg","companyCode","plant","warehouse","noShipTo"]},"InstalledItemDto":{"type":"object","properties":{"material":{"type":"string","example":"01tPc000001w1kjIAA","maxLength":18},"serviceMaterial":{"type":"string","example":"540320","maxLength":18,"description":"Material de servicio (instalacion)"},"asset":{"type":"string","example":"81120262815C","maxLength":18,"description":"= orderId; obligatorio (v1.7)"},"quantity":{"type":"number","example":1},"serialNumber18d":{"type":"string","example":"BB0000000000000019","description":"BB + 16 digitos; obligatorio (v1.7: solo la Baja de equipo lo deja opcional)"},"materialAmount":{"type":"string","example":"369.00","description":"BRUTO (D-03)"},"materialDiscount":{"type":"string","example":"92.25","description":"Descuento (D-03); obligatorio (v1.7)"},"materialTaxRate":{"type":"string","example":"16","enum":["16","8","0"],"description":"Tasa de IVA de la posicion (PDF 7 puertas v1.6, 16 nov)"},"materialNetAmount":{"type":"string","example":"318.10","description":"Costo sin impuestos (PDF 7 puertas v1.6, 16 nov)"}},"required":["material","serviceMaterial","asset","quantity","serialNumber18d","materialAmount","materialDiscount","materialTaxRate","materialNetAmount"]},"InstalledDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/InstalledHeaderDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/InstalledItemDto"}},"shipToAddress":{"description":"Domicilio de entrega; bloque completo (D-18, v1.7)","allOf":[{"$ref":"#/components/schemas/AddressDto"}]}},"required":["header","items","shipToAddress"]},"PlantOriginDto":{"type":"object","properties":{"plantId":{"type":"string","example":"2100","description":"Planta SAP (WERKS)"},"name":{"type":"object","example":"Planta Monterrey","nullable":true,"description":"Nombre legible; opcional, null si no hay (v1.7)"}},"required":["plantId"]},"CenterDestinationDto":{"type":"object","properties":{"centerId":{"type":"string","example":"CTR-SNG-01","maxLength":10,"description":"Clave del centro en el Portal (P-07)"},"sapCenter":{"type":"string","example":"SNG1","maxLength":4,"description":"Centro SAP (WERKS)"},"name":{"type":"object","example":"Centro Monterrey","nullable":true,"description":"Nombre legible; opcional, null si no hay (v1.7)"},"storageLocation":{"type":"string","example":"PT00","description":"Almacen SAP (LGORT)"}},"required":["centerId","sapCenter","storageLocation"]},"PositionSkuDto":{"type":"object","properties":{"positionId":{"type":"string","example":"0010","description":"Posicion del pedido SAP (EBELP), ceros a la izquierda"},"sku":{"type":"string","example":"300467","description":"Material SAP (MATNR)"},"quantity":{"type":"number","example":504,"description":"Entero >= 1"},"uom":{"type":"string","example":"PZA","description":"Unidad de medida SAP"}},"required":["positionId","sku","quantity","uom"]},"IncidenceDto":{"type":"object","properties":{"positionId":{"type":"string","example":"0010"},"sku":{"type":"string","example":"300467"},"missing":{"type":"number","example":1},"damaged":{"type":"number","example":1},"surplus":{"type":"number","example":0},"wrongSku":{"type":"number","example":0}},"required":["positionId","sku","missing","damaged","surplus","wrongSku"]},"GoodsReceiptOperationDto":{"type":"object","properties":{"orderId":{"type":"string","example":"0000100245","maxLength":10,"description":"Numero de ShipTo en SAP (v1.8)"},"purchaseOrder":{"type":"string","example":"0001077493","maxLength":10,"description":"Pedido de compra SAP (EBELN), numerico con ceros => string (v1.8)"},"deliveryNote":{"type":"string","example":"0203702349","maxLength":10,"description":"Nota de entrega; obligatoria (v1.8)"},"sapStoId":{"type":"string","example":"0003078680","maxLength":10,"description":"Pedido de traslado (STO) en SAP"},"origin":{"$ref":"#/components/schemas/PlantOriginDto"},"destination":{"$ref":"#/components/schemas/CenterDestinationDto"},"skus":{"type":"array","items":{"$ref":"#/components/schemas/PositionSkuDto"}},"totalUnits":{"type":"number","example":726,"description":"= suma de quantity de skus[]"},"eta":{"type":"object","example":"2026-09-28T15:00:00-06:00","nullable":true,"description":"ISO-8601 con offset (P-12); opcional, null sin dato (v1.7)"},"hasOpenIncidence":{"type":"boolean","example":true,"description":"Nombre unico en todos los contratos (P-05)"},"incidences":{"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/IncidenceDto"}}},"required":["orderId","purchaseOrder","deliveryNote","sapStoId","origin","destination","skus","totalUnits","hasOpenIncidence"]},"GoodsReceiptDto":{"type":"object","properties":{"id":{"type":"string","example":"4b8e1f6c-2a9d-4c3e-b7f0-8e5a1d2c9b64","description":"UUID v4 (P-01): una recepcion jamas se aplica dos veces"},"creationDateTime":{"type":"string","example":"2026-09-28T21:17:40Z"},"status":{"type":"string","example":"RECEIVED","enum":["RECEIVED"],"description":"Siempre de negocio (P-10)"},"data":{"type":"array","items":{"$ref":"#/components/schemas/GoodsReceiptOperationDto"}}},"required":["id","creationDateTime","status","data"]},"PreInstallationCancellationHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"3c4d5e6f-7081-4c9d-8e0f-1a2b3c4d5e6f","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-08-11T15:00:00Z"},"customerSap":{"type":"string","example":"0004602025"},"subscription":{"type":"object","example":"6CXNK","nullable":true,"description":"Nombre anterior del id corto del cliente; se acepta, pero no sustituye a customerKey (doc v1.6)"},"customerKey":{"type":"string","example":"6CXNK","maxLength":5,"description":"Id corto del cliente; obligatorio (doc v1.6)"},"reference":{"type":"string","example":"CANCELED","enum":["CANCELED"],"description":"Cancelacion PRE-instalacion; la POST es el Contrato 9 (D-11)"},"orderId":{"type":"string","example":"81120262815C","maxLength":40},"chargeReference":{"type":"string","example":"pay_6c762554958676439bhdjsuejsud"},"paymentGateway":{"type":"string","example":"OPENPAY","enum":["OPENPAY","KUSHKI","NOGATEWAY"],"description":"Pasarela del cobro original; NOGATEWAY = monto cero (v1.7)"},"paymentGatewayId":{"type":"string","example":"tr9384759342734"},"postingDate":{"type":"string","example":"2026-08-11"},"documentDate":{"type":"object","example":null,"nullable":true,"description":"Aqui = fecha de cancelacion; acepta null (v1.7)"},"paymentAmount":{"type":"string","example":"276.75","description":"NETO (D-03)"},"currency":{"type":"string","example":"MXN","enum":["MXN"]},"depositDocumentNumber":{"type":"object","example":null,"nullable":true,"description":"Nombre cerrado D-02; el ejemplo del HTML lo trae vacio"},"paymentForm":{"type":"string","example":"04","description":"SAT c_FormaPago; obligatorio (bloque de cobro, v1.7)"},"originalReferenceDocument":{"type":"string","example":"1406962719","description":"Folio del DEPOSITO en garantia que se reversa (type DepositoGarantia del FRC, D-15)"},"refundTransactionRef":{"type":"object","nullable":true,"maxLength":64,"example":"ref_609d66575b3545688310b4f82c1851e5","description":"Traza de la devolucion en el orquestador de pagos (v1.7); no sustituye a chargeReference"},"refundTransactionId":{"type":"object","nullable":true,"maxLength":64,"example":"trjuvkvgb6p8b9hgy8ko","description":"Traza de la devolucion en la pasarela de pagos (v1.7); no sustituye a paymentGatewayId"}},"required":["id","creationDateTime","customerSap","customerKey","reference","orderId","chargeReference","paymentGateway","paymentGatewayId","postingDate","paymentAmount","currency","paymentForm","originalReferenceDocument"]},"PreInstallationCancellationItemDto":{"type":"object","properties":{"material":{"type":"object","nullable":true,"example":"01tPc000001w1kjIAA"},"serviceMaterial":{"type":"object","example":"540320","nullable":true,"description":"Material de servicio; opcional (tabla de campos V2 de KPMG): si S/4 lo exige, lo rechaza SAP"},"asset":{"type":"object","nullable":true,"example":"81120262815C"},"quantity":{"type":"object","nullable":true,"example":1},"serialNumber18d":{"type":"object","example":"BB0000000000000019","nullable":true,"description":"BB + 16 digitos; opcional: antes de instalar el equipo puede no tener serie"},"materialAmount":{"type":"string","example":"369.00","description":"BRUTO (D-03)"},"materialDiscount":{"type":"string","example":"92.25","description":"Descuento (D-03); obligatorio en el Contrato 3 (doc v1.6)"}},"required":["materialAmount","materialDiscount"]},"PreInstallationCancellationDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/PreInstallationCancellationHeaderDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PreInstallationCancellationItemDto"}},"shipToAddress":{"description":"Bloque completo en las 3 operaciones (D-18); el HTML lo abrevia como { … }","allOf":[{"$ref":"#/components/schemas/AddressDto"}]}},"required":["header","items","shipToAddress"]},"OrderQueryHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"4d5e6f70-8192-4dae-9f01-2b3c4d5e6f70","description":"UUID v4 (D-13); obligatorio (doc v1.6)"},"creationDateTime":{"type":"string","example":"2026-10-22T15:00:00Z"},"reference":{"type":"string","example":"ORDER_INQUIRY","enum":["ORDER_INQUIRY"],"description":"Obligatorio (doc v1.6): ORDER_INQUIRY"},"sapOrderNumber":{"type":"object","example":"1406962719","nullable":true,"description":"Pedido SD (VBELN); obligatorio si no viene serialNumber18d"},"serialNumber18d":{"type":"object","example":null,"nullable":true,"description":"Antes NoSerie, unificado (D-17); BB + 16 digitos"}},"required":["id","creationDateTime","reference"]},"OrderQueryDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/OrderQueryHeaderDto"}},"required":["header"]},"MonthlyPaymentHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"5e6f7081-92a3-4bcd-8e12-3c4d5e6f7081","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-09-27T23:52:00Z"},"noShipTo":{"type":"string","example":"1406962720","maxLength":10,"description":"Folio del ShipTo (KUNNR destinatario; Puertas v1.5: antes shipTo)"},"customerSap":{"type":"string","example":"0004590870"},"subscriptionStatus":{"type":"object","example":null,"nullable":true,"description":"Se queda (D-14); valores por definir"},"salesOrg":{"type":"string","example":"MX07","description":"VKORG, mismo dato que en INSTALLED"},"sector":{"type":"string","example":"10","description":"Distinto de segment (D-05); catalogo por publicar"},"customerKey":{"type":"string","example":"XZL24","maxLength":5},"orderId":{"type":"string","example":"d9468af4-b61f-482f-999c-0f6ac4c1b3be","maxLength":40,"description":"UUID de la orden de pago en la tienda; uno por request (Puertas v1.5: antes storeOrderId)"},"monthlyPaymentId":{"type":"number","example":6538702,"description":"MensualidadId de Bebbia (integer); uno por request"},"chargeReference":{"type":"string","example":"pay_6c762554958676439bhdjsuejsud","description":"Se repite en el split de deuda: NO sirve para dedup"},"paymentGateway":{"type":"string","example":"OPENPAY","enum":["OPENPAY","KUSHKI","NOGATEWAY"],"description":"NOGATEWAY = monto cero, con chargeReference \"SinCargos\" (v1.7)"},"paymentGatewayId":{"type":"string","example":"tr9384759342734","maxLength":64,"description":"Id de la transaccion en la pasarela; obligatorio (bloque de cobro, v1.7)"},"billingPeriod":{"type":"string","example":"2026-03","description":"YYYY-MM del mes que se cobra o recupera (D-20)"},"documentDate":{"type":"string","example":"2026-08-11","description":"Fecha que corresponde al pago (periodo original; clave en deuda)"},"postingDate":{"type":"string","example":"2026-09-27","description":"Dia en que se logra el cobro"},"paymentAmount":{"type":"object","example":"295.20","nullable":true,"description":"NETO cobrado (D-03); fuera del JSON del HTML, en el diccionario"},"currency":{"type":"string","example":"MXN","enum":["MXN"]},"paymentForm":{"type":"string","example":"04","description":"SAT c_FormaPago; tambien 04 en deuda (D-12)"},"reference":{"type":"string","example":"MONTHLY_PAYMENT","enum":["MONTHLY_PAYMENT","PAYMENT_DEBT","MANUAL_PAYMENT_DEBT"]},"monthNumber":{"type":"object","example":3,"nullable":true,"description":"Numero de mensualidad; opcional (Puertas v1.5)"}},"required":["id","creationDateTime","noShipTo","customerSap","salesOrg","sector","customerKey","orderId","monthlyPaymentId","chargeReference","paymentGateway","paymentGatewayId","billingPeriod","documentDate","postingDate","currency","paymentForm","reference"]},"MonthlyPaymentItemDto":{"type":"object","properties":{"material":{"type":"string","example":"01tPc000001w1kjIAA"},"serviceMaterial":{"type":"string","example":"540320","maxLength":18,"description":"Material de servicio (Puertas v1.5)"},"subscription":{"type":"string","example":"625202658CXE","maxLength":18},"quantity":{"type":"number","example":1},"materialAmount":{"type":"string","example":"369.00","description":"BRUTO (D-03)"},"materialDiscount":{"type":"object","example":"73.80","nullable":true,"description":"Opcional (Puertas v1.5)"},"materialTaxRate":{"type":"string","example":"16","enum":["16","8","0"],"description":"Tasa de IVA de la posicion (PDF 7 puertas v1.6, 16 nov)"},"materialNetAmount":{"type":"string","example":"318.10","description":"Costo sin impuestos (PDF 7 puertas v1.6, 16 nov)"}},"required":["material","serviceMaterial","subscription","quantity","materialAmount","materialTaxRate","materialNetAmount"]},"MonthlyPaymentDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/MonthlyPaymentHeaderDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/MonthlyPaymentItemDto"}}},"required":["header","items"]},"InvoiceQueryHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"6f708192-a3b4-4cde-9f23-4d5e6f708192","description":"UUID v4 (D-13); obligatorio (doc v1.6)"},"creationDateTime":{"type":"string","example":"2026-10-22T15:00:00Z"},"reference":{"type":"string","example":"INVOICE_INQUIRY","enum":["INVOICE_INQUIRY"],"description":"Obligatorio (doc v1.6): INVOICE_INQUIRY; se reenvia tal cual a SAP"},"sapOrderNumber":{"type":"string","example":"1406963105","description":"Folio del pedido de ventas que regreso Pago Mensualidad (Contrato 5); KPMG lo nombra pedidoVenta"},"subscription":{"type":"object","example":"625202658CXE","nullable":true}},"required":["id","creationDateTime","reference","sapOrderNumber"]},"InvoiceQueryDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/InvoiceQueryHeaderDto"}},"required":["header"]},"OptionalAddressDto":{"type":"object","properties":{"name":{"type":"object","example":null,"nullable":true,"maxLength":35,"description":"Nombre del destinatario (SAP NAME1)"},"street":{"type":"string","example":"Calle","maxLength":60},"number":{"type":"string","example":"10","maxLength":10,"description":"Numero exterior; string: admite \"10-B\", \"S/N\""},"interior":{"type":"object","example":"3B","nullable":true,"maxLength":10,"description":"Numero interior"},"neighborhood":{"type":"string","example":"Colonia","maxLength":40,"description":"Colonia (CITY2)"},"municipality":{"type":"string","example":"Municipio","maxLength":40},"state":{"type":"string","example":"MEX","description":"Clave de region SAP (catalogo por confirmar, Contrato 0)"},"postalCode":{"type":"string","example":"54715","description":"CP mexicano: 5 digitos, conserva ceros a la izquierda"},"country":{"type":"string","example":"MX","description":"ISO-3166-1 alpha-2"},"city":{"type":"object","example":"CDMX","nullable":true,"maxLength":40,"description":"Opcional (Puertas v1.4); obligatoria en fiscalAddress del Contrato 0 (v1.7)"}}},"UpdateCustomerDataDto":{"type":"object","properties":{"name":{"type":"string","example":"NOMBRE APELLIDO","maxLength":35,"description":"SAP NAME1"},"legalName":{"type":"string","example":"NOMBRE APELLIDO","maxLength":35,"description":"Razon social (= name en persona fisica)"},"rfc":{"type":"string","example":"XAXX010101000","description":"Generico en el alta (D-19); real cuando pide factura"},"taxRegime":{"type":"string","example":"616","description":"SAT c_RegimenFiscal"},"cfdiUse":{"type":"string","example":"S01","description":"SAT c_UsoCFDI"},"paymentForm":{"type":"string","example":"04","description":"SAT c_FormaPago"},"paymentMethod":{"type":"string","example":"PUE","enum":["PUE","PPD"]},"email":{"type":"string","example":"cliente@ejemplo.com","maxLength":241},"phone":{"type":"string","example":"5500000000","description":"Solo digitos (10 nacional)"},"distributionChannel":{"type":"object","example":"09","nullable":true,"maxLength":2,"description":"VTWEG; catalogo pendiente (D-22); opcional (v1.7)"},"subchannel":{"type":"object","example":null,"nullable":true,"maxLength":4},"segment":{"type":"object","example":null,"nullable":true,"maxLength":10},"currency":{"type":"object","example":null,"nullable":true,"description":"ISO-4217 (MXN)"},"paymentTerms":{"type":"object","example":"Y000","nullable":true,"maxLength":4,"description":"Condicion de pago SAP (ZTERM); opcional (v1.7)"},"subscription":{"type":"object","example":"81120262815C","nullable":true,"maxLength":18,"description":"Id largo de la suscripcion; opcional, maximo 18 (v1.7)"},"subscriptionStatus":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Valores por definir; opcional (v1.7)"},"environmentId":{"type":"object","example":null,"nullable":true,"maxLength":21,"description":"nanoID (21); opcional y vacio hasta marzo 2027 (D-22, v1.7)"},"customerSap":{"type":"string","example":"0004602025","description":"KUNNR, 10 digitos: el que devolvio el alta (CSB-02)"}},"required":["name","legalName","rfc","taxRegime","cfdiUse","paymentForm","paymentMethod","email","phone","customerSap"]},"ShipToAddressUpdateDto":{"type":"object","properties":{"name":{"type":"object","example":null,"nullable":true,"maxLength":35,"description":"Nombre del destinatario (SAP NAME1)"},"street":{"type":"string","example":"Calle","maxLength":60},"number":{"type":"string","example":"10","maxLength":10,"description":"Numero exterior; string: admite \"10-B\", \"S/N\""},"interior":{"type":"object","example":"3B","nullable":true,"maxLength":10,"description":"Numero interior"},"neighborhood":{"type":"string","example":"Colonia","maxLength":40,"description":"Colonia (CITY2)"},"municipality":{"type":"string","example":"Municipio","maxLength":40},"state":{"type":"string","example":"MEX","description":"Clave de region SAP (catalogo por confirmar, Contrato 0)"},"postalCode":{"type":"string","example":"54715","description":"CP mexicano: 5 digitos, conserva ceros a la izquierda"},"country":{"type":"string","example":"MX","description":"ISO-3166-1 alpha-2"},"city":{"type":"object","example":"CDMX","nullable":true,"maxLength":40,"description":"Opcional (Puertas v1.4); obligatoria en fiscalAddress del Contrato 0 (v1.7)"},"noShipTo":{"type":"object","example":null,"nullable":true,"description":"Folio del ShipTo que devolvio FIRST_RENT_CHARGE; null = SAP crea uno nuevo (Puertas v1.4: antes shipTo)"}}},"UpdateCustomerDto":{"type":"object","properties":{"id":{"type":"string","example":"9f1c2e4a-7b3d-4e8f-a1c5-2d9b6e0f4a71","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-10-09T16:52:10Z","description":"ISO-8601 UTC"},"customerKey":{"type":"string","example":"ABC12","maxLength":5,"description":"Id corto del CLIENTE en Bebbia (5 alfanumericos); no es la suscripcion"},"reference":{"type":"string","example":"CUSTOMER_CREATE","maxLength":40,"description":"Contrato Unificado v1.3: CUSTOMER_CREATE (Contrato 0) o CUSTOMER_UPDATE (Contrato 7); se reenvia tal cual a SAP"},"fiscalAddress":{"description":"Solo viaja lo que cambia (Contrato 7, doc v1.6)","allOf":[{"$ref":"#/components/schemas/OptionalAddressDto"}]},"customer":{"$ref":"#/components/schemas/UpdateCustomerDataDto"},"environmentId":{"type":"object","example":null,"nullable":true,"description":"nanoID; opcional y vacio hasta marzo 2027 (D-22)"},"shipToAddress":{"$ref":"#/components/schemas/ShipToAddressUpdateDto"}},"required":["id","creationDateTime","customerKey","reference","fiscalAddress","customer","shipToAddress"]},"CreditNoteRequestHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"708192a3-b4c5-4def-8a34-5e6f708192a3","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-09-30T18:00:00Z"},"reference":{"type":"string","example":"REFUND","enum":["REFUND","CHARGEBACK","WAIVED"],"description":"Propuesta del 21 oct: espeja a documentClasse; por validar con SAP/KPMG"},"originalInvoice":{"type":"string","example":"8904760063","description":"Factura original a la que se aplica la NC"},"noShipTo":{"type":"object","example":null,"nullable":true,"description":"Folio del ShipTo; informativo para la NC"},"customerSap":{"type":"string","example":"0004590870"},"subscription":{"type":"string","example":"625202658CXE","maxLength":18},"chargeReference":{"type":"string","example":"pay_6c762554958676439bhdjsuejsud","description":"De la transaccion de reembolso"},"paymentGateway":{"type":"string","example":"OPENPAY","enum":["OPENPAY","KUSHKI","NOGATEWAY"],"description":"NOGATEWAY = monto cero, con chargeReference \"SinCargos\" (v1.7)"},"paymentGatewayId":{"type":"string","example":"tr9384759342734"},"refundedAmount":{"type":"object","example":null,"nullable":true,"description":"Obligatorio en PARTIAL: SAP acredita por este monto (D-23)"},"refundType":{"type":"string","example":"TOTAL","enum":["TOTAL","PARTIAL"]},"documentClasse":{"type":"string","example":"REFUND","enum":["REFUND","CHARGEBACK","WAIVED"],"description":"Con la e de mas a proposito (D-23)"},"subscriptionStatus":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Acepta null (v1.7)"},"customerKey":{"type":"string","example":"6CXNK","maxLength":5,"description":"Id corto del CLIENTE; obligatorio (v1.7)"},"refundReason":{"type":"object","example":null,"nullable":true,"maxLength":30,"description":"Catalogo de Cobranza (D-23); acepta null (v1.7). SAP lo lee como refundReturnReason"},"refundDate":{"type":"string","example":"2026-08-13"},"refundTransactionRef":{"type":"object","nullable":true,"maxLength":64,"example":null,"description":"Traza de la devolucion en el orquestador de pagos (v1.7); no sustituye a chargeReference"},"refundTransactionId":{"type":"object","nullable":true,"maxLength":64,"example":null,"description":"Traza de la devolucion en la pasarela de pagos (v1.7); no sustituye a paymentGatewayId"}},"required":["id","creationDateTime","reference","originalInvoice","customerSap","subscription","chargeReference","paymentGateway","paymentGatewayId","refundType","documentClasse","customerKey","refundDate"]},"CreditNoteRequestDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/CreditNoteRequestHeaderDto"}},"required":["header"]},"SubscriptionCancellationHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"8192a3b4-c5d6-4ef0-9b45-6f708192a3b4","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-08-11T15:00:00Z"},"reference":{"type":"string","example":"SUBSCRIPTION_CANCELED","enum":["SUBSCRIPTION_CANCELED"],"description":"D-24a: MAYUSCULAS en ingles"},"customerSap":{"type":"string","example":"0004602025"},"customerKey":{"type":"string","example":"6CXNK"},"postingDate":{"type":"string","example":"2026-08-11"},"documentDate":{"type":"object","example":"2026-08-11","nullable":true,"description":"Opcional (v1.7)"},"shipTo":{"type":"object","example":null,"nullable":true,"description":"Capturado sin valor; por confirmar que va (D-24)"},"noShipTo":{"type":"object","example":"1406962720","nullable":true,"maxLength":10,"description":"Mismo folio que shipTo con el nombre homologado (documento de Bebbia v1.4)"},"idSupplier":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Proveedor de la recoleccion; obligatorio si viaja orderCost (KPMG 11 nov)"},"subscriptionStatus":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Estatus de la suscripcion (catalogo de la tienda, D-14); opcional (v1.7)"},"orderCost":{"type":"object","example":null,"nullable":true},"businessArea":{"type":"string","example":"Residencial","nullable":true,"enum":["Residencial","Institucional","Horecas","Productos"],"description":"Opcional (v1.7)"},"serviceOrder":{"type":"object","example":null,"nullable":true,"maxLength":12,"description":"Orden de servicio (OSERV); opcional (v1.7)"}},"required":["id","creationDateTime","reference","customerSap","customerKey","postingDate"]},"SubscriptionCancellationItemDto":{"type":"object","properties":{"material":{"type":"string","example":"01tPc000001w1kjIAA"},"serviceMaterial":{"type":"string","example":"540320"},"subscription":{"type":"string","example":"81120262815C","maxLength":18},"quantity":{"type":"number","example":1},"serialNumber18d":{"type":"string","example":"BB0000000000000019"},"materialAmount":{"type":"string","example":"369.00","description":"BRUTO (D-03)"},"plant":{"type":"string","example":"BNZ0","description":"WERKS; en INSTALLED va en la cabecera, aqui en la linea (D-24 abierta)"},"warehouse":{"type":"string","example":"PT00","description":"LGORT (D-24 abierta)"}},"required":["material","serviceMaterial","subscription","quantity","serialNumber18d","materialAmount","plant","warehouse"]},"SubscriptionCancellationDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/SubscriptionCancellationHeaderDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionCancellationItemDto"}}},"required":["header","items"]},"IrrecoverableEquipmentHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"92a3b4c5-d6e7-4f01-8c56-708192a3b4c5","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-08-11T15:00:00Z"},"reference":{"type":"string","example":"IRRECOVERABLE_EQUIPMENT","enum":["IRRECOVERABLE_EQUIPMENT"],"description":"Propuesto, por validar con SAP/KPMG"},"customerSap":{"type":"string","example":"0004602025"},"customerKey":{"type":"string","example":"6CXNK"},"postingDate":{"type":"string","example":"2026-08-11","description":"Una sola, en cabecera (D-25c); obligatoria (v1.7)"},"documentDate":{"type":"object","example":null,"nullable":true,"description":"Fecha del documento; fecDoc del contrato"},"noShipTo":{"type":"object","example":null,"nullable":true,"description":"Folio del ShipTo del domicilio del equipo"},"businessArea":{"type":"string","example":null,"nullable":true,"enum":["Residencial","Institucional","Horecas","Productos"],"description":"Acepta null (v1.7)"},"assetStatus":{"type":"string","example":"NREC","enum":["NREC"]},"chargeReference":{"type":"object","example":null,"nullable":true,"maxLength":64,"description":"Obligatorio si viene paymentGateway, paymentGatewayId, unrecoveredAmount o billingPeriod (D-25b)"},"paymentGateway":{"type":"string","example":null,"nullable":true,"enum":["OPENPAY","KUSHKI","NOGATEWAY"],"description":"Obligatorio con chargeReference (doc v1.6); NOGATEWAY = monto cero (v1.7)"},"paymentGatewayId":{"type":"object","example":null,"nullable":true,"description":"Obligatorio con chargeReference (doc v1.6)"},"unrecoveredAmount":{"type":"object","example":null,"nullable":true,"description":"Obligatorio cuando viene chargeReference"},"billingPeriod":{"type":"object","example":null,"nullable":true,"description":"YYYY-MM (D-20); obligatorio con chargeReference"},"billingPeriodDate":{"type":"object","example":null,"nullable":true,"description":"Fecha dentro del periodo (D-06/D-20); fechaDoc del contrato; obligatoria con chargeReference"},"currency":{"type":"string","example":"MXN","nullable":true,"enum":["MXN"],"description":"Obligatoria con chargeReference (doc v1.6)"},"paymentForm":{"type":"object","example":"04","nullable":true,"description":"Obligatoria con chargeReference (doc v1.6)"},"distributionChannel":{"type":"object","example":null,"nullable":true,"description":"Obligatorio con chargeReference (doc v1.6)"},"subchannel":{"type":"object","example":null,"nullable":true,"description":"Obligatorio con chargeReference (doc v1.6)"},"segment":{"type":"object","example":null,"nullable":true}},"required":["id","creationDateTime","reference","customerSap","customerKey","postingDate","assetStatus"]},"IrrecoverableEquipmentItemDto":{"type":"object","properties":{"material":{"type":"string","example":"01tPc000001w1kjIAA"},"serviceMaterial":{"type":"object","nullable":true,"example":"540320"},"subscription":{"type":"string","example":"81120262815C","maxLength":18},"quantity":{"type":"number","example":1},"serialNumber18d":{"type":"object","example":null,"nullable":true,"description":"Opcional: el equipo irrecuperable puede no tener serie capturada"}},"required":["material","subscription","quantity"]},"IrrecoverableEquipmentDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/IrrecoverableEquipmentHeaderDto"},"items":{"type":"array","items":{"$ref":"#/components/schemas/IrrecoverableEquipmentItemDto"}}},"required":["header","items"]},"EquipmentChangeHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"a3b4c5d6-e7f8-4012-9d67-8192a3b4c5d6","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-09-30T15:00:00Z"},"customerSap":{"type":"string","example":"0004602025"},"customerKey":{"type":"string","example":"6CXNK"},"reference":{"type":"string","example":"EQUIPMENT_CHANGE","enum":["EQUIPMENT_CHANGE"],"description":"Propuesto, por validar con SAP/KPMG"},"postingDate":{"type":"object","example":null,"nullable":true,"description":"Acepta null (v1.7)"},"documentDate":{"type":"object","example":null,"nullable":true},"noShipTo":{"type":"string","example":"1406962720","maxLength":10,"description":"ShipTo del domicilio donde esta el equipo que se sustituye; obligatorio (v1.7)"},"currency":{"type":"string","nullable":true,"example":"MXN","enum":["MXN"]},"orderCost":{"type":"object","example":null,"nullable":true},"idSupplier":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Proveedor que ejecuta el cambio; obligatorio si viaja orderCost (KPMG 11 nov)"},"refurbished":{"type":"boolean","example":false,"description":"true = equipo reacondicionado: conserva el activo original, sin OrdenInterna ni Activo (D-26a/c)"},"plant":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"WERKS: centro del que salio el producto; acepta null (v1.7)"},"warehouse":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"LGORT; acepta null (v1.7)"},"businessArea":{"type":"string","example":null,"nullable":true,"enum":["Residencial","Institucional","Horecas","Productos"],"description":"Acepta null (v1.7)"},"serviceOrder":{"type":"object","example":null,"nullable":true,"description":"ORDENBRING"},"orderDescription":{"type":"object","example":null,"nullable":true},"installationDate":{"type":"object","example":null,"nullable":true,"description":"Fecha de instalacion (D-06)"},"plannedDate":{"type":"object","example":null,"nullable":true,"description":"Fecha acordada (D-06)"},"actualDate":{"type":"object","example":null,"nullable":true,"description":"Fecha efectiva (D-06)"}},"required":["id","creationDateTime","customerSap","customerKey","reference","noShipTo","refurbished"]},"EquipmentDto":{"type":"object","properties":{"material":{"type":"string","example":"01tPc000001w1kjIAA"},"serviceMaterial":{"type":"string","example":"540330"},"subscription":{"type":"string","example":"81120262815C","maxLength":18},"quantity":{"type":"number","example":1},"serialNumber18d":{"type":"string","example":"BB0000000000000382"}},"required":["material","serviceMaterial","subscription","quantity","serialNumber18d"]},"EquipmentChangeDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/EquipmentChangeHeaderDto"},"remove":{"description":"Equipo que SALE","allOf":[{"$ref":"#/components/schemas/EquipmentDto"}]},"install":{"description":"Equipo que ENTRA","allOf":[{"$ref":"#/components/schemas/EquipmentDto"}]}},"required":["header","remove","install"]},"ServiceVisitHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"b4c5d6e7-f809-4123-8e78-92a3b4c5d6e7","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-09-30T15:00:00Z"},"customerSap":{"type":"string","example":"0004602025"},"customerKey":{"type":"string","example":"6CXNK"},"reference":{"type":"string","example":null,"description":"Tipo de visita; catalogo por definir (D-27a). Propuesta: INSTALLATION_FAILED, CORRECTIVE_MAINTENANCE, PREVENTIVE_MAINTENANCE, CANCELLATION_VISIT"},"visitStatus":{"type":"string","example":"SUCCESSFUL","enum":["SUCCESSFUL","FAILED"]},"currency":{"type":"string","example":"MXN","enum":["MXN"]},"orderCost":{"type":"object","example":null,"nullable":true,"description":"Acepta null (v1.7)"},"subscription":{"type":"string","example":"81120262815C","maxLength":18},"plant":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"WERKS; acepta null (v1.7)"},"warehouse":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"LGORT; acepta null (v1.7)"},"businessArea":{"type":"string","example":null,"nullable":true,"enum":["Residencial","Institucional","Horecas","Productos"],"description":"Acepta null (v1.7)"},"serviceOrder":{"type":"object","example":null,"nullable":true,"description":"ORDENBRING"},"idSupplier":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Proveedor de la visita (D-27c); acepta null (v1.7)"},"orderDescription":{"type":"object","example":null,"nullable":true,"maxLength":40,"description":"Acepta null (v1.7)"},"installationDate":{"type":"object","example":null,"nullable":true,"description":"Fecha de instalacion (D-06); acepta null (v1.7)"},"plannedDate":{"type":"object","example":null,"nullable":true,"description":"Fecha acordada (D-06); acepta null (v1.7)"},"actualDate":{"type":"object","example":null,"nullable":true,"description":"Fecha efectiva (D-06); acepta null (v1.7)"}},"required":["id","creationDateTime","customerSap","customerKey","reference","visitStatus","currency","subscription"]},"ServiceVisitDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/ServiceVisitHeaderDto"}},"required":["header"]},"AddressChangePickupHeaderDto":{"type":"object","properties":{"id":{"type":"string","example":"c5d6e7f8-0912-4234-9f89-a3b4c5d6e7f8","description":"UUID v4 — idempotencia (D-13)"},"creationDateTime":{"type":"string","example":"2026-09-30T15:00:00Z"},"reference":{"type":"string","example":"ADDRESS_CHANGE_PICKUP","enum":["ADDRESS_CHANGE_PICKUP"],"description":"Propuesto, por validar con SAP/KPMG"},"customerSap":{"type":"string","example":"0004602025"},"customerKey":{"type":"string","example":"6CXNK"},"postingDate":{"type":"object","example":null,"nullable":true,"description":"La del dia; acepta null (v1.7)"},"documentDate":{"type":"object","example":null,"nullable":true,"description":"Acepta null (v1.7)"},"noShipTo":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Folio del ShipTo del domicilio que se abandona; acepta null (v1.7)"},"orderCost":{"type":"object","example":null,"nullable":true,"description":"Acepta null (v1.7)"},"idSupplier":{"type":"object","example":null,"nullable":true,"maxLength":10,"description":"Proveedor que ejecuta la recoleccion (KPMG 11 nov); acepta null (v1.7)"},"businessArea":{"type":"string","example":null,"nullable":true,"enum":["Residencial","Institucional","Horecas","Productos"],"description":"Acepta null (v1.7)"}},"required":["id","creationDateTime","reference","customerSap","customerKey"]},"PickupEquipmentDto":{"type":"object","properties":{"material":{"type":"string","example":"01tPc000001w1kjIAA"},"serviceMaterial":{"type":"string","example":"540330"},"subscription":{"type":"string","example":"81120262815C","maxLength":18},"quantity":{"type":"number","example":1},"serialNumber18d":{"type":"string","example":"BB0000000000000382"},"materialAmount":{"type":"string","example":"369.00","description":"BRUTO (D-03)"},"plant":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"WERKS; acepta null (v1.7)"},"warehouse":{"type":"object","example":null,"nullable":true,"maxLength":4,"description":"LGORT; acepta null (v1.7)"}},"required":["material","serviceMaterial","subscription","quantity","serialNumber18d","materialAmount"]},"AddressChangePickupDto":{"type":"object","properties":{"header":{"$ref":"#/components/schemas/AddressChangePickupHeaderDto"},"remove":{"description":"Equipo que se recolecta (objeto, D-26d)","allOf":[{"$ref":"#/components/schemas/PickupEquipmentDto"}]}},"required":["header","remove"]},"CenterStockDto":{"type":"object","properties":{"centerId":{"type":"string","example":"CSNG","maxLength":4,"description":"Clave SAP del centro (WERKS), v1.8"},"storageLocation":{"type":"string","example":"DEV0","maxLength":4,"description":"Almacen SAP (LGORT)"}},"required":["centerId","storageLocation"]},"VendorDestinationDto":{"type":"object","properties":{"vendorId":{"type":"string","example":"ROTOPLAS","maxLength":10,"description":"Proveedor / maquilador destino (LIFNR)"},"shipTo":{"type":"string","example":"CTRMONT","maxLength":10,"description":"Destinatario de mercancia (KUNNR)"}},"required":["vendorId","shipTo"]},"TransferRequestSkuDto":{"type":"object","properties":{"sku":{"type":"string","example":"300467","maxLength":18,"description":"Material SAP (MATNR)"},"quantity":{"type":"number","example":504,"description":"Entero >= 1"},"uom":{"type":"string","example":"PZA","maxLength":3,"description":"Unidad de medida SAP"},"skuCollected":{"type":"string","example":"300911","maxLength":18,"description":"Material SAP del equipo recolectado (MATNR); obligatorio en toda posicion (Portal, 27 nov 2026)"},"serialNumbers":{"example":["BB0000000000000019","BB0000000000000035"],"description":"Series de la posicion; obligatorio en toda posicion (v1.2). Cada una: 18 caracteres, BB + 16 digitos (v1.8)","type":"array","items":{"type":"string"}}},"required":["sku","quantity","uom","skuCollected","serialNumbers"]},"TransferRequestOperationDto":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/CenterStockDto"},"destination":{"$ref":"#/components/schemas/VendorDestinationDto"},"skus":{"type":"array","items":{"$ref":"#/components/schemas/TransferRequestSkuDto"}},"eta":{"type":"object","example":null,"nullable":true,"description":"ISO-8601 con offset (P-12); null si no se conoce (P-08)"}},"required":["origin","destination","skus"]},"TransferOrderDto":{"type":"object","properties":{"id":{"type":"string","example":"7d2a9c1e-5f4b-4a8d-9e3c-6b1f8a2d5c90","description":"UUID v4 (P-01): si se reenvia, SAP no crea dos pedidos"},"creationDateTime":{"type":"string","example":"2026-09-28T16:40:05Z"},"status":{"type":"string","example":"CREATED","enum":["CREATED"],"description":"Siempre de negocio (P-10)"},"requestDate":{"type":"string","example":"2026-09-28","description":"A nivel sobre (P-19)"},"purchaseOrder":{"type":"string","example":null,"nullable":true,"description":"EBELN; siempre null en C3: el pedido aún no existe (P-19, v1.8)"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TransferRequestOperationDto"}}},"required":["id","creationDateTime","status","requestDate","purchaseOrder","data"]},"CollectedTransferSkuDto":{"type":"object","properties":{"sku":{"type":"string","example":"300467","maxLength":18,"description":"Material SAP (MATNR)"},"quantity":{"type":"number","example":504,"description":"Entero >= 1"},"uom":{"type":"string","example":"PZA","maxLength":3,"description":"Unidad de medida SAP"},"skuCollected":{"type":"string","example":"300911","maxLength":18,"description":"Material SAP del equipo recolectado (MATNR); obligatorio en toda posicion (Portal, 27 nov 2026)"}},"required":["sku","quantity","uom","skuCollected"]},"GoodsIssueOperationDto":{"type":"object","properties":{"origin":{"$ref":"#/components/schemas/CenterStockDto"},"destination":{"$ref":"#/components/schemas/VendorDestinationDto"},"skus":{"type":"array","items":{"$ref":"#/components/schemas/CollectedTransferSkuDto"}},"eta":{"type":"object","example":null,"nullable":true,"description":"ISO-8601 con offset (P-12); null si no se conoce (P-08)"}},"required":["origin","destination","skus"]},"GoodsIssueDto":{"type":"object","properties":{"id":{"type":"string","example":"2e6b4d8f-1c7a-4f2e-8b9d-3a5c7e1f6d42","description":"UUID v4 (P-01)"},"creationDateTime":{"type":"string","example":"2026-09-29T13:05:22Z"},"status":{"type":"string","example":"IN_TRANSIT","enum":["IN_TRANSIT"],"description":"Siempre de negocio (P-10)"},"requestDate":{"type":"string","example":"2026-09-28","description":"A nivel sobre (P-19)"},"purchaseOrder":{"type":"string","example":"1406962719","maxLength":10,"description":"EBELN: el pedido que creo C3; aqui va LLENO (P-19, v1.8)"},"data":{"type":"array","items":{"$ref":"#/components/schemas/GoodsIssueOperationDto"}}},"required":["id","creationDateTime","status","requestDate","purchaseOrder","data"]},"TechnicianDto":{"type":"object","properties":{"technicianId":{"type":"string","example":"TEC-045"},"name":{"type":"object","example":"Juan José Hernández","nullable":true,"description":"Nombre del tecnico; opcional: omitirlo o null, nunca \"\" (v1.7, CDM)"}},"required":["technicianId"]},"TransferSkuDto":{"type":"object","properties":{"sku":{"type":"string","example":"300467","maxLength":18,"description":"Material SAP (MATNR)"},"quantity":{"type":"number","example":504,"description":"Entero >= 1"},"uom":{"type":"string","example":"PZA","maxLength":3,"description":"Unidad de medida SAP"}},"required":["sku","quantity","uom"]},"TechnicianDispatchOperationDto":{"type":"object","properties":{"operationDate":{"type":"string","example":"2026-09-28","description":"Dia operativo del despacho"},"origin":{"$ref":"#/components/schemas/CenterStockDto"},"destination":{"$ref":"#/components/schemas/TechnicianDto"},"skus":{"type":"array","items":{"$ref":"#/components/schemas/TransferSkuDto"}}},"required":["operationDate","origin","destination","skus"]},"TechnicianDispatchDto":{"type":"object","properties":{"id":{"type":"string","example":"6a9d3f7b-4e1c-4b8a-9c2e-7f5d1a8b3e60","description":"UUID v4 (P-01)"},"creationDateTime":{"type":"string","example":"2026-09-28T13:58:30Z"},"status":{"type":"string","example":"WITH_TECHNICIAN","enum":["WITH_TECHNICIAN"],"description":"Catalogo del flujo tecnico (P-04/P-10)"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TechnicianDispatchOperationDto"}}},"required":["id","creationDateTime","status","data"]},"ReturnCenterDto":{"type":"object","properties":{"centerId":{"type":"string","example":"CSNG","maxLength":4,"description":"Clave SAP del centro (WERKS), v1.8"}},"required":["centerId"]},"TechnicianReturnSkuDto":{"type":"object","properties":{"sku":{"type":"string","example":"300467","maxLength":18,"description":"Material SAP (MATNR)"},"quantity":{"type":"number","example":504,"description":"Entero >= 1"},"uom":{"type":"string","example":"PZA","maxLength":3,"description":"Unidad de medida SAP"},"collected":{"type":"boolean","example":true,"description":"true = recolectado en casa del cliente (EcoBoost); false = insumo no instalado"},"storageLocation":{"type":"string","example":"DEV0","maxLength":4,"description":"Almacen SAP (LGORT) del renglon: DEV0 si collected, PT00 si no (v1.8)"},"skuCollected":{"type":"object","example":"300911","maxLength":18,"nullable":true,"description":"Material SAP del equipo recolectado; obligatorio si collected es true, el insumo no lo trae (Portal, 27 nov 2026)"},"serialNumber18d":{"type":"object","example":"BB0000000000000035","nullable":true,"description":"BB + 16 digitos; null si el insumo no tiene etiqueta (P-08)"}},"required":["sku","quantity","uom","collected","storageLocation"]},"TechnicianReturnOperationDto":{"type":"object","properties":{"operationDate":{"type":"string","example":"2026-09-28","description":"Dia operativo de la devolucion"},"origin":{"$ref":"#/components/schemas/TechnicianDto"},"destination":{"description":"Solo el centro (v1.8): el almacen va en cada renglon de skus[]","allOf":[{"$ref":"#/components/schemas/ReturnCenterDto"}]},"skus":{"type":"array","items":{"$ref":"#/components/schemas/TechnicianReturnSkuDto"}}},"required":["operationDate","origin","destination","skus"]},"TechnicianReturnDto":{"type":"object","properties":{"id":{"type":"string","example":"3b7e5c9a-8d2f-4a6b-b1e8-9c4f7a2d6e13","description":"UUID v4 (P-01)"},"creationDateTime":{"type":"string","example":"2026-09-28T23:41:12Z"},"status":{"type":"string","example":"RETURNED","enum":["RETURNED"],"description":"Catalogo del flujo tecnico (P-04/P-10)"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TechnicianReturnOperationDto"}}},"required":["id","creationDateTime","status","data"]},"AssetMovementHeaderDto":{"type":"object","properties":{"Serie":{"type":"string","example":"BB0000000000000035","description":"Numero de serie del activo"},"Material":{"type":"string","example":"300467","description":"Material (SKU) SAP"},"Movimiento":{"type":"string","example":"311","description":"Clase de movimiento SAP (311 traspaso, 312 ...)"},"Centro":{"type":"string","example":"MX01","description":"Centro (planta SAP)"},"Almacen":{"type":"string","example":"ALTE","description":"Almacen destino"},"Custodio":{"type":"string","example":"TEC-118","description":"Custodio destino (centro, tecnico o cliente)"},"Tipo_custodio":{"type":"string","example":"TECHNICIAN","description":"CENTER | TECHNICIAN | CUSTOMER"},"Referencia":{"type":"string","example":"ORD-DEMO-001","description":"Referencia (orden)"},"Fec_conta":{"type":"string","example":"2026-09-28T23:41:12Z","description":"Fecha contable / del evento"},"Evento":{"type":"string","example":"EVT-ASSET-0001","description":"eventId del CSB — llave de idempotencia"}},"required":["Serie","Material","Movimiento","Centro","Evento"]},"AssetMovementRequestDto":{"type":"object","properties":{"cabecera":{"$ref":"#/components/schemas/AssetMovementHeaderDto"}},"required":["cabecera"]},"AssetMovementResponseDto":{"type":"object","properties":{"documento":{"type":"string","example":"4912345678"},"status":{"type":"string","example":"OK","description":"OK | REVERSED | ERROR"},"mensaje":{"type":"string","example":""}},"required":["documento","status","mensaje"]},"AssetMovementReverseHeaderDto":{"type":"object","properties":{"Documento":{"type":"string","example":"4912345678","description":"Documento de material a anular"},"Motivo":{"type":"string","example":"CSB_CSB01_ROLLBACK","description":"Motivo de la anulacion"},"Evento":{"type":"string","example":"EVT-ASSET-0001","description":"eventId del CSB"}},"required":["Documento"]},"AssetMovementReverseRequestDto":{"type":"object","properties":{"cabecera":{"$ref":"#/components/schemas/AssetMovementReverseHeaderDto"}},"required":["cabecera"]}}}}