# SimplePublicObjectInput Not Found

**URL:** <https://community.hubspot.com/t/simplepublicobjectinput-not-found/47972>\
**Category:** APIs & Integrations\
**Tags:** php\
**Created:** [December 3, 2021, 4:11pm UTC](https://community.hubspot.com/t/simplepublicobjectinput-not-found/47972 "2021-12-03T16:11:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MPenn6](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@MPenn6](https://community.hubspot.com/u/MPenn6)\
**Post date:** [December 3, 2021, 4:11pm UTC](https://community.hubspot.com/t/simplepublicobjectinput-not-found/47972/1 "2021-12-03T16:11:49Z")

</div>

Using the PHP hubspot/api-client composer package.

`composer require hubspot/api-client`

Most API calls have been working great, but I’m running into some issues with Line Items. I’m basing my code off of the samples from here: [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/line-items)

But I’m finding that **SimplePublicObjectInput** is not a defined object. I’m not seeing anybody else with this issue, so I’m guessing I am overlooking something obvious! Here’s my code snippet:

```lia-code-sample
use HubSpot\Factory;
use HubSpot\Client\Crm\LineItems\ApiException;

class lineitem
{
private function hs_createNewTaxLineItem()
 {
 $client = Factory::createWithApiKey(HUBSPOT_API_KEY);

 $properties = [
 "hs_product_id" => HS_SALES_TAX_PRODUCT_ID,
 "quantity" => "1",
 "price" => 99.98
 ];
 $SimplePublicObjectInput = new SimplePublicObjectInput(['properties' => $properties]);
 try {
 $apiResponse = $client->crm()->lineItems()->basicApi()->create($SimplePublicObjectInput);
 var_dump($apiResponse);
 } catch (ApiException $e) {
 echo "Exception when calling basic_api->create: ", $e->getMessage();
 }
}

```

It returns the error:

**Fatal error: Uncaught Error: Class ‘SimplePublicObjectInput’ not found in…**

Any ideas?

---

<div class="post-metadata">

**Author:** ![MPenn6](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@MPenn6](https://community.hubspot.com/u/MPenn6)\
**Post date:** [December 3, 2021, 4:29pm UTC](https://community.hubspot.com/t/simplepublicobjectinput-not-found/47972/2 "2021-12-03T16:29:34Z")

</div>

Playing around with this a little more…

This does NOT work for creating the object:

`$SimplePublicObjectInput = new SimplePublicObjectInput(['properties' => $properties]);`

But I CAN create the object like this:

`$SimplePublicObjectInput = new \HubSpot\Client\Crm\LineItems\Model\SimplePublicObjectInput(['properties' => $properties]);`

Is this normal way to code this?

The only other way I can access this object is if I literally specify it in the use statement

`use HubSpot\Client\Crm\LineItems\Model\SimplePublicObjectInput;`

---

<div class="post-metadata">

**Author:** ![ph\_alti\_trading](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ph_alti_trading/32/191450_2.png) [@ph\_alti\_trading](https://community.hubspot.com/u/ph_alti_trading)\
**Post date:** [July 14, 2022, 2:28pm UTC](https://community.hubspot.com/t/simplepublicobjectinput-not-found/47972/3 "2022-07-14T14:28:34Z")

</div>

Yeah @MPenn6 I’m not speaking on behalf of HubSpot, using directly the appropriate namespace is the standard way to do it with the V3. Example for the contact :

`$SimplePublicObjectInput = new \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput(['properties' => $properties]);`

I don’t recommend to call it from the _use_ statement as multiple models would probably create a conflict anyway. 😜 Anyone with more advanced skills is welcome to correct me 😊

And yeah that means all the PHP snippets provided from the documentation do not work if you just copy-paste them :

Ex: [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/contacts) (Endpoints tab)

Don’t forget you need to tune at least the object input to make it work 😫

Cheers
