Licensees
A licensee is one of your customers using AddressZen through your key. Sub-licensing lets a platform serve many customers from one account and one bill while tracking each customer's usage separately.
Your key must be enabled for sub-licensing; contact us to switch one over. Every licensee method needs a Management Key. The sub-licensing guide covers billing.
Create a licensee
Call create_licensee with the customer's name and address. The new licensee's own key, beginning sl_, is in key.
import os
from addresszen import AddressZen
with AddressZen(os.environ["ADDRESSZEN_API_KEY"]) as client:
licensee = client.create_licensee(
"ak_test",
user_token=os.environ["ADDRESSZEN_MANAGEMENT_KEY"],
name="Example Inc",
address="1010 Cauthen Ln, Alamogordo, NM",
postcode="88310",
)
print(licensee.key)
postcode takes the customer's ZIP or postal code, whatever their country.
List licensees
list_licensees returns 10 per call, or up to 100 with limit, oldest first. Canceled licensees are left out. query filters by name. For the next page, pass the last licensee's id as starting_after.
Update or cancel a licensee
Pass your key and the licensee's sl_ key:
update_licenseechanges the address, ZIP or postal code, allowed URLs (whitelist) or daily limit. The name cannot change after creationregenerate_licensee_keyissues a newsl_key and stops the old one immediatelydelete_licenseecancels the licensee and stops its key. Contact us to undo it
Pass licensee to key_usage or key_logs to report one licensee's usage.