Manage suppliers
View, create, and update suppliers using Sync for Payables
Overview
In accounts payable, each bill is associated with a supplier. The supplier represents a business or a sole trader that provides goods or services to your SMB customer.
Their records also contain key information, such as contact details, that can be used to notify the supplier once a payment is made.
To pay a bill in Sync for Payables, you can use your customer's existing supplier or create a new one. We have highlighted this alternative sequence of steps in our detailed process diagram below.
Detailed process diagram
Retrieve supplier
Call our List suppliers endpoint to retrieve the full list of your customer's existing suppliers. You can also use query parameters to narrow down the list of results, for example:
status=Active
returns only active suppliers.defaultCurrency=USD
returns suppliers that provide goods or services in dollars.supplierName=Acme
returns suppliers with a name that matches the query.
- TypeScript
- Python
- C#
- Go
const suppliersResponse = await payablesClient.suppliers.list({
companyId: companyId,
query: 'status=Active&&defaultCurrency=USD'
});
if(suppliersResponse.statusCode != 200){
throw new Error("Could not get current suppliers")
}
console.log(suppliersResponse.suppliers[0].supplierName)
suppliers_request = operations.ListSuppliersRequest(
company_id=company_id,
query='status=Active&&defaultCurrency=USD'
)
suppliers_response = payables_client.suppliers.list(suppliers_request)
if suppliers_response.status_code != 200:
raise Exception('Could not get current suppliers')
print(suppliers_response.suppliers[0].supplier_name)
var suppliersResponse = await payablesClient.Suppliers.ListAsync(new() {
CompanyId = companyId,
Query = "status=Active&&defaultCurrency=USD"
});
if(suppliersResponse.StatusCode != 200){
throw new Exception("Could not get current suppliers");
}
Console.WriteLine(suppliersResponse.Suppliers[0].SupplierName);
ctx := context.Background()
suppliersResponse, err := payablesClient.Suppliers.List(ctx,
operations.ListSuppliersRequest{
CompanyID: companyID,
Query: "status=Active&&defaultCurrency=USD",
})
if suppliersResponse.StatusCode == 200 {
fmt.Println(suppliersResponse.Suppliers[0].SupplierName)
}
Sync for Payables does not expose supplier balances on the supplier endpoints. Instead, you can:
- Aggregate bills by supplier
- Use the Aged debtors report
Create supplier
When your customer's company does business with a new supplier for the first time, you will need to create a supplier before creating a bill against that supplier. Use the Create supplier endpoint to do that.
- TypeScript
- Python
- C#
- Go
const supplierCreateResponse = await payablesClient.suppliers.create({
supplier: {
supplierName: "Kelly's Industrial Supplies",
contactName: "Kelly's Industrial Supplies",
emailAddress: "sales@kellysupplies.com",
status: SupplierStatus.Active,
},
companyId: companyId,
connectionId: connectionId,
});
supplier_create_request = operations.CreateSupplierRequest(
supplier=shared.Supplier(
supplier_name="Kelly's Industrial Supplies",
contact_name="Kelly's Industrial Supplies",
status=shared.SupplierStatus.ACTIVE,
),
company_id=company_id,
connection_id=connection_id,
)
supplier_create_response = payables_client.suppliers.create(req)
var supplierCreateResponse = await payablesClient.Suppliers.CreateAsync(new() {
Supplier = new Supplier() {
SupplierName = "Kelly's Industrial Supplies",
ContactName = "Kelly's Industrial Supplies",
Status = SupplierStatus.Active,
},
CompanyId = companyId,
ConnectionId = connectionId,
});
ctx := context.Background()
supplierCreateResponse, err := payablesClient.Suppliers.Create(ctx, operations.CreateSupplierRequest{
Supplier: &shared.Supplier{
SupplierName: syncforpayables.String("Kelly's Industrial Supplies"),
ContactName: syncforpayables.String("Kelly's Industrial Supplies"),
Status: shared.SupplierStatusActive,
},
CompanyID: companyID,
ConnectionID: connectionID,
})
Update supplier
If your customer's existing supplier changes address or business name, you can reflect this change in their accounting software using the Update supplier endpoint.
- TypeScript
- Python
- C#
- Go
const supplierUpdateResponse = await payablesClient.suppliers.update({
supplier: {
supplierName: "Kelly's Industrial Supplies",
contactName: "Kelly's Industrial Supplies",
emailAddress: "sales@kellysupplies.com",
phone: "(877) 492-8687"
status: SupplierStatus.Active,
},
companyId: companyId,
connectionId: connectionId,
supplierId: supplierCreateResponse.supplier.id
});
supplier_update_request = operations.UpdateSupplierRequest(
supplier=shared.Supplier(
supplier_name="Kelly's Industrial Supplies",
contact_name="Kelly's Industrial Supplies",
phone="(877) 492-8687",
status=shared.SupplierStatus.ACTIVE,
),
company_id=company_id,
connection_id=connection_id,
supplier_id=supplier_create_response.supplier.id
)
supplier_update_response = payables_client.suppliers.update(supplier_update_request)
var supplierUpdateResponse = await payablesClient.Suppliers.UpdateAsync(new() {
Supplier = new Supplier() {
SupplierName = "Kelly's Industrial Supplies",
ContactName = "Kelly's Industrial Supplies",
Phone = "(877) 492-8687",
Status = SupplierStatus.Active,
},
CompanyId = companyId,
ConnectionId = connectionId,
SupplierId = supplierCreateResponse.Supplier.Id
});
ctx := context.Background()
supplierCreateResponse, err := payablesClient.Suppliers.Create(ctx, operations.CreateSupplierRequest{
Supplier: &shared.Supplier{
SupplierName: syncforpayables.String("Kelly's Industrial Supplies"),
ContactName: syncforpayables.String("Kelly's Industrial Supplies"),
Phone = syncforpayables.String("(877) 492-8687"),
Status: shared.SupplierStatusActive,
},
CompanyID: companyID,
ConnectionID: connectionID,
SupplierID = supplierCreateResponse.Supplier.ID
})
You have learnt how to view, create, and update your customer's suppliers who provide them with goods and services.
Next, you can choose to manage your supplier's bills or payment methods prior to paying those bills.