(PHP-SDK) Creating a new record (Quote)

(PHP-SDK) Creating a new record (Quote)

Hi,

I am using PHP-SDK V2 API, and I am set up with the tokens and ready to work with the CRM.
In Sandbox mode, I am trying to add a new Quote.

My code:
        $moduleIns = ZCRMRestClient::getInstance()->getModuleInstance("Quotes");
        $records = array();
        
        $record = ZCRMRecord::getInstance("Quotes", null);
        $record->setFieldValue("Account Name", "A1");
.........
        
  1.         $data = array([
  2.             "product" => array(
  3.                 "Product_Code" => 1,
  4.                 "Currency" => "GBP",
  5.                 "name" => "P1",
  6.             ),
  7.             "quantity" => 1,
  8. .........
  9.             ]);
  10.         
  11.         $record->setFieldValue("Product_Details", $data);
  12.         array_push($records, $record);    
  13.        
  14.         $responseIn = $moduleIns->upsertRecords($records);
        

The error is:
  1. >HTTP Status Code:202 >Status:error >Message:invalid data >Code:INVALID_DATA >Details:{"expected_data_type":"long","api_name":"product","index":0,"parent_api_name":"Product_Details"}

I can't understand why it is expecting a LONG for the api_name "product". "product" is a JSON array