You are here: Integrating With CPQ Cloud > REST APIs > Query Specification Syntax

Query Specification Syntax


When query REST calls need to be more specific, CPQ Cloud can interpret query specifications that follow CPQ Cloud query and pagination parameters syntax (specified below), and query specifications that follow a subset of MongoDB syntax.

Not all MongoDB syntax can be interpreted by CPQ Cloud. See the MongoDB Query Specifications section for more information.


ClosedQuery and Pagination Parameters Rules

ClosedQuery and Pagination Parameters URL Format


URL Parameter Description


The URI endpoint of the REST API resource.


A query parameter (see the Query Parameters and Pagination Parameters lists below for parameter names, descriptions, and examples).


The parameter specification of the preceding parameter.

ClosedQuery Parameters

ClosedPagination Parameters

ClosedMongoDB Query Specifications

When a q parameter is introduced within query parameters, CPQ Cloud will interpret the subsequent query specification as a JSON construct following MongoDB query syntax. The MongoDB expression can contain a single condition, or multiple conditions that are combined with a conjunction operator.

$and and $or are the only MongoDB conjunction operators that can be interpreted by CPQ Cloud.

Each condition must be expressed as a name-value pair, using the following format:


Condition Parameter Description


The variable name of the attribute being used in the condition.


The comparison operator to relate the attribute with an attribute value.


The value of the attribute to relate to the comparison operator

The following MongoDB comparison operators are the only comparison operators that can be interpreted by CPQ Cloud.

Comparison Operator Description Example


Equals (=)

q={createdBy:{$eq: 'Matt'}}


Not equals (<>)

q={createdBy:{$ne: 'Matt'}}


Greater than (>)

q={quantity:{$gt: '100'}}


Greater than or equals (>=)

q={quantity:{$gte: '100'}}


Less than (<)

q={quantity:{$lt: '100'}}


Less than or equals (<=)

q={quantity:{$lte: '100'}}


  • exists true = IS NOT NULL
  • exists false = IS NULL


For more information on MongoDB syntax, see MongoDB’s Query Documents documentation.



Related Topics Link IconSee Also