# Update Customer — QuickBooks Sandbox

> Updates a customer. See the documentation

- Key: `quickbooks_sandbox-update-customer`
- Type: Action (Write)
- Version: 0.0.4
- App: QuickBooks Sandbox (`quickbooks_sandbox`) — https://pipedream.com/apps/quickbooks-sandbox.md
- This page (HTML): https://pipedream.com/apps/quickbooks-sandbox/actions/update-customer
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/quickbooks_sandbox/actions/update-customer/update-customer.mjs

## Description

Updates a customer. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/customer#full-update-a-customer)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `customerId` | `string` | Yes | Reference to a customer or job Options are loaded from the connected account. |
| `displayName` | `string` | No | The name of the person or organization as displayed. Must be unique across all Customer, Vendor, and Employee objects. Cannot be removed with sparse update. If not supplied, the system generates DisplayName by concatenating customer name components supplied in the request from the following list: Title, GivenName, MiddleName, FamilyName, and Suffix. |
| `title` | `string` | No | Title of the person. This tag supports i18n, all locales. The DisplayName attribute or at least one of Title, GivenName, MiddleName, FamilyName, Suffix, or FullyQualifiedName attributes are required during create. |
| `givenName` | `string` | No | Given name or first name of a person. The DisplayName attribute or at least one of Title, GivenName, MiddleName, FamilyName, or Suffix attributes is required for object create. |
| `middleName` | `string` | No | Middle name of the person. The person can have zero or more middle names. The DisplayName attribute or at least one of Title, GivenName, MiddleName, FamilyName, or Suffix attributes is required for object create. |
| `familyName` | `string` | No | Family name or the last name of the person. The DisplayName attribute or at least one of Title, GivenName, MiddleName, FamilyName, or Suffix attributes is required for object create. |
| `suffix` | `string` | No | Suffix of the name. For example, Jr. The DisplayName attribute or at least one of Title, GivenName, MiddleName, FamilyName, or Suffix attributes is required for object create. |
| `currencyRefValue` | `string` | No | A three letter string representing the ISO 4217 code for the currency. For example, USD, AUD, EUR, and so on. This must be defined if multicurrency is enabled for the company. Multicurrency is enabled for the company if Preferences.MultiCurrencyEnabled is set to true. Read more about multicurrency support here. Required if multicurrency is enabled for the company. Options are loaded from the connected account. |
| `active` | `boolean` | No | If true, this entity is currently enabled for use by QuickBooks. If there is an amount in Customer.Balance when setting this Customer object to inactive through the QuickBooks UI, a CreditMemo balancing transaction is created for the amount. |
| `alternatePhoneFreeFormNumber` | `string` | No | Specifies the alternate phone number in free form. |
| `arAccountRefValue` | `string` | No | ID of the accounts receivable account to be used for this customer. Each customer must have his own AR account. Applicable for France companies, only. Available when endpoint is evoked with the minorversion=3 query parameter. Query the Account name list resource to determine the appropriate Account object for this reference, where Account.AccountType=Accounts Receivable. Use Account.Id from that object for ARAccountRef.value. Options are loaded from the connected account. |
| `billAddrCity` | `string` | No | City name for the billing address. |
| `billAddrCountry` | `string` | No | Country name. For international addresses - countries should be passed as 3 ISO alpha-3 characters or the full name of the country. |
| `billAddrCountrySubDivisionCode` | `string` | No | Region within a country for the billing address. For example, state name for USA, province name for Canada. |
| `billAddrLate` | `string` | No | Latitude coordinate of Geocode (Geospacial Entity Object Code). INVALID is returned for invalid addresses. |
| `billAddrLine1` | `string` | No | First line of the billing address. |
| `billAddrLine2` | `string` | No | Second line of the billing address. |
| `billAddrLine3` | `string` | No | Third line of the billing address. |
| `billAddrLine4` | `string` | No | Fourth line of the billing address. |
| `billAddrLine5` | `string` | No | Fifth line of the billing address. |
| `billAddrLong` | `string` | No | Longitude coordinate of Geocode (Geospacial Entity Object Code). INVALID is returned for invalid addresses. |
| `billAddrPostalCode` | `string` | No | Postal code for the billing address. For example, zip code for USA and Canada. |
| `billWithParent` | `boolean` | No | If true, this Customer object is billed with its parent. If false, or null the customer is not to be billed with its parent. This attribute is valid only if this entity is a Job or sub Customer. |
| `businessNumber` | `string` | No | Also called, PAN (in India) is a code that acts as an identification for individuals, families and corporates, especially for those who pay taxes on their income. |
| `companyName` | `string` | No | The name of the company associated with the person or organization. |
| `customerTypeRefValue` | `string` | No | ID referencing the customer type assigned to a customer Options are loaded from the connected account. |
| `defaultTaxCodeValue` | `string` | No | ID of the default tax code associated with this Customer object. Reference is valid if Customer.Taxable is set to true; otherwise, it is ignored. If automated sales tax is enabled (Preferences.TaxPrefs.PartnerTaxEnabled is set to true) the default tax code is set by the system and can not be overridden. Query the TaxCode name list resource to determine the appropriate TaxCode object for this reference. Use TaxCode.Id from that object for DefaultTaxCodeRef.value. |
| `faxFreeFormNumber` | `string` | No | Specifies the fax number in free form. |
| `GSTIN` | `string` | No | GSTIN is an identification number assigned to every GST registered business. |
| `gstRegistrationType` | `string` | No | For the filing of GSTR, transactions need to be classified depending on the type of customer to whom the sale is done. To facilitate this, we have introduced a new field as 'GST registration type'. Possible values are listed below, for their description See the API Docs. GST_REG_REG GST_REG_COMP GST_UNREG CONSUMER OVERSEAS SEZ DEEMED |
| `job` | `boolean` | No | If true, this is a Job or sub-customer. If false or null, this is a top level customer, not a Job or sub-customer. |
| `mobileFreeFormNumber` | `string` | No | Specifies the mobile phone number in free form. |
| `notes` | `string` | No | Free form text describing the Customer. |
| `paymentMethodRefValue` | `string` | No | ID referencing a PaymentMethod object associated with this Customer object Options are loaded from the connected account. |
| `preferredDeliveryMethod` | `string` | No | Preferred delivery method. Values are Print, Email, or None. |
| `primaryEmailAddr` | `string` | No | Primary email address. |
| `primaryPhoneFreeFormNumber` | `string` | No | Specifies the primary phone number in free form. |
| `primaryTaxIdentifier` | `string` | No | Also called Tax Reg. No in ( UK ) , ( CA ) , ( IN ) , ( AU ) represents the tax ID of the Person or Organization. This value is masked in responses, exposing only last five characters. For example, the ID of 123-45-6789 is returned as XXXXXX56789. |
| `printOnCheckName` | `string` | No | Name of the person or organization as printed on a check. If not provided, this is populated from DisplayName. Constraints: Cannot be removed with sparse update. |
| `resaleNum` | `string` | No | Resale number or some additional info about the customer. |
| `saleTermRefValue` | `string` | No | ID of a SalesTerm object associated with this Customer object. Query the Term name list resource to determine the appropriate Term object for this reference. Use Term.Id from that object for SalesTermRef.value. Options are loaded from the connected account. |
| `secondaryTaxIdentifier` | `string` | No | Also called UTR No. in ( UK ) , CST Reg No. ( IN ) also represents the tax registration number of the Person or Organization. This value is masked in responses, exposing only last five characters. For example, the ID of 123-45-6789 is returned as XXXXXX56789 |
| `shipAddrCity` | `string` | No | City name for the shipping address. |
| `shipAddrCountry` | `string` | No | Country name. For international addresses - countries should be passed as 3 ISO alpha-3 characters or the full name of the country. |
| `shipAddrCountrySubDivisionCode` | `string` | No | Region within a country for the shipping address. For example, state name for USA, province name for Canada. |
| `shipAddrId` | `string` | No | Unique identifier of the QuickBooks object for the shipping address, used for modifying the address. The ShippingAddr object represents the default shipping address. If a physical address is updated from within the transaction object, the QuickBooks Online API flows individual address components differently into the Line elements of the transaction response then when the transaction was first created: Line1 and Line2 elements are populated with the customer name and company name. Original Line1 through Line5 contents, City, SubDivisionCode, and PostalCode flow into Line3 through Line5 as a free format strings. |
| `shipAddrLate` | `string` | No | Latitude coordinate of Geocode (Geospacial Entity Object Code). INVALID is returned for invalid addresses. |
| `shipAddrLine1` | `string` | No | First line of the shipping address. |
| `shipAddrLine2` | `string` | No | Second line of the shipping address. |
| `shipAddrLine3` | `string` | No | Third line of the shipping address. |
| `shipAddrLine4` | `string` | No | Fourth line of the shipping address. |
| `shipAddrLine5` | `string` | No | Fifth line of the shipping address. |
| `shipAddrLong` | `string` | No | Longitude coordinate of Geocode (Geospacial Entity Object Code). INVALID is returned for invalid addresses. |
| `shipAddrPostalCode` | `string` | No | Postal code for the shipping address. For example, zip code for USA and Canada. |
| `taxable` | `boolean` | No | If true, transactions for this customer are taxable. Default behavior with minor version 10 and above: true, if DefaultTaxCodeRef is defined or false if TaxExemptionReasonId is set. |
| `taxExemptionReasonId` | `string` | No | The tax exemption reason associated with this customer object. Applicable if automated sales tax is enabled (Preferences.TaxPrefs.PartnerTaxEnabled is set to true) for the company. Set TaxExemptionReasonId: to one of the following: Id Reason 1 Federal government 2 State government 3 Local government 4 Tribal government 5 Charitable organization 6 Religious organization 7 Educational organization 8 Hospital 9 Resale 10 Direct pay permit 11 Multiple points of use 12 Direct mail 13 Agricultural production 14 Industrial production / manufacturing 15 Foreign diplomat |
| `webAddr` | `string` | No | Website address. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "quickbooks_sandbox",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "quickbooks_sandbox-update-customer",
  arguments: {
    customerId: "Customer Reference",
    displayName: "Display Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "quickbooks_sandbox-update-customer",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    quickbooks_sandbox: { authProvisionId: "apn_xxxxxxx" },
    customerId: "Customer Reference",
    displayName: "Display Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "quickbooks_sandbox-update-customer",
    "configured_props": {
      "quickbooks_sandbox": { "authProvisionId": "apn_xxxxxxx" },
      "customerId": "Customer Reference",
      "displayName": "Display Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/quickbooks-sandbox.md · All apps: https://pipedream.com/apps
