Skip to main content
POST
/
api
/
markdown-plans
/
{planId}
/
items
Add item to markdown plan
curl --request POST \
  --url https://app.solya.app/api/markdown-plans/{planId}/items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "discountPercent": 30,
  "shopId": "shop-uuid-paris-opera",
  "sizeId": "sz-uuid-001",
  "variantId": "var-uuid-001"
}
'
{
  "itemId": "mdi-uuid-002",
  "message": "Item added successfully",
  "success": true,
  "warnings": [
    {
      "message": "Discount is below the recommended minimum of 20% for this category",
      "ruleId": "MIN_MARKDOWN_RATE"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

planId
string
required

Markdown plan identifier

Minimum string length: 1

Body

application/json
discountPercent
number
required

Markdown discount rate as a percentage, e.g. 30 for 30%

shopId
string
required

Shop where the markdown applies

Minimum string length: 1
sizeId
string
required

Size identifier

Minimum string length: 1
variantId
string
required

Product variant identifier

Minimum string length: 1

Response

Successful response

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