EcoGreenZest logo
EcoGreenZest

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:

base url
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
curl "https://<your-api-host>/api/v1/materials" \
  -H "X-Api-Key: egz_live_xxxxxxxx"
StatusWhen
401The key is missing, invalid, revoked or inactive.
403The key is valid but does not carry the scope the route needs.

A 403 body names the missing scope:

json
{"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.

ScopeGrants
waste:write(default)Push waste data (ERP ingestion), POST /api/erp/v1/waste-data
impact:readFunder impact reporting, /api/impact/v1/*
pickups:readRead your organisation's pickups
pickups:writeCreate pickups for your organisation
materials:readMaterial catalogue with current rates
pricing:readCurrent pricing and price history
carbon:readYour organisation's carbon figures
analytics:readNetwork-wide anonymised aggregates
marketplace:readPublished 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.

resultTypeMeaningHTTP status
1Success200
3Validation error or other failure400
8Not found404
9Authorization error403

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:

json
{"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

POST/api/v1/pickupsscope pickups:write

Creates a pickup for your organisation. It acts as the key's creator, who must still hold the request-pickup permission (otherwise 403).

FieldRules
siteIdA site that belongs to the key's organisation.
scheduledDateNot in the past.
items1 to 50 items. quantity > 0 and <= 1,000,000. No duplicate materialId. Every material must exist and be bookable.
notesOptional, at most 1000 characters.
curl
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}]}'
200 result
{"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:

400
{"result":null,"resultType":3,"message":"material 10 cannot be booked through the API yet: no per-unit price is configured","successful":false}
GET/api/v1/pickupsscope pickups:read

Lists your pickups, newest first.

QueryNotes
statusRequested, Scheduled, Assigned, InProgress, Completed or Cancelled.
pageDefault 1.
pageSizeDefault 20, maximum 100.
curl
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.

GET/api/v1/pickups/{id}scope pickups:read

One pickup, same shape as above. An unknown id, or another organisation's id, returns 404.

curl
curl "https://<your-api-host>/api/v1/pickups/501" \
  -H "X-Api-Key: egz_live_xxxxxxxx"

Materials

GET/api/v1/materialsscope materials:read

The 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.

QueryNotes
categoryIdFilter by category.
searchFree-text search.
pageDefault 1.
pageSizeDefault 20, maximum 100.
curl
curl "https://<your-api-host>/api/v1/materials?search=pet" \
  -H "X-Api-Key: egz_live_xxxxxxxx"
item in data
{"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

GET/api/v1/pricingscope pricing:read

Current pricing, with price history when requested. An unknown materialId returns 404.

QueryNotes
materialIdLimit to one material.
historytrue adds the history array. Requires materialId.
historyTakeHistory rows to return. Default 30, maximum 100.
curl
curl "https://<your-api-host>/api/v1/pricing?materialId=10&history=true" \
  -H "X-Api-Key: egz_live_xxxxxxxx"
result
{"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

GET/api/v1/carbon-scorescope carbon:read

Your 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.

QueryNotes
periodOptional. Letters, digits and -, at most 20 characters, for example 2026-Q2. Defaults to the most recently computed period.
curl
curl "https://<your-api-host>/api/v1/carbon-score?period=2026-Q2" \
  -H "X-Api-Key: egz_live_xxxxxxxx"
result
{"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

GET/api/v1/analyticsscope analytics:read

Network-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.

QueryNotes
regionOptional.
materialOptional.
curl
curl "https://<your-api-host>/api/v1/analytics?region=Lagos" \
  -H "X-Api-Key: egz_live_xxxxxxxx"
result
{"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.

GET/api/v1/marketplace/listingsscope marketplace:read
QueryNotes
searchFree-text search.
categoryIdFilter by category.
materialIdFilter by material.
regionFilter by region.
verifiedOnlyOnly verified listings.
sortbest-value, price or reliability.
page, pageSizePaging as above.
curl
curl "https://<your-api-host>/api/v1/marketplace/listings?region=Lagos&verifiedOnly=true&sort=price" \
  -H "X-Api-Key: egz_live_xxxxxxxx"
item in data
{"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"}
GET/api/v1/marketplace/listings/{slug}scope marketplace:read

slug 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
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.

POST/api/erp/v1/waste-datascope waste:write

Pushes waste and material lines into your Compliance Ledger, where they land as Pending.

GET/api/impact/v1/*scope impact:read

The funder impact API: portfolio, grants, grants/{id}/report, provenance and export.csv.

Errors

HTTPresultTypeMeaning
2001Success.
4003Validation or other failure. Read message for the reason.
401n/aMissing, invalid, revoked or inactive key.
4039The key lacks the route's scope, or the key's creator lacks the permission the route acts with.
4048Unknown 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.

RuleDetail
URLMust be https and a public host. Private and internal addresses are refused.
Limit20 subscriptions per organisation.
EventsA list of event types, or * for every catalogue event (not ping).
TestSend test ping delivers a signed ping event and shows the result.

Envelope

json
{"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.

EventCategoryWhen
pickup.requestedPickupsA corporate pickup was requested.
pickup.assignedPickupsAn agent was assigned to a pickup. Agent identity is never published.
pickup.weight_adjustedPickupsA pickup's weights were adjusted.
pickup.completedPickupsA pickup was completed.
payout.requestedPayoutsAn organisation payout was requested. No bank details are included.
payout.processingPayoutsA payout is being processed.
payout.completedPayoutsA payout completed.
payout.failedPayoutsA payout failed.
order.createdOrdersA marketplace order was created. Sent to the buyer and seller organisations separately.
escrow.fundedOrdersEscrow was funded for an order.
order.shipped.confirmedOrdersShipment was confirmed.
order.arrival.confirmedOrdersArrival was confirmed.
order.settledOrdersThe order was settled.
dispute.raisedDisputesA dispute was raised on an order. Order data plus a detail object.
dispute.resolvedDisputesA dispute was resolved.
material.verifiedVerificationA 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.

data
{"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.

data
{"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.

data
{"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.

data
{"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.

data
{"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.

HeaderValue
X-EcoGreenZest-EventThe event type.
X-EcoGreenZest-DeliveryThe delivery id.
X-EcoGreenZest-Signaturet=<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).

Node.js
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));
}
Python
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 attemptNext attempt in
11 minute
25 minutes
330 minutes
42 hours
56 hours
612 hours
724 hours
8None: 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.
EcoGreenZest Developer API v1 Documentation