> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://zuora.ferndocs.com/docs/platform/integration/apis/soap-api/soap-api-calls/query/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server. # query() > Use the query() to query against an object in Zuora. Use the query() to query against an object in Zuora. The query() call sends a query expression by specifying the object to query, the fields to retrieve from that object, and any filters to determine whether a given object should be queried. ## Usage Zuora has a SQL-like query language you can use to construct those queries, passing them through the queryString. Once the call is made, the API executes the query against the specified object and returns a query response object to your application. Your application can then iterate through rows in the query response to retrieve information. ## The \< character in query calls The character, `<`, indicates to the Zuora API the beginning mark of an element. Unless that is your intent, substitute these characters for the `<` character: `<` The character, `>`, does not require substitution. ## Example request ``` select id,accountId,autorenew,initialTerm,renewalTerm,termEndDate,termStartDate from Subscription where accountId='2c92a0gc4030cg1b01392af7533f48a6' and status='active' and subscriptionStartDate <= '2012-08-15' and subscriptionEndDate >= '2012-08-15=' ``` ## Example response ``` 2c92a0fb3929bf1a01392af6426748a9 2c92a0fb3929bf1a01392af6422f48a6 true 1 1 2012-09-15 2012-08-15 ``` ## Limitations This call has the following limitations: * All keywords must be in lower case. * The number of records returned is limited to 2000 records (100 records for WSDL v5 and earlier). > Use the query() to query against an object in Zuora. ## Docs - [Query usage on an account](https://zuora.ferndocs.com/docs/platform/integration/apis/soap-api/soap-api-calls/query/query-usage-on-an-account.md): This reference provides sample code of using the query() to query usage on an account. - [Query processed usage](https://zuora.ferndocs.com/docs/platform/integration/apis/soap-api/soap-api-calls/query/query-processed-usage.md): You can query the Processed Usage object synchronously through SOAP API to retrieve billed usage records.