Developer API
API reference, v1
The EcoGreenZest Developer API lets your systems create and read pickups, read materials, pricing, carbon and analytics, browse published marketplace listings, and receive signed webhook events. Back to the Developers overview.
Overview and base URL
Every endpoint is JSON over HTTPS. Keys belong to one organisation and every request is scoped to that organisation; no route accepts an organisation id. The examples use a placeholder host:
https://<your-api-host>Replace https://<your-api-host> with the API host for your environment. The routes below are shown with their full path, starting /api.
Keys are minted by an organisation member with the manage-members permission, so you need an organisation account. Get an API key from the ERP and API keys page in your workspace, or create your organisation account first.
Authentication
Send your key in the X-Api-Key header on every request. Keys look like egz_live_…. The header is the only supported mechanism: not the Authorization header, and never the query string. The plaintext key is shown once, when it is minted.
curl "https://<your-api-host>/api/v1/materials" \
-H "X-Api-Key: egz_live_xxxxxxxx"| Status | When |
|---|---|
401 | The key is missing, invalid, revoked or inactive. |
403 | The key is valid but does not carry the scope the route needs. |
A 403 body names the missing scope:
{"resultType":9,"successful":false,"message":"This API key does not carry the 'pickups:read' scope. Grant it when minting the key (see GET api/erp/scopes).","result":null}Scopes
Choose scopes when you mint a key. Mint a key with a blank scope list and it carries waste:write. Keys minted before scopes existed keep working with the scopes they were stored with.
| Scope | Grants |
|---|---|
waste:write(default) | Push waste data (ERP ingestion), POST /api/erp/v1/waste-data |
impact:read | Funder impact reporting, /api/impact/v1/* |
pickups:read | Read your organisation's pickups |
pickups:write | Create pickups for your organisation |
materials:read | Material catalogue with current rates |
pricing:read | Current pricing and price history |
carbon:read | Your organisation's carbon figures |
analytics:read | Network-wide anonymised aggregates |
marketplace:read | Published public marketplace listings |
Conventions
Response envelope
Every /api/v1 response uses the envelope { result, resultType, message, successful }. The samples on this page show the value of result. resultType is numeric.
| resultType | Meaning | HTTP status |
|---|---|---|
1 | Success | 200 |
3 | Validation error or other failure | 400 |
8 | Not found | 404 |
9 | Authorization error | 403 |
Versioning
Every response carries the header X-Api-Version: 1.
Paging
List endpoints take page (default 1) and pageSize (default 20, maximum 100) and return:
{"data":[],"totalCount":0,"pageSize":20,"pageNumber":1,"totalPages":0,"hasPreviousPage":false,"hasNextPage":false}Idempotency
POST /api/v1/pickups accepts an optional Idempotency-Key header (1 to 200 characters). The key is remembered for 24 hours per organisation, and only successful (2xx) responses are remembered. A replay returns the original body with the header Idempotent-Replayed: true.
Pickups
/api/v1/pickupsscope pickups:writeCreates a pickup for your organisation. It acts as the key's creator, who must still hold the request-pickup permission (otherwise 403).
| Field | Rules |
|---|---|
siteId | A site that belongs to the key's organisation. |
scheduledDate | Not in the past. |
items | 1 to 50 items. quantity > 0 and <= 1,000,000. No duplicate materialId. Every material must exist and be bookable. |
notes | Optional, at most 1000 characters. |
curl -X POST "https://<your-api-host>/api/v1/pickups" \
-H "X-Api-Key: egz_live_xxxxxxxx" \
-H "Idempotency-Key: 2f6c1d9e-order-884" \
-H "Content-Type: application/json" \
-d '{"siteId":12,"scheduledDate":"2026-10-20","notes":"gate B","items":[{"materialId":10,"quantity":25}]}'{"id":501,"siteId":12,"scheduledDate":"2026-10-20T00:00:00Z","status":"Requested","agentAssigned":false,
"estimatedAmount":3000.0,"totalAmount":3000.0,"currency":"NGN","isWeightAdjusted":false,
"createdOn":"2026-10-07T10:00:00Z","completedOn":null,"notes":"gate B",
"items":[{"materialId":10,"materialName":"PET bottles","quantity":25,"estimatedQuantity":25,"actualQuantity":null,"amount":3000.0}]}A material that cannot be priced is refused:
{"result":null,"resultType":3,"message":"material 10 cannot be booked through the API yet: no per-unit price is configured","successful":false}/api/v1/pickupsscope pickups:readLists your pickups, newest first.
| Query | Notes |
|---|---|
status | Requested, Scheduled, Assigned, InProgress, Completed or Cancelled. |
page | Default 1. |
pageSize | Default 20, maximum 100. |
curl "https://<your-api-host>/api/v1/pickups?status=Completed&page=1&pageSize=20" \
-H "X-Api-Key: egz_live_xxxxxxxx"The result is the paged shape above; each element of data has the pickup shape shown for the create call.
/api/v1/pickups/{id}scope pickups:readOne pickup, same shape as above. An unknown id, or another organisation's id, returns 404.
curl "https://<your-api-host>/api/v1/pickups/501" \
-H "X-Api-Key: egz_live_xxxxxxxx"Materials
/api/v1/materialsscope materials:readThe material catalogue with current rates. bookable is true only when a pickup can be priced today: a per-unit price, or a per-kg price with unitsPerKg above 0.
| Query | Notes |
|---|---|
categoryId | Filter by category. |
search | Free-text search. |
page | Default 1. |
pageSize | Default 20, maximum 100. |
curl "https://<your-api-host>/api/v1/materials?search=pet" \
-H "X-Api-Key: egz_live_xxxxxxxx"{"id":10,"name":"PET bottles","commonName":"Water bottles","description":null,"categoryId":1,"categoryName":"Plastic",
"measurementType":"Weight","supportsPerKg":true,"supportsPerUnit":true,"pricePerKg":120,"pricePerUnit":null,
"unitsPerKg":null,"currency":"NGN","bookable":false}Pricing
/api/v1/pricingscope pricing:readCurrent pricing, with price history when requested. An unknown materialId returns 404.
| Query | Notes |
|---|---|
materialId | Limit to one material. |
history | true adds the history array. Requires materialId. |
historyTake | History rows to return. Default 30, maximum 100. |
curl "https://<your-api-host>/api/v1/pricing?materialId=10&history=true" \
-H "X-Api-Key: egz_live_xxxxxxxx"{"materialId":10,"name":"PET bottles","categoryName":"Plastic","pricePerKg":120,"pricePerUnit":null,"currency":"NGN",
"bookable":false,"history":[{"effectiveOn":"2026-10-01T00:00:00Z","oldPricePerKg":100,"newPricePerKg":120,
"oldPricePerUnit":null,"newPricePerUnit":null,"source":"weekly"}]}history is present only with history=true.
Carbon score
/api/v1/carbon-scorescope carbon:readYour organisation's own figures. Emissions come from the GreenZest Carbon Engine (carbon-v1) over your ESG data points: Scope 1, 2 and 3 gross, with avoided emissions reported separately and never netted. Verified carbon-ledger credits are all-time. It acts as the key's creator, who needs the view-analytics permission.
| Query | Notes |
|---|---|
period | Optional. Letters, digits and -, at most 20 characters, for example 2026-Q2. Defaults to the most recently computed period. |
curl "https://<your-api-host>/api/v1/carbon-score?period=2026-Q2" \
-H "X-Api-Key: egz_live_xxxxxxxx"{"period":"2026-Q2","status":"ok","emissions":{"modelVersion":"carbon-v1","computedOn":"2026-10-07T10:00:00Z",
"scope1Kg":10,"scope2Kg":20,"scope3Kg":30,"grossTotalKg":60,"avoidedKg":500,"platformDataCoverage":0.75,
"insufficientData":false},"verifiedCredits":{"totalCredits":4,"co2eSavedKg":2500,"co2eSavedTonnes":2.5,
"quantityKg":9000,"creditsWithEvidence":4},"methodology":"..."}When nothing has been computed, status is insufficient_data and emissions is null; credits are still reported.
Analytics
/api/v1/analyticsscope analytics:readNetwork-wide aggregates, anonymised. Small-count suppression: any cell or line total backed by fewer than 5 distinct contributors is hidden (suppressed: true with null values), and further cells are hidden where needed so no published total can be subtracted to recover a hidden cell. region and material filters are applied after suppression.
| Query | Notes |
|---|---|
region | Optional. |
material | Optional. |
curl "https://<your-api-host>/api/v1/analytics?region=Lagos" \
-H "X-Api-Key: egz_live_xxxxxxxx"{"minimumContributors":5,"network":{"totalKgRecycled":0,"co2AvoidedKg":0,"totalPickups":0,"organizations":0},
"verifiedSupply":{"cells":[{"region":"Lagos","material":"Plastic","verifiedKg":600,"batches":6,"suppressed":false},
{"region":"Lagos","material":"Glass","verifiedKg":null,"batches":null,"suppressed":true}],
"regionTotals":[{"key":"Lagos","verifiedKg":null,"suppressed":true}],"materialTotals":[],
"grandTotal":{"key":null,"verifiedKg":0,"suppressed":false}},"notes":"..."}Marketplace
Marketplace access is read-only: published public listings only. Marketplace transactions (offers, auctions, orders) are not available through the API.
/api/v1/marketplace/listingsscope marketplace:read| Query | Notes |
|---|---|
search | Free-text search. |
categoryId | Filter by category. |
materialId | Filter by material. |
region | Filter by region. |
verifiedOnly | Only verified listings. |
sort | best-value, price or reliability. |
page, pageSize | Paging as above. |
curl "https://<your-api-host>/api/v1/marketplace/listings?region=Lagos&verifiedOnly=true&sort=price" \
-H "X-Api-Key: egz_live_xxxxxxxx"{"id":7,"slug":"clear-pet-flakes-7","title":"Clear PET flakes","materialId":3,"categoryId":4,"categoryName":"Plastic",
"verified":true,"availableKg":1000,"unitPrice":250,"currency":"NGN","pricingMode":"Fixed","region":"Lagos",
"minOrderQtyKg":100,"sellerName":"GreenCo","sellerVerified":true,"purityPercent":95,"isCertified":false,
"publishedOn":"2026-10-01T00:00:00Z"}/api/v1/marketplace/listings/{slug}scope marketplace:readslug is {slug}-{id} or a bare id. The result is the same detail shape the public listing page uses, with the seller organisation id removed.
curl "https://<your-api-host>/api/v1/marketplace/listings/clear-pet-flakes-7" \
-H "X-Api-Key: egz_live_xxxxxxxx"ERP push and funder impact
These routes use the same keys and the same header.
/api/erp/v1/waste-datascope waste:writePushes waste and material lines into your Compliance Ledger, where they land as Pending.
/api/impact/v1/*scope impact:readThe funder impact API: portfolio, grants, grants/{id}/report, provenance and export.csv.
Errors
| HTTP | resultType | Meaning |
|---|---|---|
| 200 | 1 | Success. |
| 400 | 3 | Validation or other failure. Read message for the reason. |
| 401 | n/a | Missing, invalid, revoked or inactive key. |
| 403 | 9 | The key lacks the route's scope, or the key's creator lacks the permission the route acts with. |
| 404 | 8 | Unknown id, or an id that belongs to another organisation. |
Failures use the standard envelope with successful: false, a human-readable message and result: null.
Webhooks
Webhooks push events to your https endpoint as they happen. Manage endpoints from the Webhooks page in your workspace: add an endpoint, choose events (or all of them), and copy the signing secret. The secret is shown once, at creation and on rotation.
| Rule | Detail |
|---|---|
| URL | Must be https and a public host. Private and internal addresses are refused. |
| Limit | 20 subscriptions per organisation. |
| Events | A list of event types, or * for every catalogue event (not ping). |
| Test | Send test ping delivers a signed ping event and shows the result. |
Envelope
{"id":"evt_<guid32>","type":"payout.completed","apiVersion":"1","createdAt":"2026-10-07T10:00:00Z","organizationId":"<guid>","data":{...}}Event catalogue
Every event below is emitted today. Sample data shows the exact fields; the values are illustrative.
| Event | Category | When |
|---|---|---|
pickup.requested | Pickups | A corporate pickup was requested. |
pickup.assigned | Pickups | An agent was assigned to a pickup. Agent identity is never published. |
pickup.weight_adjusted | Pickups | A pickup's weights were adjusted. |
pickup.completed | Pickups | A pickup was completed. |
payout.requested | Payouts | An organisation payout was requested. No bank details are included. |
payout.processing | Payouts | A payout is being processed. |
payout.completed | Payouts | A payout completed. |
payout.failed | Payouts | A payout failed. |
order.created | Orders | A marketplace order was created. Sent to the buyer and seller organisations separately. |
escrow.funded | Orders | Escrow was funded for an order. |
order.shipped.confirmed | Orders | Shipment was confirmed. |
order.arrival.confirmed | Orders | Arrival was confirmed. |
order.settled | Orders | The order was settled. |
dispute.raised | Disputes | A dispute was raised on an order. Order data plus a detail object. |
dispute.resolved | Disputes | A dispute was resolved. |
material.verified | Verification | A material batch was verified. Sent to the owner organisation only. |
Pickup events
Corporate pickups only. They are not raised for nightly auto-scheduled recurring pickups, and the agent's identity is never published.
{"pickupId":501,"siteId":12,"scheduledDate":"2026-10-20T00:00:00Z","status":"Requested","estimatedAmount":3000.0,"totalAmount":3000.0,"currency":"NGN","isWeightAdjusted":false,"agentAssigned":false,"completedOn":null,"items":[{"materialId":10,"quantity":25,"estimatedQuantity":25,"actualQuantity":null,"amount":3000.0}]}Payout events
Organisation payouts only. No bank details are included.
{"payoutId":"…","reference":"…","amountNet":48500.0,"penaltyAmount":1500.0,"currency":"NGN","failureClass":null}Order and escrow events
order.created, escrow.funded, order.shipped.confirmed, order.arrival.confirmed and order.settled are sent to the buyer organisation and the seller organisation separately; role says which you are.
{"orderId":"…","orderRef":"…","status":"…","role":"buyer","quantityKg":1000,"unitPrice":250,"totalValue":250000,"currency":"NGN","detail":null}Dispute events
The same order data plus a detail object.
{"orderId":"…","orderRef":"…","status":"…","role":"seller","quantityKg":1000,"unitPrice":250,"totalValue":250000,"currency":"NGN","detail":{"disputeId":"…","reason":"…","upheld":null}}Material verification
material.verified goes to the owner organisation only.
{"batchId":"…","materialId":10,"grade":"A","weightKg":600}Ping
ping is sent only by Send test ping. It is not subscribable.
Not available
Household payment-verification events are not published, and neither are other marketplace events such as offers, auctions and legs.
Delivery and signatures
Each delivery is a POST of the raw JSON envelope with Content-Type: application/json and User-Agent: EcoGreenZest-Webhooks/1. The timeout is 10 seconds, redirects are not followed, and any 2xx response counts as delivered.
| Header | Value |
|---|---|
X-EcoGreenZest-Event | The event type. |
X-EcoGreenZest-Delivery | The delivery id. |
X-EcoGreenZest-Signature | t=<unix>,v1=<hex> |
v1 is the hex HMAC-SHA256 of {t}.{rawBody} keyed with your signing secret. The timestamp is refreshed on every attempt. Verify against the raw request body, not a re-serialised copy, and reject timestamps outside a tolerance window (300 seconds below).
const crypto = require('crypto');
function verify(header, rawBody, secret, toleranceSec = 300) {
const p = Object.fromEntries(header.split(',').map(s => s.split('=')));
if (Math.abs(Date.now()/1000 - Number(p.t)) > toleranceSec) return false;
const exp = crypto.createHmac('sha256', secret).update(`${p.t}.${rawBody}`).digest('hex');
return crypto.timingSafeEqual(Buffer.from(exp), Buffer.from(p.v1));
}import hashlib, hmac, time
def verify(header: str, raw_body: str, secret: str, tolerance_sec: int = 300) -> bool:
parts = dict(item.split("=", 1) for item in header.split(","))
t = parts["t"]
if abs(time.time() - int(t)) > tolerance_sec:
return False
expected = hmac.new(secret.encode(), f"{t}.{raw_body}".encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])Retries and disabling
A delivery that does not get a 2xx is retried on a fixed schedule. Attempt 8 is the last; after it the delivery is Abandoned. You can retry a Failed or Abandoned delivery from the Webhooks page, which gives it a fresh attempt budget.
| After failed attempt | Next attempt in |
|---|---|
| 1 | 1 minute |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 6 hours |
| 6 | 12 hours |
| 7 | 24 hours |
| 8 | None: the delivery is Abandoned |
Auto-disable
A subscription is disabled automatically after 20 consecutive failed deliveries. The Webhooks page shows the reason. Activating it resets the failure count and re-validates the URL.
At-least-once delivery
Delivery is at least once, so the same event can arrive more than once. Deduplicate on the envelope id and make your handler idempotent. Respond with a 2xx quickly and do the heavy work afterwards.
Changelog
v1
- Scoped API keys:
X-Api-Key, nine scopes, 401 and 403 responses. - Pickups: create (with
Idempotency-Key), list and fetch. - Materials, pricing and price history.
- Carbon score from the GreenZest Carbon Engine (
carbon-v1). - Network analytics with small-count suppression.
- Read-only marketplace listings.
- Signed outbound webhooks with a retry schedule, auto-disable and a delivery log.