QuickBooks: Sample batch request
QuickBooks batch.execute: arguments, response, policy and SDK examples.
← Batch operations · Get started
Operation quickbooks.batch.sample_batch_request
Provider route: POST /v3/company/{realmID}/batch. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/quickbooks with npm, or alter-sdk-quickbooks with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { QuickBooksIntegration } from "@alter-ai/quickbooks";
async function execute(input: Parameters<QuickBooksIntegration["batch"]["execute"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new QuickBooksIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.batch.execute(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_quickbooks import QuickBooksIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = QuickBooksIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.batch.execute(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.minorversion | integer | Optional | Must equal: 75 |
query.requestid | string | Optional | Minimum length: 1 |
body | object | Required within parent | Additional keys: not allowed |
body.BatchItemRequest | array | Required within parent | A wrapper around all request objects for this batch operation. Minimum items: 1 Maximum items: 30 |
body.BatchItemRequest[] | Model | Each item | Expand Sample batch request — request body — body Batch Item Request item |
Referenced models: Sample batch request — request body — body Batch Item Request item
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Sample batch request — response body |
Referenced models: Sample batch request — response body
Schemas
Section titled “Schemas”93 more schemas are linked from the tables above, on the schema pages.
Sample batch request — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
BatchItemResponse | array | Optional | A wrapper around all response objects for this batch operation. |
BatchItemResponse[] | Model | Each item | Expand Sample batch request — response body — Batch Item Response item |
Referenced models: Sample batch request — response body — Batch Item Response item
Sample batch request — response body — Batch Item Response item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
QueryResponse | object | Optional | Additional keys: allowed |
ResourceName | object | Optional | The payload for the response. If the operation results in an error, a Fault object is returned. Additional keys: allowed |
bId | string | Optional | Unique identifier for the batch item. This corresponds to the id supplied in the corresponding batch item request. |
Create a refund receipt — request body — body Check Payment
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
AcctNum | string | Optional | Checking account number, as printed on the check. |
BankName | string | Optional | The name of the bank on which the check was drawn. |
CheckNum | string | Optional | The check number printed on the check. |
NameOnAcct | string | Optional | Name of persons or entities holding the account, as printed on the check. |
Status | string | Optional | Status of the check. Values provided by service/business logic. |
Create a vendor — request body — body Other Contact Info item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
Telephone | string | Optional | |
Type | string | Optional | The type of contact information. Valid values: TelephoneNumber |
Void an invoice — request body — body Delivery Info
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
DeliveryTime | string | Optional | Delivery date and time. Read only: true |
DeliveryType | string | Optional | Type of the delivery. Used to confirm that email has been sent via the send operation. Valid values currently include: Email . Read only: true |
Full update companyinfo — request body — body Email
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
Address | string | Optional | An email address. The address format must follow the RFC 822 standard. |
Full update preferences — request body — body Email Messages Prefs
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
EstimateMessage | Model | Optional | Expand Full update preferences — request body — body Email Messages Prefs Invoice Message Email message details for Estimate. |
InvoiceMessage | Model | Optional | Expand Full update preferences — request body — body Email Messages Prefs Invoice Message Email message details for Invoice. |
SalesReceiptMessage | Model | Optional | Expand Full update preferences — request body — body Email Messages Prefs Invoice Message Email message details for SalesReceipt. |
StatementMessage | Model | Optional | Expand Full update preferences — request body — body Email Messages Prefs Invoice Message Email message details for Statement. |
Referenced models: Full update preferences — request body — body Email Messages Prefs Invoice Message
Read a bill — response body — Bill Meta Data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
CreateTime | string | Optional | Time the entity was created in the source domain. Read only: true |
LastUpdatedTime | string | Optional | Time the entity was last updated in the source domain. Read only: true |
Create a vendor — request body — body Bill Addr
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
City | string | Optional | City name. |
Country | string | Optional | For international addresses, the request can be an ISO alpha-3 code or the full name of the country. The response for update and read operations returns ISO alpha-3 country codes only. |
CountrySubDivisionCode | string | Optional | Region within a country. For example, state name for USA, province name for Canada. |
Id | string | Optional | Unique identifier of the QuickBooks object for the address, autoincremented when the address is changed. This is an internal value included for backwards compatibility and can be ignored. Read only: true |
Line1 | string | Optional | First line of the address. |
Line2 | string | Optional | Second line of the address. |
Line3 | string | Optional | Third line of the address. |
Line4 | string | Optional | Fourth line of the address. |
Line5 | string | Optional | Fifth line of the address. |
PostalCode | string | Optional | Postal code. For example, zip code for USA and Canada |
Create a vendor — request body — body Fax
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
FreeFormNumber | string | Optional | Specifies the telephone number in free form. |
Create a vendor — request body — body Vendor Payment Bank Detail
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
BankAccountName | string | Optional | Name on the Bank Account |
BankAccountNumber | string | Optional | Vendor's Bank Account number. |
BankBranchIdentifier | string | Optional | bank identification number used to identify the Bank Branch. 6 digit value in format xxx-xxx. |
StatementText | string | Optional | Text/note/comment for Remmittance |
Create a vendor — request body — body Web Addr
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
URI | string | Optional | Uniform Resource Identifier for the web site. |
Create a bill — request body — body Line item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
AccountBasedExpenseLineDetail | Model | Required within parent | Expand Create a bill — request body — body Line item Account Based Expense Line Detail LineDetail |
Amount | JSON | Required within parent | The amount of the line item. Decimal string |
Amount (anyOf 1) | number | Alternative | |
Amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?$ |
CustomExtensions | array | Optional | Array of custom extension objects that associate additional attributes with the line. The ExtensionType field specifies the type of extension. The currently supported value is DIMENSION . The AssociatedValues array contains key/value pairs referencing Dimensions DefinitionID/Dimension ValueID. Multiple key/value pairs per extension type are supported. This field is designed to support additional extension types in the future. Dimensions is available for Intuit Enterprise Suite. |
CustomExtensions[] | Model | Each item | Expand Create an item — request body — body Custom Extensions item |
Description | string | Optional | Free form text description of the line item that appears in the printed record. |
DetailType | string | Required within parent | Set to AccountBasedExpenseLineDetail for this type of line. |
Id | string | Optional | The Id of the line item. Its use in requests is as folllows: If Id is greater than zero and exists for the company, the request is considered an update operation for a line item. If no Id is provided, the Id provided is less than or equal to zero, or the Id provided is greater than zero and does not exist for the company then the request is considered a create operation for a line item. Available in all objects that use lines and support the update operation. Read only: true |
LineNum | JSON | Optional | Specifies the position of the line in the collection of transaction lines. Positive Integer. Decimal string |
LineNum (anyOf 1) | number | Alternative | |
LineNum (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?$ |
Referenced models: Create a bill — request body — body Line item Account Based Expense Line Detail, Create an item — request body — body Custom Extensions item
Create a bill — request body — body Currency Ref
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: allowed |
name | string | Optional | The full name of the currency. |
value | JSON | Required within parent | |
value (anyOf 1) | string | Alternative | |
value (anyOf 2) | integer | Alternative | Minimum: 0 Maximum: 9007199254740991 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: quickbooks.batch.sample_batch_request. Catalog operation: batch. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.