upsertAccountingItem
Creates or updates the endless-owned accounting item for a product.
Only the fields provided are written, so a single field can be edited without sending the
rest. Passing an explicit null clears that field; omitting it leaves it alone. The
accounting item is created on the first call for a product, taking its name from the
product when no name is given.
Business Rules
- Turning off
salesEnabledclears the sales description, sales price, and income account. - Turning off
purchaseEnabledclears the purchase description, purchase cost, and expense account. - An
itemTypeother thaninventoryclears inventory tracking and the asset account. inventoryTrackedcan only be true whileitemTypeisinventory.- Account arguments take the provider's account id, which must already be present in the imported chart of accounts for the given integration.
Error Scenarios
- **
BAD_REQUEST**: the product does not belong to this company, the integration does not belong to this company, an account id is not in the imported chart of accounts, orinventoryTrackedis set on a non-inventory item. - **
NOT_FOUND**: the integration does not exist.
Permissions Required
accounting:configure_product_accountingpermission.
upsertAccountingItem(
input: UpsertAccountingItemInput!
): UpsertAccountingItemPayload
Arguments
upsertAccountingItem.input ● UpsertAccountingItemInput! non-null input common
Parameters for UpsertAccountingItem
Type
UpsertAccountingItemPayload object common
Autogenerated return type of UpsertAccountingItem.