---
title: Create
slug: quickbooks/mU4W-create
description: Learn how to create customer records using the Breadwinner Global API. This tutorial covers setting different fields like company name, display name, phone numbers, billing, and shipping addresses. It provides a thorough explanation of making JSON request
docTags: 
createdAt: 2021-10-29T05:37:19.000Z
---

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).

:::hint{type="info"}
Note:  You can only create one record at a time.
:::

:::CodeblockTabs
Request

```apex
//  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

```json
{
  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
}
```
:::



