_manage-suppliers
Retrieve supplier
Call our List suppliers endpoint to retrieve the full list of your customer's existing suppliers.
- TypeScript
- Python
- C#
- Go
const suppliersResponse = await payablesClient.suppliers.list({
companyId: companyId,
});
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
)
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
});
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
})
if suppliersResponse.StatusCode == 200 {
fmt.Println(suppliersResponse.Suppliers[0].SupplierName)
}
Supplier balances
Bill Pay does not expose supplier balances on the supplier endpoints. Instead, you can aggregate bills by supplier.
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: "[email protected]",
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,
})
Was this page useful?
👏
👍
🤔
👎
😭