VEYNDO
Handbook
docs/reference/marketing.mdView source ↗

English source · 16 min

Marketing API reference

Rules, coupons, promotions, flows and sales channels. Contract version 1.0.0, generated from contracts/http/marketing.openapi.json. 14 HTTP operations, 9 MCP tools. All components · Build your first app.

Set up a client

Every example below uses these three values. VEYNDO_TOKEN is needed only for merchant operations; keep it on your server.

export VEYNDO_URL=https://api.veyndo.ai
export VEYNDO_SHOP=<your-shop-id>
export VEYNDO_TOKEN=<personal-session-or-integration-key>

curl

curl -fsS "$VEYNDO_URL/health"

TypeScript

import { Auth, VeyndoClient } from "@veyndo/commerce-client";

const client = new VeyndoClient({
  baseUrl: process.env.VEYNDO_URL!,
  tenant: process.env.VEYNDO_SHOP,
  auth: process.env.VEYNDO_TOKEN ? Auth.personalSession(process.env.VEYNDO_TOKEN) : undefined,
});

Python

import os
from veyndo_sdk import Auth, VeyndoClient

token = os.environ.get("VEYNDO_TOKEN")
client = VeyndoClient(os.environ["VEYNDO_URL"], tenant=os.environ["VEYNDO_SHOP"],
                      auth=Auth.personal_session(token) if token else None)

Rust

use serde_json::json;
use veyndo_sdk::{Auth, Client, ClientOptions, RequestOptions};

let client = Client::new(ClientOptions {
    base_url: std::env::var("VEYNDO_URL")?,
    tenant: std::env::var("VEYNDO_SHOP").ok(),
    auth: std::env::var("VEYNDO_TOKEN").ok().map(Auth::PersonalSession),
    ..ClientOptions::default()
});

The marketing API object, method names and argument order are those of the generated SDKs.

Operations

Operation Permission In the docs
POST /channel-preview/end public request
GET /channel-preview/{ticket} public request
GET /api/automation read request
GET /api/automation/catalog automation.read request
POST /api/automation/channels/{id}/preview channels.read request
PUT /api/automation/entities/{entity}/{id} automation.manage request
GET /api/automation/executions read request
POST /api/automation/flows/{id}/validate automation.manage request
POST /api/automation/import-condition automation.manage request
POST /api/automation/rules/compare-history read request
POST /api/automation/rules/preview read request
DELETE /api/automation/{kind}/{id} read request
PUT /api/automation/{kind}/{id} read request
GET /api/automation/{kind}/{id}/dependencies read request
MCP automation.catalog automation.read request
MCP automation.compare_history automation.read, b2b.read, catalog.read, orders.read, customers.read, customers.pii, documents.read, payments.read request
MCP automation.delete automation.manage request
MCP automation.dependencies automation.read request
MCP automation.import automation.manage request
MCP automation.list automation.read request
MCP automation.preview automation.read request
MCP automation.save automation.manage request
MCP automation.validate_flow automation.manage request

Public HTTP

Anonymous storefront, discovery and protocol routes. Name the shop with x-tenant.

POST /channel-preview/end

Permission: public, no credential. Source: src/marketing/channel_preview.rs. SDK method: postChannelPreviewEnd.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/channel-preview/end" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.postChannelPreviewEnd({ body: {} });

Python

result = client.marketing.post_channel_preview_end(body={})

Rust

let result = client.marketing().post_channel_preview_end(RequestOptions::json(json!({}))).await?;

GET /channel-preview/{ticket}

Permission: public, no credential. Source: src/marketing/channel_preview.rs. SDK method: getChannelPreviewByTicket.

Needs a cart, buyer or object token: run the example against your own shop.

curl

curl -fsS -X GET "$VEYNDO_URL/channel-preview/<ticket>" \
  -H "x-tenant: $VEYNDO_SHOP"

TypeScript

const result = await client.marketing.getChannelPreviewByTicket({ "ticket": "<ticket>" });

Python

result = client.marketing.get_channel_preview_by_ticket("<ticket>")

Rust

let result = client.marketing().get_channel_preview_by_ticket("<ticket>", RequestOptions::default()).await?;

Merchant HTTP

Each route checks the named permission against your current membership.

GET /api/automation

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: getAutomation.

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X GET "$VEYNDO_URL/api/automation" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN"

