website logo
Product Overview
NetSuite
Payments
QuickBooks
Xero
Navigate through spaces
⌘K
Guided Wizard
Guided Wizard Settings
Bill Configuration
Custom Guided Wizard
Button URL Structure
Button URL Generator
Support
Global API
API Overview
Request
Response
Code Examples
Technical Resources
Breadwinner Setup
Requirements
ERD / Object Structure
Getting Help
Version History
Docs powered by
Archbee
Global API
...
Request
Customer

Create

1min

The following is an example of create Customer where we are setting every possible field (See Customer 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
Response
|
//  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', '!aa00TM');

//  Placing a request to Breadwinner Global API
Map<String, Object> respMap = breadwinner_qbo.BreadwinnerQBAPI.call(reqObj);
System.debug(respMap);




Updated 12 Sep 2023
Did this page help you?
PREVIOUS
Read
NEXT
Update
Docs powered by
Archbee
Docs powered by
Archbee