Is there a way to create a new company record via the REST API or otherwise?

Hi all,
I’d like to be able to create a new company record via the REST API. Is this possible? I see there’s an existing Zapier integration that allows this, so Zapier must be doing it somehow…

Relevant links:
Zapier: https://zapier.com/zapbook/infusionsoft/
Company Record: http://help.infusionsoft.com/userguides/contact-management/create-and-manage-companies/create-a-company-record

Thanks in advance,
Ethan

Yup it’s possible. A company record is in fact a contact record with one exception. The AccountId field is set to the same as the Id field…that’s it. So to use REST to create a company record, create it as a contact record, read the id and then update the ‘contact’ record field ‘AccountId’ with the Id number…poof, a company. Note, just because zapier is doing something doesn’t mean they aren’t using the regular api to accomplish some things. If the REST didn’t allow for this that would have still been an option.

1 Like

Awesome. Thank you so much!

1 Like

Regarding to your solution post and other post, I got a bit understanding from your suggestions to create company.

The workflow is going to require 3 steps to create a contact with company(For REST API)

  1. Create a company by “Create Contact” function and pre-fill accoutid.
  2. Retrieve/save the account ID from insertion on step 1.
  3. Add new contact for client and save that accountid to “company”=>“id”

Couple of questions(REST API documentation doesn’t show it ):

  1. What if accountid is already existing on another company ? Will the data be overwritten ? Or API request will error ?
  2. Will you create Company module in REST API shortly? If yes, will that work around from your suggestion be still be available ?

I have tried this PHP coe and it got error “Input could not be converted to a valid request”

$newCompany = [
	 'company' => [
		'company_name' =>  "Test"
	]					
	, 'AccountId' => 100];
$insertCompany = $this->infusionsoft->contacts()->create($newCompany);

@Ethan_Kusters , one quick question for you, have you used similar php data structure to create new company ?

I most often use the SDK (RPC) Data object to modify the table entry.

https://developer.infusionsoft.com/docs/xml-rpc/#data-create-a-record

Thank you mate.

From reading other posts, I thought REST API has it way to work around.
I was thinking if API developers have this REST API feature in progress, I could build all InfusionSoft requests in same standard in my system.

The REST api is in development still and some of the fields do not seem to provide access yet. The AccountId field, as reported by the person above, does not appear to be one that is available yet through REST and that is the field that would be necessary to make equal to the Id field to make it a company record.

@Ethan_Kusters We’re happy to announce:

1 Like