| Endpoint | Method / Auth | What it does & how it checks |
/api/health | GET Public |
Sync freshness (sync_fresh, last sync time, latest data date) and the writeback agent's heartbeat age. Powers the Data Sync + Writeback cards. |
/api/sync/writeback-log | GET Public |
Last 15 jobs from the past 7 days, all types, tagged with field (price / cost / new_product / delete), status, source, timestamps and the verified flag. Powers the E2E, New Products and Removed Products lists. |
/api/sync/np-agent-status | GET Public |
New-product agent liveness: deployed, alive (polled within 15 min), age_min, agent_version. Recorded each time the agent polls. |
/api/sync/rp-agent-status | GET Public |
Remove-product agent liveness, same shape as np-agent-status. Populated on the remove agent's next poll of delete-jobs. |
/api/sync/heartbeat | POST Shop token |
Writeback agent check-in. Records the heartbeat and delivers pending price/cost jobs. Re-delivers until the agent reports a result. |
/api/sync/new-product-jobs | POST Shop token |
Delivers pending new_product jobs to the add agent and records its liveness (agent_version + last poll). |
/api/sync/delete-jobs | POST Shop token |
Delivers pending delete jobs to the remove agent and records its liveness. Delete jobs are kept off the price heartbeat so only this agent sees them. |
/api/sync/job-result | POST Shop token |
Any agent reports a job outcome (applied / failed + note). Flips the job's status on the VM. |
/api/price-jobs | GET / POST App session |
Dashboard lists every job (GET) or creates one (POST) with field = price / cost / new_product / delete. Validates: field whitelist; new_product needs a barcode matching ^[0-9]{4,20}$, price > 0, cost ≥ 0; a delete needs a barcode and snapshots the product first (so it can be put back). |
/api/price-jobs/<id>/revert-delete | POST App session |
Puts a removed product back: reads the delete job's stored snapshot and re-queues it as a new_product job. Refuses (409) if no snapshot was captured. |
/api/price-jobs/<id>/{confirm,dismiss,revert,verify-now} | POST App session |
Supporting price-job actions: push drafts, dismiss, revert an applied price change, and re-check verification. |