Skip to content
Developer home
X3

Example GraphQL queries for Sales Representatives

  Less than to read

First five sales representatives sorted by code in ascending order

{
  sage {
    x3BusinessPartners {
      salesRep(orderBy: "{ code: 1  }", first: 5) {
        totalCount
        edges {
          node {
            code
            name
            commissionBase
            commissionFormulaForSalesRep1 {
              formulaType
              formula
            }
            commissionFormulaForSalesRep2 {
              formulaType
              formula
            }
            accountingCode
            numberOfLateCalls
            user {
              code
            }
            currency {
              code
            }
            defaultAddress {
              entityType
              entity
              address
              description
              defaultBankId
              isDefault
              city
              countryName
              fax
              cellPhone
              externalIdentifier
              website
              isValid
              federalId
            }
            businessPartners {
              edges {
                node {
                  code
                  isActive
                  companyNames
                  shortCompanyName
                  europeanUnionVatNumber
                }
              }
            }
          }
        }
      }
    }
  }
}

Try it on our demo endpoint

First five sales representative from specific country

{
  sage {
    x3BusinessPartners {
      salesRep(filter: "{ defaultAddress: { countryName: {$eq: 'Australia'}   }}", first: 5) {
        edges {
          node {
            code
            name
            commissionBase
            commissionFormulaForSalesRep1 {
              formulaType
              formula
            }
            commissionFormulaForSalesRep2 {
              formulaType
              formula
            }
            accountingCode
            numberOfLateCalls
            user {
              code
            }
            currency {
              code
            }
            defaultAddress {
              entityType
              entity
              address
              description
              defaultBankId
              isDefault
              city
              countryName
              fax
              cellPhone
              externalIdentifier
              website
              isValid
              federalId
            }
            businessPartners {
              edges {
                node {
                  code
                  isActive
                  companyNames
                  shortCompanyName
                  europeanUnionVatNumber
                }
              }
            }
          }
        }
      }
    }
  }
}

Try it on our demo endpoint