Query Nue Objects using GraphQL
14 min
introduction nue offers a dual platform, which means nue’s platform stores and manages data from 2 different saas platforms salesforce & nue’s cloud services if your nue instance is connected to a salesforce org, all the objects that support products and pricing have salesforce as the only data source you can use nue’s graphql service to access the data of any objects in nue the object can be queried from either salesforce or from nue's aws services, depending on the data source you can login to nue and navigate to settings > business objects, and see a list of objects in nue for any object in the list, if salesforce api name is not empty, the object also has salesforce as the data source graphql endpoints nue exposes two graphql endpoints each query is sent to the endpoint that owns the object you are querying service endpoint data source use it for cpq post https //api nue io/async/graphql connected salesforce org product catalog, pricing, quotes, orders, and pipeline objects order post https //api nue io/orders/async/graphql nue cloud services (aws) customers, subscriptions, billing, and post sale objects both endpoints accept the same request shape — a json body with a query string (and optional variables ) — and the same nue api key authentication see api keys docid\ s0dr69bk1jr0up9cimrgp for how to authenticate supported objects you can query the following objects cpq objects are served from the connected salesforce org; order objects are served from nue's cloud services on aws, which offer significantly improved performance cpq objects — https //api nue io/async/graphql product , productoption , productfeature , feature , bundlesuite , productrelationship , pricebook , uom , pricedimension , pricetier , quote , quotelineitem , order , orderproduct , opportunity , pricingplugin order objects — https //api nue io/orders/async/graphql customer , contact , relatedcustomer , entity , userprofile , subscription , asset , assetorderproduct , entitlement , invoice , invoiceitem , invoiceitemdetail , creditmemo , creditmemoitem , debitmemo , paymentapplication , paymentmethod order line items are queried as orderproduct (not orderitem ) to discover the exact fields, filters, and picklist values available on any object, use schema introspection (described later on this page) generate graphql query login to nue, and navigate to the settings, and search with keyword ‘graph’ and select the result ‘graphql generator’ the graphql generator will be automatically launched in the graphql generator, you can select a number of fields, and create filters if necessary the fields and filtering conditions will be automatically generated as part of the graphql query once you are ready, you can click ‘copy to clipboard’ for example, the following graphql query is generated to find all active, non bundle, standalone products query { product(where { and \[{configurable { eq false}}, {status { eq "active"}}]}) { autorenew ruby productcost c billingperiod billingtiming bundletemplate configurable createdbyid createddate defaultrenewalterm defaultsubscriptionterm defaultuomid description enddate freetrialtype freetrialunit id imageurl lastmodifiedbyid lastmodifieddate longdescription name pricebookid pricemodel productcategory recordtype referenceproductid showincludedproductoptions sku soldindependently startdate status } } run graphql query for objects in nue on salesforce almost all objects should be accessible by querying salesforce the below example shows how to query products { "name" "query products", "method" "post", "url" "https //api nue io/async/graphql", "description" "query product details", "tab" "examples", "examples" { "languages" \[ { "id" "sojvaugsvrhlmpz40cqp8", "language" "graphql", "code" "query {\n product(where {\n and \[\n { configurable { eq false } },\n { status { eq \\"active\\" } }\n ]\n }) {\n autorenew\n billingperiod\n billingtiming\n bundletemplate\n configurable\n createdbyid\n createddate\n defaultrenewalterm\n defaultsubscriptionterm\n defaultuomid\n description\n enddate\n freetrialtype\n freetrialunit\n id\n imageurl\n lastmodifiedbyid\n lastmodifieddate\n longdescription\n name\n pricebookid\n pricemodel\n productcategory\n recordtype\n referenceproductid\n showincludedproductoptions\n sku\n soldindependently\n startdate\n status\n }\n}", "customlabel" "" } ], "selectedlanguageid" "sojvaugsvrhlmpz40cqp8" }, "results" { "languages" \[ { "id" "hewinwm1 xhlktidf7mvt", "language" "200", "customlabel" "", "code" "{\n \\"data\\" {\n \\"product\\" \[\n {\n \\"autorenew\\" false,\n \\"billingperiod\\" null,\n \\"billingtiming\\" \\"in advance\\",\n \\"bundletemplate\\" \\"advanced\\",\n \\"configurable\\" false,\n \\"createdbyid\\" \\"005ql00000lrebayab\\",\n \\"createddate\\" \\"2025 05 29t23 19 23z\\",\n \\"defaultrenewalterm\\" null,\n \\"defaultsubscriptionterm\\" null,\n \\"defaultuomid\\" \\"a0sql0000063afkyau\\",\n \\"description\\" null,\n \\"enddate\\" null,\n \\"freetrialtype\\" \\"days\\",\n \\"freetrialunit\\" null,\n \\"id\\" \\"01tql00000ds0dvyat\\",\n \\"imageurl\\" null,\n \\"lastmodifiedbyid\\" \\"005ql00000lrebayab\\",\n \\"lastmodifieddate\\" \\"2025 05 29t23 19 23z\\",\n \\"longdescription\\" null,\n \\"name\\" \\"ondemand cash credit\\",\n \\"pricebookid\\" null,\n \\"pricemodel\\" \\"credit\\",\n \\"productcategory\\" \\"physicalgoods\\",\n \\"recordtype\\" \\"product\\",\n \\"referenceproductid\\" null,\n \\"showincludedproductoptions\\" false,\n \\"sku\\" \\"ondemand cash credit\\",\n \\"soldindependently\\" true,\n \\"startdate\\" \\"2021 12 01\\",\n \\"status\\" \\"active\\"\n }\n ]\n }\n}" }, { "id" "oeltgto6oofwvad1x3oy5", "language" "404", "customlabel" "", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n}" } ], "selectedlanguageid" "hewinwm1 xhlktidf7mvt" }, "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "name" "parameter name", "kind" "required", "type" "string", "description" "nue api key", "" "required" } ], "formdataparameters" \[], "bodydataparameters" \[ { "name" "parameter name", "kind" "optional", "type" "string", "description" "", "children" \[] } ] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" }, "hastryitout" true, "autogeneratedanchorslug" "query products", "legacyhash" "2uxntvyrh9xo ahn 5ey3" } curl location request post 'https //api nue io/async/graphql' \\ \ header 'apiaccesskey {{apiaccesskey}}' \\ \ header 'authorization bearer {{accesstoken}}' \\ \ header 'content type application/json' \\ \ data raw '{"query" "query {\n product(where { and \[{configurable { eq false}}, {status { eq \\"active\\"}}]}) {\n autorenew\n ruby productcost c\n billingperiod\n billingtiming\n bundletemplate\n configurable\n createdbyid\n createddate\n defaultrenewalterm\n defaultsubscriptionterm\n defaultuomid\n description\n enddate\n freetrialtype\n freetrialunit\n id\n imageurl\n lastmodifiedbyid\n lastmodifieddate\n longdescription\n name\n pricebookid\n pricemodel\n productcategory\n recordtype\n referenceproductid\n showincludedproductoptions\n sku\n soldindependently\n startdate\n status\n }\n}\n","variables" {}}' run graphql query for objects in nue on aws order objects — such as customers, contacts, subscriptions, invoices, credit memos, assets, and entitlements — are queried from nue's cloud services on aws using the https //api nue io/orders/async/graphql endpoint, which offers significantly improved performance and speeds the example below shows how to query subscriptions { "name" "query subscriptions", "method" "post", "url" "https //api nue io/orders/async/graphql", "description" "query subscription details", "tab" "examples", "examples" { "languages" \[ { "id" "sojvaugsvrhlmpz40cqp8", "language" "graphql", "code" "query {\n product(where {\n and \[\n { configurable { eq false } },\n { status { eq \\"active\\" } }\n ]\n }) {\n autorenew\n billingperiod\n billingtiming\n bundletemplate\n configurable\n createdbyid\n createddate\n defaultrenewalterm\n defaultsubscriptionterm\n defaultuomid\n description\n enddate\n freetrialtype\n freetrialunit\n id\n imageurl\n lastmodifiedbyid\n lastmodifieddate\n longdescription\n name\n pricebookid\n pricemodel\n productcategory\n recordtype\n referenceproductid\n showincludedproductoptions\n sku\n soldindependently\n startdate\n status\n }\n}", "customlabel" "" } ], "selectedlanguageid" "sojvaugsvrhlmpz40cqp8" }, "results" { "languages" \[ { "id" "hewinwm1 xhlktidf7mvt", "language" "200", "customlabel" "", "code" "{\n \\"data\\" {\n \\"product\\" \[\n {\n \\"autorenew\\" false,\n \\"billingperiod\\" null,\n \\"billingtiming\\" \\"in advance\\",\n \\"bundletemplate\\" \\"advanced\\",\n \\"configurable\\" false,\n \\"createdbyid\\" \\"005ql00000lrebayab\\",\n \\"createddate\\" \\"2025 05 29t23 19 23z\\",\n \\"defaultrenewalterm\\" null,\n \\"defaultsubscriptionterm\\" null,\n \\"defaultuomid\\" \\"a0sql0000063afkyau\\",\n \\"description\\" null,\n \\"enddate\\" null,\n \\"freetrialtype\\" \\"days\\",\n \\"freetrialunit\\" null,\n \\"id\\" \\"01tql00000ds0dvyat\\",\n \\"imageurl\\" null,\n \\"lastmodifiedbyid\\" \\"005ql00000lrebayab\\",\n \\"lastmodifieddate\\" \\"2025 05 29t23 19 23z\\",\n \\"longdescription\\" null,\n \\"name\\" \\"ondemand cash credit\\",\n \\"pricebookid\\" null,\n \\"pricemodel\\" \\"credit\\",\n \\"productcategory\\" \\"physicalgoods\\",\n \\"recordtype\\" \\"product\\",\n \\"referenceproductid\\" null,\n \\"showincludedproductoptions\\" false,\n \\"sku\\" \\"ondemand cash credit\\",\n \\"soldindependently\\" true,\n \\"startdate\\" \\"2021 12 01\\",\n \\"status\\" \\"active\\"\n }\n ]\n }\n}" }, { "id" "oeltgto6oofwvad1x3oy5", "language" "404", "customlabel" "", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n}" } ], "selectedlanguageid" "hewinwm1 xhlktidf7mvt" }, "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "name" "parameter name", "kind" "required", "type" "string", "description" "nue api key", "" "required" } ], "formdataparameters" \[], "bodydataparameters" \[ { "name" "parameter name", "kind" "optional", "type" "string", "description" "", "children" \[] } ] }, "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" }, "hastryitout" true, "autogeneratedanchorslug" "query subscriptions", "legacyhash" "oxo0klxnbln6isbwqf08p" } curl location request post 'https //api nue io/orders/async/graphql' \\ \ header 'apiaccesskey {{apiaccesskey}}' \\ \ header 'authorization bearer {{accesstoken}}' \\ \ header 'content type application/json' \\ \ data raw '{"query" "query subscription {\n subscription {\n actualsubscriptionterm\n autorenew\n billcycleday\n billcyclestartmonth\n billingaccountid\n billingperiod\n billingtiming\n bundled\n cancellationdate\n createdbyid\n createddate\n customerid\n defaultpaymentmethodid\n description\n entityid\n evergreen\n externalid\n externalname\n firstfullcreditperiodstartdate\n freetrialconversiondate\n id\n includedunits\n lastmodifiedbyid\n lastmodifieddate\n lastversionedsubscriptionid\n listprice\n name\n orderondate\n orderproductid\n originalsubscriptionid\n originalsubscriptionnumber\n parentid\n parentobjecttype\n pricebookentryid\n pricebookid\n productid\n quantity\n reconfigureeffectivedate\n renewalterm\n rootid\n salesprice\n status\n subscriptioncompositeid\n subscriptionenddate\n subscriptionlevel\n subscriptionstartdate\n subscriptionterm\n subscriptionversion\n taxamount\n tcv\n todayarr\n todaycmrr\n todaysquantity\n totalacv\n totalamount\n totalprice\n totaltcv\n uomid\n }\n}"}' filtering results every object collection accepts a where argument combine conditions with the boolean operators and and or , and match individual fields with operators such as eq , neq , like , in , gt , gte , lt , and lte query { customer( where { and \[ { status { eq "active" } }, { name { like "%acme%" } } ] } ) { id name status } } graphql automatically restricts filtering and sorting to fields that are marked as filterable and sortable for each object — no extra configuration is required pagination and record limits use the page argument to control how many records are returned and where the result set starts query { invoice( where { status { eq "posted" } } page { cursor 0, limit 50 } ) { id status amount } } a single query returns a maximum of 100 records if you request limit greater than 100, it is clamped to 100 to page through a larger result set, increase cursor (for example cursor 0 , then cursor 100 , and so on) while keeping the same where filter when a result is capped at 100 records, the response includes a truncation signal so you know more records may exist { "status" "success", "data" { "result" { "invoice" \[ " 100 records " ] }, "truncated" true, "truncationmessage" "returned 100 records more matching records may exist please refine your search criteria " } } if you see truncated true , add or tighten your where filter (or page through with cursor ) to retrieve the remaining records filtering high volume objects customer and contact can hold very large numbers of records always include a where filter when querying them so results stay fast and within the 100 record cap query { customer( where { name { like "%acme%" } } page { cursor 0, limit 25 } ) { id name } } a broad, unfiltered query against a high volume object can return a very large or truncated result set adding at least one filter (such as name , status , or createddate ) keeps the query efficient and the answer complete schema introspection the graphql endpoints support standard introspection, so you can discover the available objects, fields, relationships, and enum values directly from the api instead of relying on hardcoded assumptions list every available type query { schema { types { name kind } } } inspect the fields of a specific object (here, customer ) query { type(name "customer") { fields { name type { name kind } } } } send introspection queries to the endpoint that owns the object — /async/graphql for cpq objects and /orders/async/graphql for order objects related guides graphql relationship traversal docid\ vemqp0s7ggc4wyrgylgcp — query nested and reverse relationships in a single round trip graphql aggregations docid\ wxok4pxgwzyfbo4ici2zl — count , sum , avg , min , max , and groupby rollups querying nue with natural language docid\ fx1sinxmvaq9xuyydlcwn — let an ai agent build and run these queries for you across services