Skip to content

Price a real product with a rule, saved or not

POST
/api/v1/workspaces/{workspaceId}/channel-connections/{connectionId}/pricing/preview
curl --request POST \
--url https://api.crossmart.io/api/v1/workspaces/example/channel-connections/example/pricing/preview \
--header 'Content-Type: application/json' \
--data '{ "rule": { "adjustmentPercent": "15", "fixedAmount": "0", "rounding": "none", "floor": { "minMarginPercent": "30" }, "compareAt": "adjust", "fixedExchangeRate": "0.92" }, "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Without productId, the first product of the selection is priced.

workspaceId
required
string
connectionId
required
string
Media typeapplication/json
object
rule
required

The rule to try, saved or not; null shows catalog prices

object
adjustmentPercent
required

Markup (positive) or discount (negative), -90 to 500

string

Example

15
fixedAmount
required

Added after the percentage; may be negative

string

Example

0
rounding
required
string
Allowed values: none ending_99 ending_95 whole
floor
required
object
minMarginPercent
required

Never price below cost plus this percentage (0 to 1000)

string

Example

30
compareAt
required
string
Allowed values: adjust keep omit
fixedExchangeRate

Store-currency units per catalog-currency unit, used instead of the ECB daily rate. Only applies when the store sells in another currency than the workspace.

string
nullable

Example

0.92
productId

The product to price; defaults to the first selected product

string format: uuid
Media typeapplication/json
object
currencyCode
required
string
product
required
object
id
required
string format: uuid
title
required
string
variants
required
Array<object>
object
variantId
required
string format: uuid
title
required
string
basePrice
required
string
cost
required
string
nullable
resolved
required
object
price
required
string
compareAtPrice
required
string
nullable
source
required
string
Allowed values: override rule base
steps
required
Array<object>
object
kind
required
string
Allowed values: base conversion percent fixed_amount rounding floor override
label
required
string
amount
required

The price after this step

string
explanation
required
string
warnings
required
Array<string>
Allowed values: missing_cost below_floor compare_at_dropped clamped_to_zero no_exchange_rate
unitCost
required

The variant cost in the channel currency, converted like the price

string
nullable

Example

{
"currencyCode": "USD",
"variants": [
{
"title": "Blue / Large",
"basePrice": "89.00",
"resolved": {
"price": "102.99",
"source": "override",
"steps": [
{
"kind": "base",
"label": "+15%",
"amount": "102.35"
}
],
"explanation": "$89.00 → +15% → .99 = $102.99",
"warnings": [
"missing_cost"
]
}
}
]
}