TypeScript

const result = await client.marketing.getAutomation();

Python

result = client.marketing.get_automation()

Rust

let result = client.marketing().get_automation(RequestOptions::default()).await?;

GET /api/automation/catalog

Permission: automation.read, personal session or integration key. Source: src/marketing/catalog.rs. SDK method: getAutomationCatalog.

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X GET "$VEYNDO_URL/api/automation/catalog" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN"

TypeScript

const result = await client.marketing.getAutomationCatalog();

Python

result = client.marketing.get_automation_catalog()

Rust

let result = client.marketing().get_automation_catalog(RequestOptions::default()).await?;

POST /api/automation/channels/{id}/preview

Permission: channels.read, personal session or integration key. Source: src/marketing/channel_preview.rs. SDK method: postAutomationChannelsByIdPreview.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/api/automation/channels/<id>/preview" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.postAutomationChannelsByIdPreview({ "id": "<id>" }, { body: {} });

Python

result = client.marketing.post_automation_channels_by_id_preview("<id>", body={})

Rust

let result = client.marketing().post_automation_channels_by_id_preview("<id>", RequestOptions::json(json!({}))).await?;

PUT /api/automation/entities/{entity}/{id}

Permission: automation.manage, personal session or integration key. Source: src/marketing/metadata.rs. SDK method: putAutomationEntitiesByEntityById.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X PUT "$VEYNDO_URL/api/automation/entities/<entity>/<id>" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.putAutomationEntitiesByEntityById({ "entity": "<entity>", "id": "<id>" }, { body: {} });

Python

result = client.marketing.put_automation_entities_by_entity_by_id("<entity>", "<id>", body={})

Rust

let result = client.marketing().put_automation_entities_by_entity_by_id("<entity>", "<id>", RequestOptions::json(json!({}))).await?;

GET /api/automation/executions

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: getAutomationExecutions.

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X GET "$VEYNDO_URL/api/automation/executions" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN"

TypeScript

const result = await client.marketing.getAutomationExecutions();

Python

result = client.marketing.get_automation_executions()

Rust

let result = client.marketing().get_automation_executions(RequestOptions::default()).await?;

POST /api/automation/flows/{id}/validate

Permission: automation.manage, personal session or integration key. Source: src/marketing/routes.rs. SDK method: postAutomationFlowsByIdValidate.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/api/automation/flows/<id>/validate" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.postAutomationFlowsByIdValidate({ "id": "<id>" }, { body: {} });

Python

result = client.marketing.post_automation_flows_by_id_validate("<id>", body={})

Rust

let result = client.marketing().post_automation_flows_by_id_validate("<id>", RequestOptions::json(json!({}))).await?;

POST /api/automation/import-condition

Permission: automation.manage, personal session or integration key. Source: src/marketing/catalog.rs. SDK method: postAutomationImportCondition.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/api/automation/import-condition" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.postAutomationImportCondition({ body: {} });

Python

result = client.marketing.post_automation_import_condition(body={})

Rust

let result = client.marketing().post_automation_import_condition(RequestOptions::json(json!({}))).await?;

POST /api/automation/rules/compare-history

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: postAutomationRulesCompareHistory.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/api/automation/rules/compare-history" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.postAutomationRulesCompareHistory({ body: {} });

Python

result = client.marketing.post_automation_rules_compare_history(body={})

Rust

let result = client.marketing().post_automation_rules_compare_history(RequestOptions::json(json!({}))).await?;

POST /api/automation/rules/preview

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: postAutomationRulesPreview.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/api/automation/rules/preview" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.postAutomationRulesPreview({ body: {} });

Python

result = client.marketing.post_automation_rules_preview(body={})

Rust

let result = client.marketing().post_automation_rules_preview(RequestOptions::json(json!({}))).await?;

DELETE /api/automation/{kind}/{id}

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: deleteAutomationByKindById.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X DELETE "$VEYNDO_URL/api/automation/<kind>/<id>" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN"

TypeScript

const result = await client.marketing.deleteAutomationByKindById({ "kind": "<kind>", "id": "<id>" });

Python

result = client.marketing.delete_automation_by_kind_by_id("<kind>", "<id>")

Rust

let result = client.marketing().delete_automation_by_kind_by_id("<kind>", "<id>", RequestOptions::default()).await?;

