Developers
Read your PackChain data from other systems.
A read-only API for customers: connect a reporting tool, a spreadsheet or your own system to your organisation's records. A key reads one organisation and can never change anything.
Start in three steps
- 1Get a keyPackChain makes a key for each system you connect. It is shown once, so store it safely.
- 2Send it with every requestIn the Authorization header. Never put it in a web page or an address.
- 3Read, then keep in stepRead everything once, then ask only for what changed since your last read.
The address
https://packchain.co.zw/api/v1
A first request
curl -H "Authorization: Bearer pck_your_key" https://packchain.co.zw/api/v1/farms
{
"data": [ { "id": "north-farm", "name": "North Farm" } ],
"has_more": false
}What you can read
| Resource | What it is | Typical fields |
|---|---|---|
/farms | The organisation's farms | id, name |
/blocks | Farm blocks from the master file | id, name, section, variety, plants, farm_id |
/receiving | Fruit receiving batches | batch number, block, variety, weights, date |
/work-orders | Packing work orders | work order number, customer, pack type, status |
/pallets | Pallets | pallet number, cartons, status, customer |
/loading-notes | Loading notes (dispatch) | docket, customer, vehicle, pallets |
Every record also carries internal_id (a number that never changes), farm_id, created_at and updated_at. People, pay and settings cannot be read through the API.
Options
| Option | What it does | Example |
|---|---|---|
farm | Only one farm. The ids come from /farms. | ?farm=north-farm |
since | Only records changed after this moment. | ?since=2026-11-01T00:00:00Z |
limit | Records per page: 1 to 1,000. Normally 200. | ?limit=500 |
after | Continue after this internal_id (the next_after of the page before). | ?after=18250 |
Reading page by page
Records come oldest first. When a page says "has_more": true, ask again with after set to its next_after, until has_more is false.
GET https://packchain.co.zw/api/v1/receiving?limit=500
GET https://packchain.co.zw/api/v1/receiving?limit=500&after=18250
Keeping in step
After the first full read, note the time you started it. Next time, send that time as since to receive only what was added or changed. A record that changed arrives again with the same internal_id, so replace your copy.
GET https://packchain.co.zw/api/v1/pallets?since=2026-11-13T06:00:00ZWhen something is refused
Every refusal is JSON with an error and a plain message.
| Status | Error | Why |
|---|---|---|
| 400 | bad_request | A query option is not valid. The message says which one. |
| 401 | unauthorized | The key is missing, wrong or revoked. |
| 403 | paused | The organisation's subscription is paused. Its keys work again when it is resumed. |
| 404 | not_found | There is no such resource, or the key has no farm with that id. |
| 405 | method_not_allowed | The API is read-only: use GET. |
| 429 | rate_limited | More than 120 calls in a minute with this key. Wait a minute. |
Limits and care of keys
- 120 calls a minute for each key.
- One key for each system, so one can be replaced without stopping the others.
- Keep keys on your server, never in a web page or a phone app.
- If a key may have leaked, tell us and we revoke it at once.
Want to connect a system?
Tell us what should read your data and we will set up a key.