Example GraphQL queries for Customers
Less than to read
- First five customers sorted by code in ascending order, with pagination
- First five customers sorted by code in ascending order, after specified cursor value (obtained from previous query)
- Customer detail from country name on the billing address
- Read the default values for a dedicated customer category
- Read the last customer transaction for a dedicated customer
First five customers sorted by code in ascending order, with pagination
{
sage {
x3BusinessPartners {
customer(orderBy: "{ code: 1 }", first: 5) {
edges {
node {
code
companyName
}
cursor
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
First five customers sorted by code in ascending order, after specified cursor value (obtained from previous query)
{
sage {
x3BusinessPartners {
customer(orderBy: "{ code: 1 }", first: 5, after : "[\"AO005\"]#40") {
edges {
node {
code
companyName
}
cursor
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
Customer detail from country name on the billing address
{
sage {
x3BusinessPartners {
customer (filter: "{ billToCustomer: { billToCustomerAddress: {countryName :{ $in: ['Australia', 'France'] } } }} "){
edges {
node {
code
companyName
shortCompanyName
category {
code
mustPrintAcknowledgment
}
customerType
billToCustomer {
code
companyName
shortCompanyName
customerType
billToCustomerAddress {
entityType
entity
address
description
defaultBankId
isDefault
city
countryName
fax
cellPhone
externalIdentifier
website
isValid
federalId
exportNumber
}
payByCustomerAddress {
entityType
entity
address
description
defaultBankId
isDefault
city
countryName
fax
cellPhone
externalIdentifier
website
isValid
federalId
exportNumber
}
}
}
}
}
}
}
}
Read the default values for a dedicated customer category
{
sage {
x3BusinessPartners {
customerCategory(filter: "{code : 'US'}") {
edges {
node {
code
localizedDescription
localizedShortDescription
creationMethod
country {
code
}
language {
code
}
creditControl
authorizedCreditAmount
accountingCode
paymentTermCode
taxRuleCode
invoicingTerm
currency {
code
}
customerStatisticalGroups {
edges {
node {
value {
glossaryId {
glossaryId
}
code
}
}
}
}
percentageOrAmountOfInvoicingElements
analyticalDimensions {
edges {
node {
type {
code
}
value {
code
}
}
}
}
}
}
}
}
}
}
Read the last customer transaction for a dedicated customer
{
sage {
x3BusinessPartners {
lastCustomerTransaction(filter: "{customer : 'FR001', company : 'FR10'}") {
edges {
node {
customer {
code
companyNames
}
customerTransactionType
customerInformationType
documentNumber
documentDate
amount
currency {
code
}
}
}
}
}
}
}