First, I am pulling a deal and it’s associations.
$properties = ['dealname', 'dealstage', 'term_end', 'closedate', 'hubspot_owner_id', 'pipeline', 'amount', 'type_of_product', 'inquiry_source', 'wo_number', 'dealtype'];
$associations = ['task', 'quote', 'company', 'contact', 'ticket', 'products', 'line_item'];
$deal_id = '12345';
try {
$apiResponse = $client->crm()->deals()->basicApi()->getById($deal_id, $properties, false, $associations);
} catch (ApiException $e) {
echo "Exception when calling basic_api->get_by_id: ", $e->getMessage();
}
Once I retrieve the deal, I am then reading an individual line item.
$line_properties = [
'name',
'hs_sku',
'hs_recurring_billing_start_date',
'hs_recurring_billing_period',
'recurringbillingfrequency',
'quantity',
'price',
'discount',
'net_price',
'hs_mrr',
'hs_arr',
'hs_product_id'
];
try {
$apiResponse = $client->crm()->lineItems()->basicApi()->getById('567890', $line_properties, false);
} catch (ApiException $e) {
echo "Exception when calling basic_api->get_by_id: ", $e->getMessage();
}
This issue is that some properties that are filled out on the Hubspot line item are coming back as null.
1. Billing Start Date is set to “At Payment”. In the API Response it is returning hs_recurring_billing_start_date => NULL
2. Term (Months) is set to 0. In the API Response it is returning hs_recurring_billing_period => NULL
3. Billing Frequency is set to “One-time”. In the API Response it is returning recurringbillingfrequency => NULL
Why is it returning NULL only for these properties and how do I fix this?
Thanks