Skip to content

Skill: Customer Upsert

The Customer Upsert skill creates new customer records, updates existing ones, or performs an upsert (create if not found, update if exists) in QuickBooks Online. This is the primary skill for managing customer data.

ParameterTypeRequiredDescription
actionstringYesThe operation to perform: create, update, or upsert.
display_namestringYes (for create/upsert)The customer’s display name. Must be unique in QuickBooks.
given_namestringNoCustomer’s first name.
family_namestringNoCustomer’s last name.
company_namestringNoAssociated company name.
primary_email_addrstringNoPrimary email address.
primary_phoneobjectNoPrimary phone number. Object with free_form_number field.
mobile_phoneobjectNoMobile phone number. Object with free_form_number field.
alternate_phoneobjectNoAlternate phone number. Object with free_form_number field.
bill_addrobjectNoBilling address. Object with line1, line2, city, country_sub_division_code (state), postal_code, country fields.
ship_addrobjectNoShipping address. Same structure as bill_addr.
idstringYes (for update)QuickBooks customer ID. Required when action is update.
sync_tokenstringYes (for update)QuickBooks sync token for optimistic concurrency. Required when action is update.
ActionBehavior
createCreates a new customer. Fails if display_name already exists.
updateUpdates an existing customer. Requires id and sync_token.
upsertSearches by display_name. If found, updates. If not found, creates.

Creating a new customer:

“Add a new customer: Jane Smith at Acme Corp, email jane@acme.com, billing address 123 Main St, Springfield, IL 62701.”

The agent would invoke this skill with:

  • action: create
  • display_name: Jane Smith
  • given_name: Jane
  • family_name: Smith
  • company_name: Acme Corp
  • primary_email_addr: jane@acme.com
  • bill_addr: { "line1": "123 Main St", "city": "Springfield", "country_sub_division_code": "IL", "postal_code": "62701" }

Updating an existing customer:

“Update Acme Corp’s email to billing@acme.com.”

The agent would first query the customer to get the id and sync_token, then invoke this skill with:

  • action: update
  • id: 12345
  • sync_token: 2
  • primary_email_addr: billing@acme.com

The skill returns the created or updated customer record, including:

  • Id — the QuickBooks customer ID.
  • SyncToken — the new sync token (incremented after an update).
  • All customer fields reflecting the current state after the operation.

POST /api/quickbooks/v1.0/customer-upsert


Related skills: Query Customer | Search Invoices