Skip to content

Releases

v0.11.1

Choose a tag to compare

@nmajor nmajor released this 17 Nov 02:06
  • Released in lockstep with the other Desktop Accounting API packages; no entries for this package.

All versions: CHANGELOG.md.

v0.11.0

Choose a tag to compare

@nmajor nmajor released this 10 Nov 23:18
  • Breaking: discriminated unions narrow on their discriminator. Item, Entity and BatchResult are now unions of the kinds this SDK models, so if (item.objectType === "qbd_service_item") or a switch gives a ServiceItem; before, the fallback stayed in the union and the narrowed value was ServiceItem | UnrecognizedItem. The fallbacks UnrecognizedItem, UnrecognizedEntity and UnknownBatchResult are separate types, and new type guards test each kind: isServiceItem(item), isVendor(entity), isBatchCustomerCreateResult(result) and so on, plus isUnrecognizedItem, isUnrecognizedEntity and isUnknownBatchResult for a kind this SDK does not model. Such a kind still arrives unchanged at runtime. Migration: test it with the fallback guard before narrowing (if (isUnrecognizedItem(item)) { ... }), instead of comparing objectType with "qbd_unrecognized_item" or another string this SDK does not list (a type error now), assigning an UnrecognizedItem to Item, or reading fields in the default branch of a switch over every kind (the value is never there).
  • Breaking: a write whose outcome was unknown and that the platform later recovered (request succeeded, outcome applied, recovered: true, result null, recoveredObjectId set) throws the new ResultUnavailableError from RequestHandle.wait(), RequestHandle.result() and the long poll after 504 QBD_REQUEST_TIMEOUT. They returned null typed as the result. The error is an InternalError with requestId, outcome applied, retryable false and recoveredObjectId; retrieve the object by that ID and do not send the write again. This holds also when the result is past retention (resultExpired true).
  • 500 INTERNAL_ERROR with details.reason result_unavailable (the result is no longer available) throws ResultUnavailableError (recoveredObjectId null) and is never retried, even when Daapi-Should-Retry says true. For a write that was applied (outcome: applied), never send it again and read the object instead; for a read (outcome: not_applicable), it is safe to send the read again.
  • client.qbd.priceLevels.list() accepts itemId, an alias of itemIds with Conductor's name for this filter, so Conductor code ports unchanged. Both take one item ID; sending both with different values returns 400 INVALID_PARAMETER. Batch members (BatchPriceLevelListInputQuery) accept it too.

All versions: CHANGELOG.md.

v0.10.0

Choose a tag to compare

@nmajor nmajor released this 27 Oct 10:08
  • The request resource (recoveredObjectId) names the object a write created or changed when the platform recovered that write after a lost acknowledgement. QuickBooks' response body to such a write was never received, so a request retrieved with requests.retrieve that shows succeeded, applied and recovered: true keeps result null: retrieve the object by this id. It is null for every other request. A typed batch recovered that way still carries each create member's own recoveredObjectId in result; the request-level field holds the first write member's.
  • A list you keep reading keeps its QuickBooks session open for up to 10 minutes. The 2-minute session cap ended longer list reads with 410 CURSOR_EXPIRED (session_ended), with no way to resume. The 10-second idle window between pages is unchanged. See the Pagination guide.

All versions: CHANGELOG.md.

v0.9.1

Choose a tag to compare

@nmajor nmajor released this 21 Oct 18:01
  • New error QBD_MERGE_NOT_ALLOWED (422, not retryable, outcome not_applied) on merges (qbd.<list>.merge and merges sent through passthrough or a batch) when QuickBooks Desktop refuses the merge with status 3500 outside the multi-user case. It used to surface as QBD_REQUEST_ERROR with QuickBooks' "Unknown Error". details carries qbxmlStatusCode, qbxmlStatusMessage, requestElement, listMergeType, sourceId, targetId, fileMode, fileModeObservedAt and requestId; nothing was changed. Do not retry automatically. Customer merges add the diagnosis cause customer_merge_native_refusal, which confirms the refusal without claiming a cause; QuickBooks does not report one.
  • The passthrough endpoint documents QBD_MERGE_NOT_ALLOWED and QBD_REQUIRES_SINGLE_USER_MODE for raw ListMergeRq requests.

All versions: CHANGELOG.md.

v0.9.0

Choose a tag to compare

@nmajor nmajor released this 19 Oct 09:57
  • Retry-After is waited out in full, including values above 60 s. A longer value used to fall back to the 0.5 to 8 s backoff, so the retry came sooner than the server asked. When the wait would end after totalTimeout (or is longer than about 24.8 days, the longest timer), the SDK throws the error without retrying.

All versions: CHANGELOG.md.

v0.8.0

Choose a tag to compare

