Saltar a contenido

GenerateAWBDataPrint

Crea una guía aérea (AWB) y, en la misma llamada, devuelve su etiqueta en PDF.

URL

POST https://ocelot.servientrega.us/api/KiwiService20/kwapi/GenerateAWBDataPrint
POST https://ocelotkiwi.azurewebsites.net/api/KiwiService20/kwapi/GenerateAWBDataPrint

Parámetros

Los mismos parámetros de GenerateAWBData, más:

Nombre Tipo Obligatorio Reglas
language texto Sí Siempre EN
reportId número Sí 18 etiqueta de 6" × 4" · 3 tamaño carta
printCopies número Sí 2 para tamaño carta (reportId 3); 1 para la etiqueta

Ejemplo de petición

curl -X POST "https://ocelot.servientrega.us/api/KiwiService20/kwapi/GenerateAWBDataPrint" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d @awb-print.json
curl -X POST "https://ocelotkiwi.azurewebsites.net/api/KiwiService20/kwapi/GenerateAWBDataPrint" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d @awb-print.json

awb-print.json:

{
  "userId": "<YOUR_USERNAME>",
  "password": "<YOUR_PASSWORD>",
  "reference": "ORDER-10002",
  "sender": "JOHN SAMPLE",
  "senderAddress": "100 SAMPLE ST",
  "senderPhone": "3055550100",
  "senderCity": "MIAMI",
  "senderState": "FL",
  "senderCountry": "US",
  "senderZip": "33172",
  "senderMail": "sender@example.com",
  "recipient": "MARIA EJEMPLO",
  "recipientAddress": "CALLE 100 # 10-20 APTO 301",
  "recipientPhone": "3005550100",
  "recipientCity": "BARRANQUILLA",
  "recipientState": "ATLANTICO",
  "recipientId": "",
  "recipientMail": "recipient@example.com",
  "destinationCountry": "CO",
  "units": 1,
  "weight": 3.000,
  "unitWeight": "LB",
  "declaredValue": 250.00,
  "contentShipping": "SATIN SKIRT",
  "long": 15.00,
  "wide": 10.00,
  "high": 15.00,
  "shippingType": "SPX",
  "tariffPosition": "98.07.20.00.00",
  "AWBNumber": 0,
  "language": "EN",
  "reportId": 18,
  "printCopies": 1
}

Ejemplo de respuesta

{
  "result": true,
  "entities": [
    {
      "shippingId": 19000017,
      "freightValue": 10.90,
      "overFreightValue": 12.50,
      "taxValue": 77.79,
      "valueOthers": 0.00,
      "totalValue": 107.19,
      "volumeInvoice": 13.55,
      "reportData": "JVBERi0xLjYKJdP0zOEKNSAwIG9iago8PAovVHlwZS9QYWdlCi9...",
      "imageCityData": ""
    }
  ],
  "messages": [
    "Record created successfully",
    "Time execution:3606 ms."
  ],
  "notificationType": 3
}

Los campos son los mismos de GenerateAWBData, más:

Campo Significado
reportData La etiqueta en PDF, codificada en base64
imageCityData Imagen de la ciudad de destino, codificada en base64. Solo para envíos a Ecuador; vacío para los demás países

Notas

  • Decodifique reportData desde base64 y guárdelo como archivo .pdf para imprimirlo.
  • Si la guía se creó pero el PDF no se pudo generar, puede imprimirla después con PrintAWB o PrintAWBLabel usando el shippingId. No vuelva a llamar a este método: crearía otra guía.