getParam always save NULL in DB when i send json trough postman

$app->post(’/api/orden/nueva’, function($request, $response, $args){
$customer_id = $request->getParam(‘customeridpost’);
$date_created = $request->getParam(‘date_created’);
$date_created_gmt = $request->getParam(‘date_created_gmt’);
$net_total = $request->getParam(‘net_total’);
$num_items_sold = $request->getParam(‘num_items_sold’);
$order_id = $request->getParam(‘orderid’);
$parent_id = $request->getParam(‘parent_id’);
$returning_customer = $request->getParam(‘returning_customer’);
$shipping_total = $request->getParam(‘shipping_total’);
$status = $request->getParam(‘status’);
$tax_total = $request->getParam(‘tax_total’);
$total_sales = $request->getParam(‘total_sales’);

$sql = “INSERT INTO wp_wc_order_stats (order_id, parent_id, date_created, date_created_gmt, num_items_sold, total_sales, tax_total, shipping_total, net_total, returning_customer, status, customer_id) VALUES (:order_id, :parent_id, :date_created, :date_created_gmt, :num_items_sold, :total_sales, :tax_total, :shipping_total, :net_total, :returning_customer, :status, :customer_id)”;
try{
$db = new db();
$db = $db->conectDB();
$resultado = $db->prepare($sql);

$resultado->bindParam(':customer_id', $customer_id);
$resultado->bindParam(':date_created', $date_created);
$resultado->bindParam(':date_created_gmt', $date_created_gmt);
$resultado->bindParam(':net_total', $net_total);
$resultado->bindParam(':num_items_sold', $num_items_sold);
$resultado->bindParam(':order_id', $order_id);
$resultado->bindParam(':parent_id', $parent_id);
$resultado->bindParam(':returning_customer', $returning_customer);
$resultado->bindParam(':shipping_total', $shipping_total);
$resultado->bindParam(':status', $status);
$resultado->bindParam(':tax_total', $tax_total);
$resultado->bindParam(':total_sales', $total_sales);

$resultado->execute();
echo json_encode("Nuevo cliente guardado.");  

$resultado = null;
$db = null;

}catch(PDOException $e){
echo ‘{“error” : {“text”:’.$e->getMessage().’}’;
}
});

Hi @oscarperezlugo

When you send JSON, you should use getParsedBody():

$data = (array)$request->getParsedBody();
$customer_id = $data['customeridpost'];
// ...