Mutation: Create Product/Service

Create a product (or service) under a business.

Inputs required name and unitPrice along with optional description.

To indicate you are selling the product, provide an incomeAccountId. Valid income accounts can be found by filtering accounts by subtypes INCOME, DISCOUNTS, OTHER_INCOME.

To indicate you are buying the product, provide an expenseAccountId. Valid expense accounts can be found by filtering accounts by subtypes EXPENSE, COST_OF_GOODS_SOLD, PAYMENT_PROCESSING_FEES, PAYROLL_EXPENSES.

Find Valid Income Accounts
query {
  business(id: "<BUSINESS_ID>") {
    id
    accounts(subtypes: [INCOME, DISCOUNTS, OTHER_INCOME]) {
      edges {
        node {
          id
          name
          subtype {
            name
            value
          }
        }
      }
    }
  }
}
Create Operation
mutation ($input: ProductCreateInput!) {
  productCreate(input: $input) {
    didSucceed
    inputErrors {
      code
      message
      path
    }
    product {
      id
      name
      description
      unitPrice
      incomeAccount {
        id
        name
      }
      expenseAccount {
        id
        name
      }
      isSold
      isBought
      isArchived
      createdAt
      modifiedAt
    }
  }
}
Operation Variables
{
  "input": {
    "businessId": "<BUSINESS_ID>",
    "name": "LED Bulb",
    "description": "5 Watt C7 light bulb",
    "unitPrice": "2.0625",
    "incomeAccountId": "<ACCOUNT_ID>"
  }
}
Updated: