Metadata-Version: 2.5
Name: zigotrace-partner
Version: 1.2.0
Summary: Client for the ZigoTrace Partner API: send your customers' records, read findings, propose fixes.
Project-URL: Homepage, https://agri.zigotrace.com
Author: ZigoTrace
License-Expression: MIT
License-File: LICENSE
Keywords: erp,post-harvest loss,supply chain,traceability,zigotrace
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# zigotrace-partner

The Python client for the ZigoTrace Partner API, for software vendors (ERP,
distribution, supply-chain systems) running ZigoTrace for their own customers:
send each customer's records, read the findings about lost stock, unbilled
deliveries and missing records, and get the exact record that fixes each one
to write into your system.

```
pip install zigotrace-partner
```

Python 3.10+, standard library only.

```python
from zigotrace_partner import ZigoTracePartner, ZigoTraceError, verify_webhook

zt = ZigoTracePartner("zpk_...")  # your partner key

org = zt.create_org({"name": "Kilimani Foods", "external_ref": "cust-42"})
zt.push_records(org["org_id"], "receipts", {"records": [...]}, idempotency_key="grn-001")

for finding in zt.list_findings(org["org_id"], area="receiving")["findings"]:
    print(finding["label"], finding["description"])

pdf = zt.report_pdf(org["org_id"], "gaps-summary")  # bytes
```

Every method returns the decoded JSON body (bytes for a PDF or Word report)
and raises `ZigoTraceError` with `.status` and `.detail` otherwise.

**Webhooks.** Check each delivery before trusting it:

```python
if not verify_webhook(webhook_secret, raw_body, request.headers["Zigo-Signature"]):
    return 400
```

The package version is the API version it was generated from. Partner keys
and access: [agri.zigotrace.com](https://agri.zigotrace.com).
