Skip to content
Developer home
X3

Example GraphQL queries for Suppliers

  Less than to read

Read suppliers with their addresses

{
  sage {
    x3BusinessPartners {
      supplier(filter: "{supplierType: 'normal'}") {
        edges {
          node {
            code
            companyName
            shortCompanyName
            supplierType
            isActive
            businessPartners {
              edges {
                node {
                  code
                  companyNames
                  addresses {
                    edges {
                      node {
                        address
                        city
                        country {
                          code
                        }
                        cellPhone
                      }
                    }
                  }
                  country {
                    code
                  }
                  taxIdNumber
                  language {
                    code
                  }
                }
              }
            }
            ourCustomerNameForSupplier
            defaultContact
            supplierABCClass
            unavailablePeriod
          }
        }
      }
    }
  }
}

Try it on our demo endpoint

Read suppliers with their statistical groups and invoicing elements

{
  sage {
    x3BusinessPartners {
      supplier(filter: "{isActive: true}") {
        edges {
          node {
            code
            companyName
            shortCompanyName
            supplierType
            isActive
            businessPartners {
              edges {
                node {
                  code
                  companyNames
                  addresses {
                    edges {
                      node {
                        address
                        city
                        country {
                          code
                        }
                        cellPhone
                      }
                    }
                  }
                  country {
                    code
                  }
                  taxIdNumber
                  language {
                    code
                  }
                }
              }
            }
            invoicingElements {
              edges {
                node {
                  percentageOrAmount
                  invoicingElement {
                    code
                  }
                }
              }
            }
            statisticalGroups {
              edges {
                node {
                  value {
                    code
                  }
                }
              }
            }
            ourCustomerNameForSupplier
            defaultContact
            supplierABCClass
            unavailablePeriod
          }
        }
      }
    }
  }
}

Try it on our demo endpoint

Read all supplier transaction amounts for a dedicated supplier and a company

{
  sage {
    x3BusinessPartners {
      supplierTransaction(filter: "{supplier : 'FR051', company : 'FR10'}") {
        edges {
          node {
            supplier {
              code
            }
            riskSupplier {
              code
            }
            company {
              code
            }
            currency {
              code
            }
            onOrderTaxIncluded
            deliveredNotInvoicedTaxIncluded
            invoicedNotPosted
            accountingBalance
            drafts
          }
        }
      }
    }
  }
}

Try it on our demo endpoint

Read last supplier transactions for a dedicated supplier

{
  sage {
    x3BusinessPartners {
      lastSupplierTransaction(filter: "{supplier : 'FR051', company : 'FR10'}") {
        edges {
          node {
            supplier {
              code
              companyNames
            }
            supplierTransactionType
            supplierInformationType
            documentNumber
            documentDate
            amount
            currency {
              code
            }
          }
        }
      }
    }
  }
}

Try it on our demo endpoint

Read default values for a dedicated supplier category

{
  sage {
    x3BusinessPartners {
      supplierCategory(filter: "{code : 'US'}") {
        edges {
          node {
            code
            localizedDescription
            localizedShortDescription
            creationMethod
            country {
              code
            }
            language {
              code
            }
            creditControl
            authorizedCreditAmount
            accountingCode
            paymentTermCode
            taxRuleCode
            currency {
              code
            }
            supplierStatisticalGroups {
              edges {
                node {
                  value {
                    glossaryId {
                      glossaryId
                    }
                    code
                  }
                }
              }
            }
            invoicingElements {
              edges {
                node {
                  invoicingElement {
                    code
                  }
                  type
                  percentageOrAmount
                }
              }
            }
            analyticalDimensions {
              edges {
                node {
                  type {
                    code
                  }
                  value {
                    code
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Try it on our demo endpoint