Vendors

Creating a Vendor

This shows how to create a new vendor associated with your company.

1# main.py
2
3vendor_name = f"Sample SDK Vendor {time_now}"
4vendor_erp_id = f"VND-SDK-{time_now}"
5
6new_vendor = client.vendors.post_vendors_root(
7 ottimate_company_id=ottimate_company_id,
8 name=vendor_name,
9 erp_vendor_id=vendor_erp_id,
10)
11ottimate_vendor_id = new_vendor.vendor.get("id")

Fetching Vendors

Fetching all vendors:

1# Fetch all the vendors
2all_vendors = client.vendors.get_vendors_root(ottimate_company_id=ottimate_company_id)
3for vendor in all_vendors.vendors:
4 print(f" - Vendor: {vendor.name} (ID: {vendor.id}) ERP Vendor ID - {vendor.erp_vendor_id}")

Fetching a specific vendor:

1# Fetch specfic vendor by ID
2vendor = client.vendors.get_vendors_id(id=<>)