Skip to content
AchaduDevelopers
Operational APIGo to website
Dashboard
Achadu/Developers/Tutorials

Complete flows, not isolated calls.

Start from executable examples and connect creation, tracking, events, and failure recovery as a production integration.

01

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.

javascript
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());
Open offer_create in reference
02

Consume webhooks without processing twice

Validate the raw body, respond quickly and process outside the request. Store event.id to make your consumer idempotent.

javascript
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);
});
View subscription and attempts
03

Import and reconcile revenue

1
Import the file

Send the program CSV and track commissions/imports/{id}.

2
Sync the source

Trigger commissions/sync to fetch changes from the connected integration.

3
Register receipt

Create the receipt with external reference, value and currency.

4
Reconcile

Run receipts/{id}/reconcile and review differences explicitly.

04

Answer and automate in DU Inbox

Retrieve the context

Open contact, notes and messages before replying.

Assign the conversation

Direct it to the responsible operator or queue.

Reply

Send text via the connected channel using the same history.

Trigger a journey

Validate the definition, execute and monitor each execution.