Testing and going live
Test on a test company
Never test against a real factory's records. Ask for a test company on Prodaksha:
- with the value chain you work with switched on (for example Coffee dry mill or Mango pulp and juice), so its items, recipes and quality checks match the value chain page;
- with the API and webhooks module on, and a token for your system;
- for toll work, with a toll client linked to your test society id.
Someone at the test company can then play the factory's part: receive your delivery at the gate, run the recipe, issue a statement, sell and pay. Each step sends you its event.
Walk the whole journey once
Tick each line before you go live:
| # | Check | How you know |
|---|---|---|
| 1 | Connection | GET /health and GET /company answer 200 |
| 2 | Your codes are accepted | POST /consignments answers 201 with every product you will send (or each is mapped) |
| 3 | Duplicates are safe | The same reference_no again answers 409; the same Idempotency-Key returns the first answer |
| 4 | Events arrive and are checked | consignment.received reaches you; a body changed by one byte fails your signature check; an old X-Timestamp is refused |
| 5 | Repeats are ignored | The same X-Event-Id twice changes nothing on your side |
| 6 | Variance | A delivery weighed outside the tolerance waits; your approve or dispute reaches the factory, and consignment.variance_decided comes back |
| 7 | Results | run.completed carries the grades and bags you expect, with your reference_no |
| 8 | Money | Toll: statement.issued → approve → sale.proceeds → payment.recorded (kind: proceeds). Purchase: invoice.issued → payment.recorded. The amounts match what the factory's screens show |
| 9 | Downtime | Stop your receiver for 10 minutes, then start it: the missed events arrive by retry |
| 10 | Reconciliation | Your totals match GET /intakes, /statements, /invoices and /payments for the test period |
Going live
- The real factory asks the platform for its own token for your system (test tokens never work on a real factory).
- Register your production webhook address with that token.
- For toll work, the factory sets up each society as a toll client and adds its tariffs.
- Map your product codes to the factory's items, if they differ.
- Send the first real delivery while someone at the factory watches it arrive.
Keeping it working
- Watch your webhook receiver. If it is down for longer than about 15 hours, events are set aside; read what you missed through the API.
- Rotate secrets when someone who knew them leaves: register a new webhook endpoint, switch to its secret, delete the old one. Ask the factory to revoke an old token and issue a new one.
- Ignore fields you do not know. Version 1 only adds fields and events.
- Keep clocks right (NTP) on both sides: signatures are refused more than 5 minutes off.
