---
title: Create
slug: quickbooks/Uh5C-create
description: Learn how to create a Vendor in QuickBooks API with this comprehensive example. Explore how to set all available fields, retrieve the newly generated QuickBooks Vendor Id and Salesforce Vendor Id, and store the Vendor data using a Map. Discover the step-b
docTags: 
createdAt: 2021-10-30T07:55:03.000Z
---

The following is an example of create Vendor where we are setting every possible field (See [Vendor](docId\:z5FQtVGTHWYGqeejRq2mi) for the available fields). The response will return the exact request data plus the new QuickBooks Vendor Id (Id) and the newly created Salesforce Vendor Id (salesforceRecordId)

:::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 Vendor
Map<String, Object> vendorMap = new Map<String, Object>(); 
    vendorMap.put('CompanyName','Lap Care Match');
    vendorMap.put('DisplayName','Lap Care Match');
    vendorMap.put('PrimaryPhone' , new Map<String, Object>{'FreeFormNumber' => '9988543562'});
    vendorMap.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' , '');
        
    vendorMap.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' , '');
        
    vendorMap.put('ShipAddr' , shippingAddrFieldMap);

//  Initializing the RequestJSON Data to be passed.
Map<String, Object> requestJSONMap = new Map<String, Object>();
    requestJSONMap.put('vendors', new List<Object>{vendorMap});
    String reqJSON = JSON.serialize(requestJSONMap);

Map<String, Object> reqObj = new Map<String, Object>();
    reqObj.put('version', '1.0');
    reqObj.put('action', 'createVendor');
    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=createVendor,
    responseJSON={
      "vendors": [
        {
          "SyncToken": "0",
          "sparse": false,
          "SFRecordID": "a085j000002D1uTAAS",
          "PrintOnCheckName": "Lap Care Match",
          "PrimaryPhone": {
            "FreeFormNumber": "9988543562"
          },
          "Metadata": {
            "LastUpdatedTime": "2021-11-01T00:31:59-07:00",
            "CreateTime": "2021-11-01T00:31:59-07:00"
          },
          "Id": "67",
          "DisplayName": "Lap Care Match",
          "CurrencyRef": {
            "value": "USD",
            "name": "United States Dollar"
          },
          "CompanyName": "Lap Care Match",
          "BillAddr": {
            "PostalCode": "508238",
            "Line3": "Kodad",
            "Line2": "First Lane",
            "Line1": "1-24",
            "Id": "131",
            "Country": "India",
            "City": "Suryapet"
          },
          "Balance": "0",
          "Active": "true"
        }
      ],
      "statusCode": 200
    },
    timestamp=1635751920428,
    validRequest=true,
    version=1.0
  }
```
:::