PUT /api/automation/{kind}/{id}

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: putAutomationByKindById.

Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X PUT "$VEYNDO_URL/api/automation/<kind>/<id>" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{}'

TypeScript

const result = await client.marketing.putAutomationByKindById({ "kind": "<kind>", "id": "<id>" }, { body: {} });

Python

result = client.marketing.put_automation_by_kind_by_id("<kind>", "<id>", body={})

Rust

let result = client.marketing().put_automation_by_kind_by_id("<kind>", "<id>", RequestOptions::json(json!({}))).await?;

GET /api/automation/{kind}/{id}/dependencies

Permission: read, personal session or integration key. Source: src/marketing/routes.rs. SDK method: getAutomationByKindByIdDependencies.

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X GET "$VEYNDO_URL/api/automation/<kind>/<id>/dependencies" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN"

TypeScript

const result = await client.marketing.getAutomationByKindByIdDependencies({ "kind": "<kind>", "id": "<id>" });

Python

result = client.marketing.get_automation_by_kind_by_id_dependencies("<kind>", "<id>")

Rust

let result = client.marketing().get_automation_by_kind_by_id_dependencies("<kind>", "<id>", RequestOptions::default()).await?;

MCP tools

Called with JSON-RPC tools/call on POST /mcp. The facts come from the typed operations graph; the server validates the input schema before it runs a tool.

automation.catalog

Read original rule scopes and executable native action contracts.

Fact Value
Audience merchant
Writes no
Risk low
Reversibility reversible
Requires approval no
Cost free
Permissions automation.read
Effects none
Conditions none
Data automation, app
Requires none

Input: no arguments.

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.catalog", "arguments": {}}}'

TypeScript

const result = await client.mcp.call("automation.catalog", {});

Python

result = client.mcp.call("automation.catalog", {})

Rust

let result = client.mcp().call_raw("automation.catalog", json!({})).await?;

automation.compare_history

Compare a saved rule and draft on frozen order.placed Flow inputs without replaying actions or reading current commerce data.

Fact Value
Audience merchant
Writes no
Risk medium
Reversibility reversible
Requires approval no
Cost free
Permissions automation.read, b2b.read, catalog.read, orders.read, customers.read, customers.pii, documents.read, payments.read
Effects none
Conditions none
Data automation, order · money · pii
Requires none
Argument Type Required
condition object yes
flowId string (max length 32) yes
limit integer (≥ 1, ≤ 50) yes
revision integer (≥ 1) yes
ruleId string (max length 32) yes

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.compare_history", "arguments": {"ruleId": "<string>", "revision": 1, "flowId": "<string>", "condition": {}, "limit": 1}}}'

TypeScript

const result = await client.mcp.call("automation.compare_history", {"ruleId": "<string>", "revision": 1, "flowId": "<string>", "condition": {}, "limit": 1});

Python

result = client.mcp.call("automation.compare_history", {"ruleId": "<string>", "revision": 1, "flowId": "<string>", "condition": {}, "limit": 1})

Rust

let result = client.mcp().call_raw("automation.compare_history", json!({"ruleId": "<string>", "revision": 1, "flowId": "<string>", "condition": {}, "limit": 1})).await?;

automation.delete

Revision-bound deletion of unused tenant configuration.

Fact Value
Audience merchant
Writes yes
Risk high
Reversibility irreversible
Requires approval yes
Cost standard
Permissions automation.manage
Effects none
Conditions none
Data automation
Requires automation.dependencies
Argument Type Required
id string yes
kind "rules" | "flows" | "promotions" | "channels" yes
revision integer (≥ 1) yes

A write. Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.delete", "arguments": {"kind": "rules", "id": "<string>", "revision": 1}}}'

TypeScript

const result = await client.mcp.call("automation.delete", {"kind": "rules", "id": "<string>", "revision": 1});

Python

result = client.mcp.call("automation.delete", {"kind": "rules", "id": "<string>", "revision": 1})

Rust

let result = client.mcp().call_raw("automation.delete", json!({"kind": "rules", "id": "<string>", "revision": 1})).await?;

automation.dependencies

Inspect tenant-owned references and durable uses before deletion.

Fact Value
Audience merchant
Writes no
Risk low
Reversibility reversible
Requires approval no
Cost free
Permissions automation.read
Effects none
Conditions none
Data automation
Requires none
Argument Type Required
id string yes
kind "rules" | "flows" | "promotions" | "channels" yes

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.dependencies", "arguments": {"kind": "rules", "id": "<string>"}}}'

