Reprice Direct - AI Text Prompt or Direct Rules

Reprices a product using a text-based prompt OR direct DSL rules. Prompt is converted to DSL via N8N AI and cached. Returns pricing explanation and DSL validation results.

HTTP: POST /reprice_direct

Query parameters

NameTypeRequiredDescriptionExample
domainstringyesDomain name or project ID.profi-parfemy.cz
datajsonyesComplete product data in the same format as prepare_data output.{"product_id":"900258","dsl_data":{"price_buy":450,"price_rrp":890,"current_price":699,"stock":15,"competition_count":3,"competition_min":620,"competition_max":750,"competition_avg":680}}
promptstringnoText description of the pricing rule. Either prompt OR rules is required.be cheapest on the market but maintain minimum 20% margin
rulesjsonnoDirect DSL rules as JSON. Use this instead of prompt to skip AI generation.["max", ["-", ["var", "dsl.competition.min_price"], 1], ["*", ["var", "dsl.price_buy"], 1.2]]
force_regeneratebooleannoSet to true to bypass cache and regenerate DSL from prompt.false

Notes

Sample request

curl -X POST https://admin.elpricing.com/api/reprice_direct
  -H "Authorization: ApiKey YOUR_API_KEY"
  -H "Content-Type: application/json"
  -d '{"domain":"profi-parfemy.cz","prompt":"be cheapest on the market but maintain minimum 20% margin","data":{"product_id":"900258","dsl_data":{"price_buy":450,"price_rrp":890,"current_price":699,"stock":15,"competition_count":3,"competition_min":620,"competition_max":750,"competition_avg":680},"competition":{"count":3,"products":[{"price":620,"shop":"parfemy.cz"},{"price":680,"shop":"notino.cz"},{"price":750,"shop":"elnino.cz"}]}}}'

Interactive call

Queue workflow

Tasks are persisted to var/api_queue/tasks.json. Process them with:

php go.php cron:list\nphp go.php cron:go

Logs are written to var/api_queue/logs/{task_id}.log.