Jorge Olguin (super carnicerias hernandez sa de cv) asked a question.

Empty Body on rest POST

I have this definition

imageand send this in postman's body with text type, and headers Content-type and Accept both as "application/json", to the address: xxxxx.mx:9030/rest/s1/v06Ticket/11

  1. {"prodsTicket": {
  2. "ttTicket": [
  3. {
  4. "Ticket": 35863,
  5. "FormaDePago": "M",
  6. "Sucursal": 50,
  7. "Almacen": 50,
  8. "Cliente": "VM",
  9. "Vendedor": 1350,
  10. "Monto": 113.00,
  11. "Fecha": "2026-07-14",
  12. "Caja": 51,
  13. "StatusDoc": "P",
  14. "Serie": "A",
  15. "Impuesto1": 0.00,
  16. "Impuesto2": 0.00,
  17. "Hora": "15:59:24",
  18. "Factura": 0,
  19. "Saldo": 0.00,
  20. "EnviadoFecha": null,
  21. "EnviadoHora": "",
  22. "EnviadoRepartidor": 0,
  23. "StatusDevolucion": false,
  24. "EnviarNombre": "",
  25. "EnviarDireccion": "",
  26. "NumImpresion": 1,
  27. "Efectivo": 200.00,
  28. "ConDevCan": 0,
  29. "ContraRecibo": 0,
  30. "Descuento": 0.00,
  31. "FechaFactura": null,
  32. "VentaTicket": 35873,
  33. "EnviarRuta": 0,
  34. "Precio": 0,
  35. "Corte": 0,
  36. "Observaciones": "",
  37. "SaldoXFacturar": 0.00,
  38. "FacturadoAMostrador": true,
  39. "HoraI": 57564,
  40. "PV": 1,
  41. "GuiaEmbarque": "",
  42. "Transporte": "",
  43. "FechaEmbarque": null,
  44. "Articulos": 1.36,
  45. "Promocion": 0,
  46. "ClienteEsNuevo": false,
  47. "Procesos": 0.00
  48. }
  49. ],
  50. "ttTicketD": [
  51. {
  52. "Sucursal": 50,
  53. "Almacen": 50,
  54. "Serie": "A",
  55. "Ticket": 35863,
  56. "Fecha": "2026-07-14",
  57. "NumPartida": 1,
  58. "Articulo": "MILANESA CERDO",
  59. "Linea": "Cer",
  60. "Sublinea": "Cer",
  61. "Empaque": "KG",
  62. "Cantidad": 0.710,
  63. "Precio": 86.00,
  64. "Impuesto1": 0.00,
  65. "Impuesto2": 0.00,
  66. "StatusTicketD": "P",
  67. "StatusDevolucion": false,
  68. "Costo": 72.00000000,
  69. "Observaciones": "",
  70. "Comision": 0.00,
  71. "NumSeries": "",
  72. "SubTotal": 61.00,
  73. "Cliente": "VM",
  74. "PesoBruto": 0.70,
  75. "Etiqueta": "MILANHERSA",
  76. "Control#": 0.00000,
  77. "PV": 1
  78. },
  79. {
  80. "Sucursal": 50,
  81. "Almacen": 50,
  82. "Serie": "A",
  83. "Ticket": 35863,
  84. "Fecha": "2026-07-14",
  85. "NumPartida": 2,
  86. "Articulo": "ESPECIALTRIPA",
  87. "Linea": "PRO",
  88. "Sublinea": "PRO",
  89. "Empaque": "KG",
  90. "Cantidad": 0.650,
  91. "Precio": 80.00,
  92. "Impuesto1": 0.00,
  93. "Impuesto2": 0.00,
  94. "StatusTicketD": "P",
  95. "StatusDevolucion": false,
  96. "Costo": 70.00000000,
  97. "Observaciones": "",
  98. "Comision": 0.00,
  99. "NumSeries": "",
  100. "SubTotal": 52.00,
  101. "Cliente": "VM",
  102. "PesoBruto": 0.65,
  103. "Etiqueta": "CHORIZO ESPECIAL TRIPA",
  104. "Control#": 0.00000,
  105. "PV": 1
  106. }
  107. ],
  108. "ttTicketPago": [
  109. {
  110. "Fecha": "2026-07-14",
  111. "Ticket": 35863,
  112. "Monto": 113.00,
  113. "FormaDePago": "M",
  114. "Cliente": "VM",
  115. "Documento": "EFE",
  116. "Caja": 51,
  117. "Nomina": 1350,
  118. "Sucursal": 50,
  119. "Serie": "A",
  120. "Factura": 0,
  121. "TipoPago": "EFE",
  122. "Corte": 0,
  123. "Hora": 57595
  124. }
  125. ]
  126. }}

on response, I got:

 

{

    "_errors": [

        {

            "_errorMsg": "ERROR condition: Missing one or more required arguments to READ-JSON (15340) (7211)",

            "_errorNum": 15340

        }

    ]

}

 

And inside the method, I do:

  1. METHOD PUBLIC VOID RegistraTicket(
  2. INPUT xFlag AS INTEGER,
  3. INPUT xpayload AS LONGCHAR,
  4. OUTPUT TABLE ttResponse // RESPUESTA
  5. ):
  6.  
  7. OUTPUT STREAM salida TO value("C:\t\tickets.txt").
  8. PUT STREAM salida UNFORMATTED "----------Inicio del payload del ticket: " NOW SKIP.
  9. EXPORT STREAM salida xPayLoad.
  10. PUT STREAM salida UNFORMATTED "----------Fin del payload del ticket (bytes:" LENGTH(xPayLoad) ")" SKIP.
  11.  
  12. PUT STREAM salida SKIP(2) "Param: Flag:" xFlag SKIP.
  13.  
  14. EMPTY TEMP-TABLE ttResponse.
  15.  
  16.  
  17. DATASET prodsTicket:READ-JSON("LONGCHAR", xPayload, "EMPTY").
  18.  
  19. more handling....

on the file created, I got:

 

----------Inicio del payload del ticket: 14/07/2026 16:52:19.342-06:00

 

----------Fin del payload del ticket (bytes:?)

 

 

Param: Flag:    11

Fin Ticket

 

 

the 11 value on flag parameter assures that endpoint is reached, and path parameter is delivered... the problem is the Body definition, I assume...

 

Any clue?

 

 

Thanks


  • Jorge Olguin (super carnicerias hernandez sa de cv)

    I had to move the body link on the left side, from var xpayload, to BODY row

    Selected as Best
  • Jorge Olguin (super carnicerias hernandez sa de cv)

    I had to move the body link on the left side, from var xpayload, to BODY row

    Selected as Best