Skip to main content
POST
/
api
/
plans
/
from-recommendation
curl --request POST \
  --url https://app.solya.app/api/plans/from-recommendation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "discountPercent": 30,
  "domain": "markdown",
  "planId": "550e8400-e29b-41d4-a716-446655440003",
  "shopId": "550e8400-e29b-41d4-a716-446655440020",
  "variantId": "550e8400-e29b-41d4-a716-446655440010"
}
'
{
  "itemId": "550e8400-e29b-41d4-a716-446655440013",
  "planId": "550e8400-e29b-41d4-a716-446655440003",
  "planType": "MARKDOWN",
  "wasCreated": false
}

Authorizations

Authorization
string
header
required

User session token issued by NextAuth. For human users accessing Solya via the web application.

Body

application/json
domain
enum<string>
required

Decision domain driving the recommendation. 'restock' replenishes a shop from a supplier, 'rebalance' transfers stock between shops, 'markdown' marks down an item's price.

Available options:
restock,
rebalance,
markdown
shopId
string
required

Shop identifier as returned by GET /api/intelligence/decision-vectors. For restock this is the destination shop; for rebalance the source shop.

Minimum string length: 1
variantId
string
required

Product variant identifier as returned by GET /api/intelligence/decision-vectors.

Minimum string length: 1
discountPercent
number

Markdown discount percentage in the range [0, 100]. Required for the markdown domain; ignored for restock and rebalance.

Required range: 0 <= x <= 100
planId
string

Existing plan to append the item to. Required for rebalance and markdown domains. For restock: when omitted a new plan is auto-created using the brand and collection resolved from the decision vector.

quantity
integer

Number of units to restock or rebalance. Required for the restock and rebalance domains; ignored for markdown.

Required range: x <= 9007199254740991

Response

Successful response

data
object
required
success
enum<boolean>
required
Available options:
true