Publish menu
http
POST /v1/publishCreates a publication snapshot of the current menu and makes it live:
all products with menuVisible: true (and their categories, compositions
and modifiers) are frozen into a new publication that guests see on the
public menu.
No request body is required.
Sync vs publish#
POST /v1/sync writes to the draft menu — guests
don't see those changes yet. POST /v1/publish takes what the draft looks
like right now and snapshots it as the live menu. The typical flow:
- One or more
synccalls (and/orcleanup). - One
publishcall at the end.
Publish once per batch
Publishing after every small sync creates needless snapshots. Batch your changes, then publish once — it also keeps you well inside the rate limits.
Products with menuVisible: false (including those deactivated by
cleanup) are excluded from the snapshot.
Example#
bash
curl -X POST https://api.duck-hub.com/v1/publish \
-H "Authorization: Bearer dk_live_your_api_key"javascript
const response = await fetch('https://api.duck-hub.com/v1/publish', {
method: 'POST',
headers: { Authorization: 'Bearer dk_live_your_api_key' },
})
const result = await response.json()
console.log('Published:', result.publicationId)Response#
201 Created:
json
{
"success": true,
"publicationId": "cml9x2f4a0001abcd1234efgh"
}| Field | Meaning |
|---|---|
success | Always true on success |
publicationId | Id of the created publication snapshot |
Errors#
401— see Authentication429— see Rate limits