Partner API Only
The createCompany() method creates a new VerticalResponse account to which Users can be added. In order for an account to be both active and valid, one and only one user must be assigned to the created company. The best way to accomplish this is by immediately following the createCompany() call with a createUser() call, providing the company_id you received from the first method call to the User object in the second.
Input
session_id [xsd:string] (required)
Your API session id.
company [vrtypens:Company] (required)
The Company object containing the details for this company.
use_partner_credit_ledger [xsd:boolean]
Whether to associate the new company with the credit ledger used by the partner that’s making this call.
Output
[xsd:int]
The output is the id of the new company
Examples
PHP
$vrapi->createCompany( array( 'session_id' => $sid, 'company' => array( 'name' => 'Basil's Bourbon Company', 'address_1' => '50 Beale Street, Floor 10', 'city' => 'San Francisco', 'country' => 'United States', 'postalcode' => '94105', 'support_email' => 'email@example.com', ), ) );
Ruby
vr.createCompany({ 'session_id' => sid, 'company' => { 'name' => 'Basil's Bourbon Company', 'address_1' => '50 Beale Street, Floor 10', 'city' => 'San Francisco', 'country' => 'United States', 'postalcode' => '94105', 'support_email' => 'email@example.com', }, })
Java
Company company = new Company(); company.setName("Basil's Bourbon Company"); company.setAddress_1("50 Beale Street, Floor 10"); company.setCity("San Francisco"); company.setCountry("United States"); company.setPostalcode("94105"); company.setSupport_email("email@example.com"); CreateCompanyArgs createCompanyArgs = new CreateCompanyArgs(); createCompanyArgs.setSession_id(sessionID); createCompanyArgs.setCompany(company); int companyId = 0; companyId = vr.createCompany( createCompanyArgs );
C#/.NET
Company objCompany = new Company(); objCompany.name = "Basil's Bourbon Company"; objCompany.address_1 = "50 Beale Street, Floor 10"; objCompany.city = "San Francisco"; objCompany.country = "United States"; objCompany.postalcode = "94105"; objCompany.support_email = "email@example.com"; createCompanyArgs objcCA = new createCompanyArgs(); objcCA.session_id = sessionId; objcCA.company = objCompany; int intCompanyId = 0; try { intCompanyId = objVR.createCompany(objcCA); } catch (Exception e) { System.Console.WriteLine(e.Message); }
Perl
$vrapi->createCompany( { session_id => $sid, company => { 'name' => 'Basil's Bourbon Company', 'address_1' => '50 Beale Street, Floor 10', 'city' => 'San Francisco', 'country' => 'United States', 'postalcode' => '94105', 'support_email' => 'email@example.com', }, } );