SupplierLoad
Read and write supplier records. A supplier has a tree of children: locations, each with addresses and bank accounts.
Supplier
└── locations[]
├── addresses[]
└── bank_accounts[]
Import
from lib.objects.supplier import SupplierLoad
Standard methods (from BaseLoad)
load.get_all(), load.search(...), load.new(), load.save_all(),
load.delete_where(...), obj.save(), obj.delete(),
obj.deactivate(). See baseload.md.
Supplier fields
| Field | Type | Required | Notes |
|---|---|---|---|
supplier_id | str (UUID) | (assigned by server) | Internal supplier id |
supplier_number | str | yes | Your stable external id — natural key, what upserts match on |
supplier_name | str | yes | |
alternative_supplier_name | str | ||
supplier_type | str | Free-form; e.g. VENDOR, EMPLOYEE | |
organization_code | str | References organization.code — save organizations first | |
is_active | bool | Defaults to true on new | |
custom_field_1..5 | str | Five user-defined slots |
SupplierLocation fields
| Field | Type | Required |
|---|---|---|
supplier_location_id | str (UUID) | (assigned) |
location_code | str | yes |
location_name | str | |
organization_code | str | |
default_currency_code | str | |
default_payment_term_code | str | |
default_payment_method | str | |
taxpayer_id | str | |
duns_number | str | |
is_active | bool | |
custom_field_1..5 | str |
SupplierAddress fields
street, city, state, postal_code, country_code,
custom_field_1..3.
SupplierBankAccount fields
bank_name, bank_branch, bank_account_number,
bank_routing_number, swift_code, account_currency, is_primary,
custom_field_1..3.
Building a supplier graph
load = SupplierLoad(context)
s = load.new()
s.supplier_number = 'SUP-100'
s.supplier_name = 'Acme Co'
loc = s.new_location()
loc.location_code = 'MAIN'
loc.default_currency_code = 'EUR'
addr = loc.new_address()
addr.street = '1 Main St'
addr.city = 'Amsterdam'
addr.country_code = 'NL'
bank = loc.new_bank_account()
bank.bank_account_number = 'NL91ABNA0417164300'
bank.swift_code = 'ABNANL2A'
bank.is_primary = True
load.save_all()
Replace-the-world (full load)
If your connector is the source of truth and you've fetched the complete supplier list from the ERP:
for ext in fetch_all_suppliers_from_erp():
s = load.new()
s.supplier_number = ext['number']
s.supplier_name = ext['name']
# ... locations, addresses, banks ...
load.save_all(full_load=True) # truncates THIS customer's suppliers first
If you're doing an incremental sync, leave full_load off. The default
upserts on supplier_number.
Search
# Returns a list (auto-paginates)
matches = load.search(supplier_name='Acme')
# Or stream
for s in load.get_all(supplier_type='VENDOR'):
process(s)
Soft-delete by filter
# Mark deleted everything not updated since 2024
load.delete_where(
parameters=[{'updated_before_date': '2025-01-01'}],
action='delete',
)
# Deactivate two specific suppliers
load.delete_where(
parameters=[
{'supplier_number': 'SUP-X'},
{'supplier_number': 'SUP-Y'},
],
action='deactivate',
)