TypeScript

const result = await client.mcp.call("automation.dependencies", {"kind": "rules", "id": "<string>"});

Python

result = client.mcp.call("automation.dependencies", {"kind": "rules", "id": "<string>"})

Rust

let result = client.mcp().call_raw("automation.dependencies", json!({"kind": "rules", "id": "<string>"})).await?;

automation.import

Validate and normalize an original Shopware condition without saving.

Fact Value
Audience merchant
Writes no
Risk low
Reversibility reversible
Requires approval no
Cost free
Permissions automation.manage
Effects none
Conditions none
Data automation
Requires none
Argument Type Required
condition object yes

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.import", "arguments": {"condition": {}}}}'

TypeScript

const result = await client.mcp.call("automation.import", {"condition": {}});

Python

result = client.mcp.call("automation.import", {"condition": {}})

Rust

let result = client.mcp().call_raw("automation.import", json!({"condition": {}})).await?;

automation.list

Read own rule, promotion and flow definitions and jobs.

Fact Value
Audience merchant
Writes no
Risk low
Reversibility reversible
Requires approval no
Cost free
Permissions automation.read
Effects none
Conditions none
Data automation
Requires none

Input: no arguments.

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.list", "arguments": {}}}'

TypeScript

const result = await client.mcp.call("automation.list", {});

Python

result = client.mcp.call("automation.list", {})

Rust

let result = client.mcp().call_raw("automation.list", json!({})).await?;

automation.preview

Evaluate a rule against an authoritative cart without effects.

Fact Value
Audience merchant
Writes no
Risk low
Reversibility reversible
Requires approval no
Cost free
Permissions automation.read
Effects none
Conditions none
Data automation, cart · money
Requires none
Argument Type Required
condition object yes

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.preview", "arguments": {"condition": {}}}}'

TypeScript

const result = await client.mcp.call("automation.preview", {"condition": {}});

Python

result = client.mcp.call("automation.preview", {"condition": {}})

Rust

let result = client.mcp().call_raw("automation.preview", json!({"condition": {}})).await?;

automation.save

Revision-bound rule, promotion, channel or Flow write.

Fact Value
Audience merchant
Writes yes
Risk high
Reversibility compensatable
Requires approval yes
Cost standard
Permissions automation.manage
Effects publication, email
Conditions none
Data automation · money
Requires none
Argument Type Required
data object yes
id string yes
kind "rules" | "flows" | "promotions" | "channels" yes
revision integer (≥ 0) yes
validateOnly boolean no

A write. Not executed from the docs. Try it in a private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.save", "arguments": {"kind": "rules", "id": "<string>", "revision": 1, "data": {}}}}'

TypeScript

const result = await client.mcp.call("automation.save", {"kind": "rules", "id": "<string>", "revision": 1, "data": {}});

Python

result = client.mcp.call("automation.save", {"kind": "rules", "id": "<string>", "revision": 1, "data": {}})

Rust

let result = client.mcp().call_raw("automation.save", json!({"kind": "rules", "id": "<string>", "revision": 1, "data": {}})).await?;

automation.validate_flow

Validate a Flow draft and expected revision without saving or queuing it.

Fact Value
Audience merchant
Writes no
Risk low
Reversibility reversible
Requires approval no
Cost free
Permissions automation.manage
Effects none
Conditions none
Data automation
Requires none
Argument Type Required
data object yes
id string yes
revision integer (≥ 0) yes

Needs a merchant credential. Run it against your own private sandbox.

curl

curl -fsS -X POST "$VEYNDO_URL/mcp" \
  -H "x-tenant: $VEYNDO_SHOP" \
  -H "authorization: Bearer $VEYNDO_TOKEN" \
  -H 'content-type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "automation.validate_flow", "arguments": {"id": "<string>", "revision": 1, "data": {}}}}'

TypeScript

const result = await client.mcp.call("automation.validate_flow", {"id": "<string>", "revision": 1, "data": {}});

Python

result = client.mcp.call("automation.validate_flow", {"id": "<string>", "revision": 1, "data": {}})

Rust

let result = client.mcp().call_raw("automation.validate_flow", json!({"id": "<string>", "revision": 1, "data": {}})).await?;