This Python package uses PyPi packages requests and zeep to interact with the Planon SOAP API.
The SOAP methods available are heavily based on what the Planon BO supports, some BOMs are not supported in SOAP out of the box. The SOAP API must be configured, the Java code generated and compiled, and then the results jar deployed to the Planon Axis2 service. For more information on configuring web services see Planon's web services documentation.
python -m venv venv
source venv/bin/activate
pip install ./libplanon
soap_url = "{{PLANON_FQDN}}/nyx/services"
user = "USER"
pwd = "PWD"
get_token = libplanon.TokenManager(url=soap_url, username=user, password=pwd, reference_date=None).get_token
pln_client = libplanon.APIManager(url=soap_url, services=['AccountGroup', 'Account', 'Person'])
pln_account_client = pln_client['Account']
pln_group_client = pln_client['AccountGroup']
pln_person_client = pln_client['Person']
code = "ABC123"
# Find by filter
group_ids = pln_group_client.find(get_token(), {
'fieldFilters': [{
'fieldName': 'Code',
'filterValue': code,
'operator': 'equals'
}]
})
# Find all
group_ids = pln_group_client.find(get_token(), {})
groups = []
for group_id in group_ids:
groups.append(pln_group_client.read(get_token(), group_id))
group = groups[0]
group['Name'] = "Hello World!"
pln_group_client.save(get_token(), group))