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
| Field | Type | Notes |
|---|---|---|
number | String! | Unique reference code within the company |
name | String! | Supplier name |
countryId | Int! | 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:
| Field | Description |
|---|---|
paymentMethodId | Default payment method |
maturityDateId | Default payment terms |
deliveryMethodId | Default delivery method |
discount | Global discount percentage |
creditLimit | Credit limit for purchases |
taxes | Default taxes for this supplier's documents |
exemptionReason | VAT exemption reason code |
notesOnDocs | Whether to include documentNotes on every document |
documentNotes | Text 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 }
}
}
Related documents
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
- Customers: Manage your customer contacts
- Salespersons: Manage sales staff
- Creating an Invoice: Create documents for customers
- Filtering, Search & Ordering: Filter and search supplier lists