Skip to content

countRecords

READ

Count one QuickBooks entity's records matching every criterion, without reading them.

POST /api/v1/quickbooks/countRecords
curl -X POST '<your-host>/api/v1/quickbooks/countRecords' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "entity": "Customer"
  }'
Response
0

Parameters

ParameterType

The QuickBooks entity, by the name Intuit's API gives it.

"Customer""Vendor""Account""Department""Class""Item""Invoice""CreditMemo""Payment""JournalEntry""Deposit""Bill"

Conditions every record must meet, joined with AND. QuickBooks answers Customer, Vendor, Account, Department, Class and Item with their active records only unless a criterion names Active; { "field": "Active", "operator": "IN", "value": [true, false] } includes the inactive ones.

Input schema

schema
{
  "type": "object",
  "properties": {
    "entity": {
      "type": "string",
      "enum": [
        "Customer",
        "Vendor",
        "Account",
        "Department",
        "Class",
        "Item",
        "Invoice",
        "CreditMemo",
        "Payment",
        "JournalEntry",
        "Deposit",
        "Bill"
      ],
      "description": "The QuickBooks entity, by the name Intuit's API gives it."
    },
    "criteria": {
      "default": [],
      "description": "Conditions every record must meet, joined with AND. QuickBooks answers Customer, Vendor, Account, Department, Class and Item with their active records only unless a criterion names Active; { \"field\": \"Active\", \"operator\": \"IN\", \"value\": [true, false] } includes the inactive ones.",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "field": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9]*(\\.[A-Za-z][A-Za-z0-9]*)*$",
                "description": "A property of the entity, a dotted path such as MetaData.CreateTime. Commonly filtered: Customer: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, DisplayName, GivenName, FamilyName, CompanyName, PrimaryEmailAddr, PrimaryPhone, Balance, Active; Vendor: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, SyncToken, GivenName, MiddleName, FamilyName, CompanyName, DisplayName, PrintOnCheckName, Active, PrimaryPhone, AlternatePhone, Mobile, Fax, PrimaryEmailAddr, WebAddr, Title, Balance, BillRate, AcctNum, Vendor1099; Account: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, SubAccount, ParentRef, Description, Active, Classification, AccountType, CurrentBalance; Department: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, Active; Class: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, Active; Item: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, Active, Type, Sku; Invoice: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, DocNumber, TxnDate, DueDate, CustomerRef, ClassRef, DepartmentRef, Balance, TotalAmt; CreditMemo: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, CustomerRef, TxnDate; Payment: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, CustomerRef, TxnDate; JournalEntry: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, DocNumber, TxnDate; Deposit: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, TxnDate; Bill: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, SyncToken, TxnDate, DueDate, Balance, TotalAmt, VendorRef, APAccountRef, DocNumber, PrivateNote, ExchangeRate, DepartmentRef, CurrencyRef."
              },
              "operator": {
                "type": "string",
                "enum": [
                  "=",
                  "<",
                  ">",
                  "<=",
                  ">=",
                  "LIKE"
                ]
              },
              "value": {
                "description": "The value compared with; LIKE takes % as its wildcard.",
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            },
            "required": [
              "field",
              "operator",
              "value"
            ]
          },
          {
            "type": "object",
            "properties": {
              "field": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9]*(\\.[A-Za-z][A-Za-z0-9]*)*$",
                "description": "A property of the entity, a dotted path such as MetaData.CreateTime. Commonly filtered: Customer: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, DisplayName, GivenName, FamilyName, CompanyName, PrimaryEmailAddr, PrimaryPhone, Balance, Active; Vendor: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, SyncToken, GivenName, MiddleName, FamilyName, CompanyName, DisplayName, PrintOnCheckName, Active, PrimaryPhone, AlternatePhone, Mobile, Fax, PrimaryEmailAddr, WebAddr, Title, Balance, BillRate, AcctNum, Vendor1099; Account: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, SubAccount, ParentRef, Description, Active, Classification, AccountType, CurrentBalance; Department: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, Active; Class: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, Active; Item: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, Name, Active, Type, Sku; Invoice: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, DocNumber, TxnDate, DueDate, CustomerRef, ClassRef, DepartmentRef, Balance, TotalAmt; CreditMemo: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, CustomerRef, TxnDate; Payment: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, CustomerRef, TxnDate; JournalEntry: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, DocNumber, TxnDate; Deposit: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, TxnDate; Bill: Id, MetaData.CreateTime, MetaData.LastUpdatedTime, SyncToken, TxnDate, DueDate, Balance, TotalAmt, VendorRef, APAccountRef, DocNumber, PrivateNote, ExchangeRate, DepartmentRef, CurrencyRef."
              },
              "operator": {
                "type": "string",
                "const": "IN"
              },
              "value": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    },
                    {
                      "type": "boolean"
                    }
                  ]
                },
                "description": "The values any one matches."
              }
            },
            "required": [
              "field",
              "operator",
              "value"
            ]
          }
        ]
      }
    }
  },
  "required": [
    "entity"
  ]
}