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
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| domain | string | yes | Domain name or project ID. | profi-parfemy.cz |
| data | json | yes | Complete 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}} |
| prompt | string | no | Text description of the pricing rule. Either prompt OR rules is required. | be cheapest on the market but maintain minimum 20% margin |
| rules | json | no | Direct 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_regenerate | boolean | no | Set to true to bypass cache and regenerate DSL from prompt. | false |
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"}]}}}'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.