getParsedBody(); $output = [ 'input' => $body, 'credito' => null, 'status' => false ]; try { $venta = $ventaService->getById($venta_id); $output['credito'] = $creditoService->edit($venta->formaPago()->credito, $body); $output['status'] = true; } catch (EmptyResult) {} return $this->withJson($response, $output); } }