Global API
...
Request
Customer

Create

1min
the following is an example of creating a customer where we are setting every possible field (see customer docid\ beuvwrpdrh8smtnbynenj for the available fields) the response will return the exact request data plus the new quickbooks customer id (id) and the newly created salesforce customer id (salesforceid) note you can only create one record at a time request // create a map to store all the data of a customer map\<string, object> customermap = new map\<string, object>(); customermap put('companyname','breadwinner inc'); customermap put('displayname','breadwinner inc'); customermap put('primaryphone' , new map\<string, object>{'freeformnumber' => '9988543562'}); customermap put('active',true); map\<string, object> billingaddrfieldmap = new map\<string, object>(); billingaddrfieldmap put('city' , 'suryapet'); billingaddrfieldmap put('country' , 'india'); billingaddrfieldmap put('line3' , 'kodad'); billingaddrfieldmap put('line2' , 'first lane'); billingaddrfieldmap put('line1' , '1 24'); billingaddrfieldmap put('postalcode' , '508238'); billingaddrfieldmap put('countrysubdivisioncode' , ''); customermap put('billaddr' , billingaddrfieldmap); map\<string, object> shippingaddrfieldmap = new map\<string, object>(); shippingaddrfieldmap put('city' , 'hyderabad'); shippingaddrfieldmap put('country' , 'india'); shippingaddrfieldmap put('line3' , ''); shippingaddrfieldmap put('line2' , 'srinagar colony'); shippingaddrfieldmap put('line1' , '1/78 24'); shippingaddrfieldmap put('postalcode' , '500008'); shippingaddrfieldmap put('countrysubdivisioncode' , ''); customermap put('shipaddr' , shippingaddrfieldmap); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customers', new list\<object>{customermap}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'createcustomer'); reqobj put('requestjson', reqjson); //required, if quickbooks multi org is enabled in breadwinner reqobj put('qborgid', '4620816365285051610'); // placing a request to breadwinner global api map\<string, object> respmap = breadwinner qbo breadwinnerqbapi call(reqobj); system debug(respmap); response { action=createcustomer, responsejson={ "statuscode" 200, "errors" \[], "customers" \[ { "taxable" true, "synctoken" "0", "sparse" false, "shipaddr" { "postalcode" "500008", "line2" "srinagar colony", "line1" "1/78 24", "id" "125", "country" "india", "city" "hyderabad" }, "printoncheckname" "breadwinner company", "primaryphone" { "freeformnumber" "9988543562" }, "preferreddeliverymethod" "print", "metadata" { "lastupdatedtime" "2021 10 29t21 14 53 07 00", "createtime" "2021 10 29t21 14 53 07 00" }, "job" false, "id" "63", "fullyqualifiedname" "breadwinner company", "displayname" "breadwinner company", "defaulttaxcoderef" { "value" "2" }, "currencyref" { "value" "usd", "name" "united states dollar" }, "companyname" "breadwinner company", "billwithparent" false, "billaddr" { "postalcode" "508238", "line3" "kodad", "line2" "first lane", "line1" "1 24", "id" "124", "country" "india", "city" "suryapet" }, "balancewithjobs" "0", "balance" "0", "active" "true" } ] }, timestamp=1635567294151, validrequest=true, version=1 0 }