(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");
.........
- $data = array([
- "product" => array(
- "Product_Code" => 1,
- "Currency" => "GBP",
- "name" => "P1",
- ),
- "quantity" => 1,
- .........
- ]);
-
- $record->setFieldValue("Product_Details", $data);
- array_push($records, $record);
-
- $responseIn = $moduleIns->upsertRecords($records);
The error is:
- >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