Skip to main content

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 salesEnabled clears the sales description, sales price, and income account.
  • Turning off purchaseEnabled clears the purchase description, purchase cost, and expense account.
  • An itemType other than inventory clears inventory tracking and the asset account.
  • inventoryTracked can only be true while itemType is inventory.
  • 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, or inventoryTracked is set on a non-inventory item.
  • **NOT_FOUND**: the integration does not exist.

Permissions Required

  • accounting:configure_product_accounting permission.
upsertAccountingItem(
input: UpsertAccountingItemInput!
): UpsertAccountingItemPayload

Arguments

upsertAccountingItem.input ● UpsertAccountingItemInput! non-null input common

Parameters for UpsertAccountingItem

Type

UpsertAccountingItemPayload object common

Autogenerated return type of UpsertAccountingItem.