Skip to content

Como integrar Cargoffer con SAP Business One

Lo que vas a conseguir

Crear facturas de venta en SAP Business One automaticamente cuando se firma un contrato en Cargoffer.

El flujo

Contrato firmado → Evento webhook → Llamada API SAP → Factura creada

Paso 1: Configurar webhook

bash
curl -X POST "https://api.pro.cargoffer.com/api/webhook" \
  -H "Authorization: Bearer *** \
  -H "Content-Type: application/json" \
  -d '{"url": "https://tu-sap-server:50000/webhook", "events": ["contract.signed"]}'

Paso 2: Mapear datos a SAP

CargofferSAP B1Ejemplo
contract.amountINV1.Price1250.00
client.cifOCRD.CardCodeB12345678
contract.dateOINV.DocDate2026-06-17

Paso 3: Llamar a SAP via Service Layer

bash
curl -X POST "https://tu-sap-server:50000/b1s/v1/Invoices" \
  -H "Content-Type: application/json" \
  -d '{
    "CardCode": "B12345678",
    "DocDate": "2026-06-17",
    "DocumentLines": [{
      "ItemCode": "TRANSPORTE",
      "Quantity": 1,
      "UnitPrice": 1250.00
    }]
  }'

Documentación de Cargoffer