Skill: Customer Upsert
Create, update, or upsert customer records in QuickBooks Online with full control over contact details, addresses, and phone numbers.
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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | The operation to perform: create, update, or upsert. |
display_name | string | Yes (for create/upsert) | The customer’s display name. Must be unique in QuickBooks. |
given_name | string | No | Customer’s first name. |
family_name | string | No | Customer’s last name. |
company_name | string | No | Associated company name. |
primary_email_addr | string | No | Primary email address. |
primary_phone | object | No | Primary phone number. Object with free_form_number field. |
mobile_phone | object | No | Mobile phone number. Object with free_form_number field. |
alternate_phone | object | No | Alternate phone number. Object with free_form_number field. |
bill_addr | object | No | Billing address. Object with line1, line2, city, country_sub_division_code (state), postal_code, country fields. |
ship_addr | object | No | Shipping address. Same structure as bill_addr. |
id | string | Yes (for update) | QuickBooks customer ID. Required when action is update. |
sync_token | string | Yes (for update) | QuickBooks sync token for optimistic concurrency. Required when action is update. |
When updating a customer, you must provide the current id and sync_token. These values come from a prior Query Customer call. If the sync_token does not match (because someone else updated the record), the update will fail with a conflict error.
Action modes
| Action | Behavior |
|---|---|
create | Creates a new customer. Fails if display_name already exists. |
update | Updates an existing customer. Requires id and sync_token. |
upsert | Searches by display_name. If found, updates. If not found, creates. |
Example usage
Creating a new customer:
“Add a new customer: Jane Smith at Acme Corp, email [email protected], billing address 123 Main St, Springfield, IL 62701.”
The agent would invoke this skill with:
action:createdisplay_name:Jane Smithgiven_name:Janefamily_name:Smithcompany_name:Acme Corpprimary_email_addr:[email protected]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 [email protected].”
The agent would first query the customer to get the id and sync_token, then invoke this skill with:
action:updateid:12345sync_token:2primary_email_addr:[email protected]
The agent always confirms with the user before executing create or update operations. This behavior is built into the recommended agent instructions for any agent using write skills.
Response structure
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.
Related skills: Query Customer | Search Invoices