@nmajor nmajor released this 13 Oct 15:52
  • A read that was sent, interrupted (for example when QuickBooks closed unexpectedly, HRESULT 0x80040402) and queued for its automatic retry now ends with QBD_READ_INTERRUPTED (502, details.reason, details.retry, details.firstSentAt) when the retry is not sent in time. It answered 504 REQUEST_TIMEOUT_NOT_SENT with sentAt: null. A request's sentAt is no longer reset to null by the retry.
  • New diagnosis cause quickbooks_closed_unexpectedly: QuickBooks returned an error instead of a result (0x80040402 when it crashed) and the Web Connector, still running with a stuck update lock, has not checked in since. It ranks above web_connector_closed. diagnosis.connector.lastSeenAt now counts the calls of a session that ended, not only the last check-in.
  • Breaking: qbd.unitOfMeasureSets.delete is removed. QuickBooks answered status 1000 and Intuit documents that a unit of measure set cannot be deleted; DELETE /v1/quickbooks-desktop/unit-of-measure-sets/{id} now answers 422 QBD_OPERATION_UNSUPPORTED with alternatives (make the set inactive in QuickBooks Desktop) and sends nothing.
  • Breaking: qbd.fixedAssetItems.create requires assetAccountId. QuickBooks rejects a fixed asset item without an asset account (status 3180), although the qbXML schema marks it optional.
  • Creating or updating a public custom field definition (ownerId "0") accepts only customer, vendor, employee and item in assignToObjects and removeFromObjects; other values answer 400 INVALID_PARAMETER before anything is sent. QuickBooks refused them with status 3351.
  • A QuickBooks status 3231 for a request that was alone in its message set carries details.onlyRequestInMessageSet: true and says no earlier request caused it. Lead requests and class merges have documented incompatibilities (status 3231 and 3500 on QuickBooks Enterprise 24).
  • Breaking: a list-object delete (qbd.<list>.delete, QuickBooks ListDel) no longer always answers deleted: true. QuickBooks Desktop can accept the delete and keep the object, inactive and readable by its ID (Enterprise 24 did this in every test). The API reads the object back in the same request: deleted is true only when QuickBooks no longer returns it; otherwise deleted is false, deactivated is true when it is now inactive, and isActive holds its state. The result types gain deactivated and isActive.
  • QBD_REQUEST_ERROR on a read (for example a payroll report QuickBooks refused with status 3262) has the end-user text "QuickBooks Desktop could not provide this information." It said "did not accept this change". errors.json documents readUserFacingMessage.
  • Breaking: custom field definition update and delete take the definition name as the path parameter definitionName (it was name).
  • Breaking: one fallback type per union. An item or entity of a kind this SDK does not model, whether QuickBooks returned a kind the API does not model (objectType qbd_unrecognized_item) or the API added a kind after this SDK version, is an UnrecognizedItem / UnrecognizedEntity with the shared fields plus qbxmlElement and fields; its objectType is a plain string. UnknownItem and UnknownEntity are gone.
  • Breaking: identical enums share one type, used on requests and responses alike, for example AssignToObject (also CustomFieldDefinition.assignToObjects), LeadStatus, ToDoType, ToDoPriority, ClearedStatus, BillingStatus, CustomFieldOperation, TransactionKind and Outcome. The per-operation names (LeadCreateInputStatus, CustomFieldDefinitionCreateInputAssignToObject, RequestListParamsStatu, ...) are gone.
  • Breaking: type renames: LeadContactsCreateInput / LeadContactsUpdateInput / LeadContacts are LeadContactCreateInput / LeadContactUpdateInput / LeadContact; DeletedCustomFieldDefinition is CustomFieldDefinitionDeleted; the result of transactions.updateClearedStatus is TransactionClearedStatus, whose clearedStatus is a ClearedStatus.
  • Breaking: to-do list parameters lose the name filters (a to-do has no name), and payrollWageItems.list no longer takes cursor (the list is never paginated; any cursor was refused).
  • IntegrationConnection (an end user's integrationConnections) carries endUserId, disabled and setupCompletedAt, like EndUserConnection, which has every IntegrationConnection field plus installs and companyFileMismatches.
  • The createdAt and updatedAt of every *Voided result are date-times.
  • CursorExpired's reason is a typed set (idle_timeout, session_ended, quickbooks_restarted, evicted, or a value added later). The cursor-expired error stays a subclass of the invalid-request error, because the API classifies CURSOR_EXPIRED as INVALID_REQUEST_ERROR; catch it first when you handle the two differently.
  • Breaking: confirm on deletes and merges is typed true and required, so a call without it does not compile.
  • TransactionCustomFieldValueInput extends CustomFieldValueInput, and CustomerMergeInput extends ListMergeInput.
  • New exported type CursorExpiredReason.
  • Breaking: a list-object delete's deleted and deactivated can be null: QuickBooks accepted the delete but reading the record back failed. The request then succeeds with outcome applied and a new QBD_DELETE_NOT_VERIFIED warning; do not send the delete again. A failed write the API verified as applied keeps outcome applied and is not retryable.
  • List-object delete results gain retainedBecause: multi_user_mode when QuickBooks kept the record because the company file was open in multi-user mode (it deletes in single-user mode).
  • New error code QBD_REQUIRES_SINGLE_USER_MODE (409, not retryable, outcome not_applied): merges and custom field definition deletes are refused before sending while the company file is open in multi-user mode, and custom field values QuickBooks refuses there (status 3180 or 3120) map to it. integrationConnections[].companyFile.fileMode (single_user / multi_user) shows the mode of the last session.
  • A lead request QuickBooks does not process (status 3231, even a plain lead list) answers 422 QBD_OPERATION_UNSUPPORTED with alternatives instead of QBD_REQUEST_ERROR.
  • qbd.vehicleMileage.delete reads the trip first: an unknown ID answers 404 QBD_OBJECT_NOT_FOUND; an existing trip answers 422 QBD_OPERATION_UNSUPPORTED (QuickBooks refuses the delete with status 3160 even on a fresh company file) without sending the delete.
  • The quickbooks_closed_unexpectedly diagnosis needs QuickBooks' "Unexpected error" (HRESULT 0x80040402) in a session the Web Connector never closed, and silence since its last contact; its steps first have the end user check that QuickBooks closed and no other application is updating.
  • Batches (qbd.batch) follow the same rules: a list-delete member reads the record back (deleted, deactivated, retainedBecause, and a QBD_DELETE_NOT_VERIFIED member warning when the read-back failed), a batch holding a merge or custom field definition delete is refused with 409 QBD_REQUIRES_SINGLE_USER_MODE in multi-user mode (details.index names the member), a lead member QuickBooks does not process is QBD_OPERATION_UNSUPPORTED, a vehicle mileage delete member is refused with 422 QBD_OPERATION_UNSUPPORTED, and batch delete and merge members require confirm like the typed calls.
  • Breaking: a batch member for custom field definition update or delete takes pathParams.definitionName (was pathParams.name), as the typed calls do.
  • A custom field definition delete reads the owner's definitions back in the same request: CustomFieldDefinitionDeleted gains deleted (true only when the definition is gone, false when QuickBooks kept it, null when the read-back failed with a QBD_DELETE_NOT_VERIFIED warning) and retainedBecause (multi_user_mode or unknown), on the typed call and as a batch member.
  • QBD_REQUIRES_SINGLE_USER_MODE now needs QuickBooks' own evidence: a custom field value refused with another 3180/3120 message keeps its code (for example not found, or QBD_TRANSIENT_ERROR for a record modified by another user); a generic data-extension refusal in multi-user mode keeps its code with details.possibleCause: multi_user_mode.
  • A batch member QuickBooks refused is not_applied in its result and its error, whatever other members did; a lead member under continueOnError after another member failed is QBD_OPERATION_UNSUPPORTED, not not_processed; the vehicle mileage refusal carries details.index.
  • New error code QBD_REAUTHORIZATION_REQUIRED (ErrorCode.QBD_REAUTHORIZATION_REQUIRED): 503, not retryable. QuickBooks answered the Web Connector with 0x80040435 and asks its Admin to reauthorize the application in Edit > Preferences > Integrated Applications; nothing was sent. It answered QBD_CONNECTION_ERROR. New diagnosis cause quickbooks_reauthorization_required.
  • A company file QuickBooks cannot reach at its stored location (0x80040408 for a path on a drive letter other than C:, usually a disconnected mapped network drive, or for the same path twice in a row) answers QBD_COMPANY_FILE_NOT_FOUND with details.reason path_unreachable, details.pathKind and details.refusals, and the new diagnosis cause company_file_not_found ranks first. It answered QBD_WRONG_COMPANY_FILE_OPEN ("a different company file is open").
  • A QuickBooks status 3170 whose message says the record is in use, locked or being edited answers 409 QBD_OBJECT_IN_USE with the record_in_use diagnosis (not retryable for a deletion). It answered 422 QBD_REQUEST_ERROR. QuickBooks does not lock every open record, so the documentation no longer promises that an open window blocks a change.
  • A payment item or job type name that is already in use answers 409 QBD_DUPLICATE_NAME with param name (QuickBooks status 3180). It answered 422 QBD_REQUEST_ERROR....
Read more

v0.7.0

Choose a tag to compare

@nmajor nmajor released this 12 Oct 21:40
  • New client.qbd.batch(): up to 25 typed QuickBooks Desktop operations in one Web Connector round trip. Each member is a BatchRequestInput object ({ operationId, pathParams?, query?, body? }), and each result is typed by the request at the same position (BatchResultFor): results[0].data of a qbd.customers.create member is a Customer. One Idempotency-Key covers the batch; a lost response raises OutcomeUnknownError with details.members and is never retried.
  • A batch whose response was lost and whose create members the API later found in QuickBooks by their externalId returns each such member with data: null and the record's QuickBooks ID in recoveredObjectId (on every batch result: string | null), on client.requests.retrieve() and on an idempotent replay.
  • New error code QBD_REQUEST_NOT_PROCESSED (ErrorCode.QBD_REQUEST_NOT_PROCESSED): 409, not retryable. QuickBooks skipped a batch member because an earlier member failed under stopOnError (status 3231).
  • Breaking (types only): the credit card request info of receive payments is typed as its own QbdRequest interface. It was typed as the platform Request (the request resource) by mistake; only code that relied on the wrong fields is affected.
  • Change feed subscriptions: client.changeFeedSubscriptions.create(), .list(), .retrieve(), .update() and .delete() (/v1/change-feed-subscriptions). A subscription polls every connected end user of the project for changed and deleted records of the listed resources and sends data.changed webhooks with their IDs. New webhook event type WebhookEventType.DATA_CHANGED (data.changed). New error code CHANGE_FEED_SUBSCRIPTION_LIMIT_REACHED (422, not retryable).

All versions: CHANGELOG.md.

v0.6.0

Choose a tag to compare

@nmajor nmajor released this 12 Oct 05:49
  • Breaking: the list parameters type of qbd.classes.list is renamed from ClasseListParams to ClassListParams (the generator dropped only the final "s" of "classes"). Rename the type in your code; nothing else changes. No other type name was affected.
  • client.webhookEndpoints.rotateSecret() works: the API now honors the Idempotency-Key the client always sends (a retry returns the same new secret without rotating twice) and answers an unknown endpoint ID with 404 RESOURCE_MISSING. It answered 400 INVALID_PARAMETER.
  • New error code QBD_SALES_TAX_THROUGH_DATE_TOO_EARLY (ErrorCode.QBD_SALES_TAX_THROUGH_DATE_TOO_EARLY): 422, not retryable. QuickBooks refused a sales tax payment check and asked for a later sales tax 'through' date (status 3140); nothing changed. If the end user records the sales tax in QuickBooks instead, read and link that check rather than creating another. It answered QBD_REFERENCE_NOT_FOUND on vendorId.
  • A sales representative initial that is already in use answers 409 QBD_DUPLICATE_NAME with param initial (QuickBooks status 3180). It answered 422 QBD_REQUEST_ERROR.
  • QBD_OBJECT_IN_USE is retryable only when the record is open or locked in QuickBooks. A deletion or void refused because other records still use the object is retryable: false, so the client no longer treats it as worth repeating.
  • Status 3390 (too many open QuickBooks list iterators) is QBD_TRANSIENT_ERROR with details.reason max_iterators. The API now stops the QuickBooks iterator of a cursor you stop reading (after about 10 seconds idle, or when a fourth cursor list starts for the same end user), so breaking out of a list loop early no longer uses up QuickBooks' iterator limit.
  • Report validation: missing_checks requires accountIds or accountFullNames, the job detail reports require entityIds or entityFullNames, and physical_inventory_worksheet rejects reportDateMacro, each with 400 INVALID_PARAMETER naming the parameter. Unit of measure set create rejects isActive: false, which QuickBooks ignores.
  • New error code QBD_TRANSIENT_ERROR (ErrorCode.QBD_TRANSIENT_ERROR): 503, retryable, outcome not_applied. QuickBooks was briefly busy (status 3390, or 3180 when a list was modified by another user) and changed nothing. The client retries it automatically with the same idempotency key, which now runs the write again instead of replaying the error. These answered QBD_REQUEST_ERROR (422, not retryable).

All versions: CHANGELOG.md.

v0.5.4

Choose a tag to compare

@nmajor nmajor released this 09 Oct 23:41
  • New error code ROUTE_NOT_FOUND (ErrorCode.ROUTE_NOT_FOUND): a 404 for a method and path the API has no endpoint for, such as the API root. These answered RESOURCE_MISSING, whose cause describes a missing ID.

All versions: CHANGELOG.md.

v0.5.3

Choose a tag to compare

@nmajor nmajor released this 09 Oct 21:24
  • Releases publish to npm through trusted publishing (GitHub OIDC) with provenance; no npm token is used. The publish script checks that npm is new enough.

All versions: CHANGELOG.md.