Moloni ON Logo WhiteGuidesAPI ReferenceExplorer
Guides

Suppliers

Suppliers are the counterparties you purchase from, and supplier documents (supplier invoices, purchase orders, supplier receipts, etc.) are issued by or associated with suppliers.

Required fields

FieldTypeNotes
numberString!Unique reference code within the company
nameString!Supplier name
countryIdInt!The supplier's country

Creating a supplier

mutation {
  supplierCreate(
    companyId: 1
    data: {
      number: "S001"
      name: "ACME Supplies Lda"
      vat: "987654321"
      countryId: 1
      email: "invoices@acmesupplies.com"
      phone: "+351 210 000 001"
      address: "Rua Fornecedor, 10"
      city: "Porto"
      zipCode: "4000-001"
    }
  ) {
    data {
      supplierId
      number
      name
      vat
    }
    errors { field msg }
  }
}

Billing defaults

Like customers, suppliers can have billing preferences that are pre-filled on supplier documents:

FieldDescription
paymentMethodIdDefault payment method
maturityDateIdDefault payment terms
deliveryMethodIdDefault delivery method
discountGlobal discount percentage
creditLimitCredit limit for purchases
taxesDefault taxes for this supplier's documents
exemptionReasonVAT exemption reason code
notesOnDocsWhether to include documentNotes on every document
documentNotesText printed on every supplier document

Getting a supplier

query {
  supplier(companyId: 1, supplierId: 10) {
    data {
      supplierId
      number
      name
      vat
      email
      phone
      address
      city
      country { name }
      paymentMethod { name }
      maturityDate { name }
      taxes {
        tax { name value }
      }
    }
    errors { field msg }
  }
}

Listing and searching suppliers

query {
  suppliers(
    companyId: 1
    options: {
      search: { field: ALL, value: "ACME" }
      pagination: { page: 1, qty: 20 }
      order: { field: name, sort: ASC }
    }
  ) {
    data {
      supplierId
      number
      name
      vat
      email
    }
    options {
      pagination { page qty count }
    }
  }
}

Updating a supplier

Only the fields you send are updated. supplierId is required:

mutation {
  supplierUpdate(
    companyId: 1
    data: {
      supplierId: 10
      email: "new@acmesupplies.com"
      creditLimit: 10000.00
    }
  ) {
    data {
      supplierId
      email
      creditLimit
    }
    errors { field msg }
  }
}

Deleting suppliers

Accepts an array of IDs. Suppliers referenced by existing documents cannot be deleted, so check the deletable field first:

mutation {
  supplierDelete(companyId: 1, supplierId: [10, 11]) {
    status
    deletedCount
    elementsCount
    errors { field msg }
  }
}

Retrieve all purchase documents associated with a supplier:

query {
  getSupplierRelatedDocuments(
    companyId: 1
    supplierId: 10
    options: {
      pagination: { page: 1, qty: 20 }
    }
  ) {
    data {
      documentId
      documentTypeId
      number
      date
      totalValue
      status
    }
    options {
      pagination { page qty count }
    }
  }
}

Next steps

© 2026 Moloni ON

Tax Authority Certificate No. 3075