> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/data-and-insights/marketing-integrations/adpage-feed-your-own-api.md).

# AdPage Feed (your own API)

Deliver weekly revenue and returns from your own ERP or source system through three read-only endpoints.

When your real revenue lives somewhere AdPage has no integration for — a custom ERP, a wholesale system, a till in a physical shop — you can serve it yourself. **AdPage Feed v1** is a small contract: three GET endpoints, one key, weekly totals only.

{% hint style="info" %}
This integration is released per customer. If you do not see the tile, ask <support@adpage.io> to enable it.
{% endhint %}

### Why this exists

The Marketing Mix Model runs on one revenue figure per week: the number your advertising budget has to explain. The closer that number is to your actual revenue, the more trustworthy the model's conclusions.

Tracking measures something slightly different from your accounts, and it does not measure shop revenue at all. Your source system does. This connection lets you supply that number without AdPage ever reaching into your ERP.

### What AdPage asks for, and what it does not

| Asked for                                    | Never asked for                |
| -------------------------------------------- | ------------------------------ |
| Revenue per ISO week per sales channel       | Orders, order lines, customers |
| Return value per week per channel (optional) | Any personal data              |
| Read access through one key                  | Write access of any kind       |
| About two requests per week                  | Realtime or daily polling      |

A static key on three read-only endpoints is deliberately the smallest possible surface. It passes most security reviews without discussion.

### Three ways to connect

**Route A — you build the feed (recommended).** Implement the three endpoints. For a developer with access to the data this is half a day to a day. No custom work on the AdPage side, so nothing to wait for.

**Route B — you already have an API and AdPage maps it.** Send your documentation plus one example response and AdPage will confirm whether it is usable as is. The conditions that cannot be mapped around: data available per week (or per day, which AdPage aggregates), distinguishable per sales channel, and stable — asking for the same week twice must return the same answer.

**Route C — no API available.** The weekly CSV upload stays available. It works, but someone has to do it every week, which is the step that gets skipped when things get busy.

### The contract

```
GET {base}/livez                                      → {"status":"ok"}, no auth
GET {base}/adpage/v1/weekly-revenue?date_from&date_to  → revenue per ISO week per channel
GET {base}/adpage/v1/weekly-returns?date_from&date_to  → returns per ISO week per channel (optional)
```

Four rules carry the contract:

1. Return **whole ISO weeks**.
2. The **same week always returns the same figure**.
3. When a figure is revised, **`modified_at` goes up**.
4. **One row per week per channel** — no duplicates.

Rule 2 is the one that matters most. A feed that returns slightly different numbers each time it is asked makes the model unstable in ways that are very hard to diagnose later.

The full specification, an OpenAPI file you can import into Postman, and a worked example are in the `docs/partner-data-api/` folder of the AdPage repository. Ask support if you need them sent over.

### Connect the feed in AdPage

{% stepper %}
{% step %}

#### Open the tile

Go to **Integrations**, select the container, and open the **Eigen API (AdPage Feed)** tile.
{% endstep %}

{% step %}

#### Fill in the base URL and authentication

Enter your **base URL**, the **header name** your API expects the key in, an optional **value prefix** (for example `Bearer`), and the **key** itself.

Set the **VAT rate** and whether your figures are inclusive or exclusive of VAT. Getting this wrong scales every number in the model by about a fifth, and nothing else will flag it.

If your channel names differ from AdPage's, map them under channel routing.
{% endstep %}

{% step %}

#### Test, then save

AdPage calls `/livez` and runs a dry run over the last four weeks before storing anything. A feed that does not answer is never saved — it would otherwise sit in the weekly job silently failing.

Use **Alleen testen** to check without saving. The key goes to the server and never comes back: the response shows at most its last four characters.
{% endstep %}

{% step %}

#### Pull in the history

After connecting, run a sync to fetch history — two years by default, up to four. The weekly job would get there on its own, but nobody wants to wait until Tuesday.

If a run hits its time budget it reports as truncated. What was fetched is complete, and running it again finishes the job: the blocks overlap on their boundary week and the tables de-duplicate themselves, so a repeat can never double-count.
{% endstep %}
{% endstepper %}

### Rotating the key

Paste the new key and save. Every other field can be left untouched — an omitted field keeps its stored value, so replacing only the key is a single action.

### Troubleshooting

**`/livez` fails.** The base URL is wrong or the endpoint is not reachable from the internet. It takes no auth by design; if it demands a key, that is the fault.

**Authentication fails on the data endpoints.** Check the header name and the value prefix separately. `Authorization` with prefix `Bearer` and `X-API-Key` with no prefix are both common, and mixing them is the usual cause.

**The dry run returns nothing.** The feed answers but has no data for the last four weeks, or the date filter is not being applied. Check `date_from` and `date_to` handling.

**Revenue is about 21% off.** The VAT basis is set the wrong way round. Fix it in the tile.

**The model behaves oddly after a while.** Check rule 2 — whether the same week still returns the same figure. A feed reading from a live table without a cut-off date drifts.

Still stuck? Contact <support@adpage.io> with the container and the base URL — never the key.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.adpage.io/data-and-insights/marketing-integrations/adpage-feed-your-own-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
