Complete flows, not isolated calls.
Start from executable examples and connect creation, tracking, events, and failure recovery as a production integration.
Create and publish an offer
Create the pending offer, review the result and only then request publication in authorized groups. The timeline records each attempt.
const base = "https://achadu.com/api/v1";
const headers = {
Authorization: `Bearer ${process.env.ACHADU_API_KEY}`,
"Content-Type": "application/json"
};
const offer = await fetch(`${base}/offers`, {
method: "POST", headers,
body: JSON.stringify({
url: "https://www.amazon.com.br/dp/...",
title: "Air fryer 5L", price: 329.90, currency: "BRL"
})
}).then(r => r.json());
const publication = await fetch(`${base}/publications`, {
method: "POST", headers,
body: JSON.stringify({ offer_id: offer.data.id, group_ids: ["grp_..."] })
}).then(r => r.json());Consume webhooks without processing twice
Validate the raw body, respond quickly and process outside the request. Store event.id to make your consumer idempotent.
app.post("/webhooks/achadu", raw({ type: "application/json" }), (req, res) => {
verifyAchaduSignature(req.headers, req.body);
const event = JSON.parse(req.body.toString("utf8"));
if (alreadyProcessed(event.id)) return res.sendStatus(200);
enqueueByType(event.type, event.data);
markProcessed(event.id);
return res.sendStatus(202);
});Import and reconcile revenue
Send the program CSV and track commissions/imports/{id}.
Trigger commissions/sync to fetch changes from the connected integration.
Create the receipt with external reference, value and currency.
Run receipts/{id}/reconcile and review differences explicitly.
Answer and automate in DU Inbox
Open contact, notes and messages before replying.
Direct it to the responsible operator or queue.
Send text via the connected channel using the same history.
Validate the definition, execute and monitor each execution.