Pricing
Preview a seller pricing rule
Calculates a hypothetical recommendation if you set or clear the direct rule. Returns saved configuration under current and hypothetical pricing under preview.
POST
/
pricing
/
previewRule
Preview a seller pricing rule
curl --request POST \
--url https://staging-platform.arcade.ai/v1/pricing/previewRule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": {
"type": "account"
},
"change": {
"operation": "set",
"rule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
}
},
"exampleProductId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {type: 'account'},
change: {
operation: 'set',
rule: {type: 'fixed', price: {amount: '<string>', currency: 'USD'}}
},
exampleProductId: '<string>'
})
};
fetch('https://staging-platform.arcade.ai/v1/pricing/previewRule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging-platform.arcade.ai/v1/pricing/previewRule"
payload = {
"target": { "type": "account" },
"change": {
"operation": "set",
"rule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
}
},
"exampleProductId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "previewRule",
"current": {
"ruleId": "<string>",
"revision": "<string>",
"configuredRule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
},
"target": {
"type": "account"
},
"targetStatus": "active"
},
"preview": {
"basis": {
"type": "product",
"productId": "<string>",
"quantity": 0
},
"effectiveRule": {
"source": {
"type": "account"
},
"rule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
}
},
"msrp": {
"status": "available",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"wholesale": {
"status": "available",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"resale": {
"status": "available",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"floor": {
"status": "below",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"calculatedResale": {
"amount": "<string>",
"currency": "<string>"
}
}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}Authorizations
Body
application/json
⌘I
Preview a seller pricing rule
curl --request POST \
--url https://staging-platform.arcade.ai/v1/pricing/previewRule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": {
"type": "account"
},
"change": {
"operation": "set",
"rule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
}
},
"exampleProductId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {type: 'account'},
change: {
operation: 'set',
rule: {type: 'fixed', price: {amount: '<string>', currency: 'USD'}}
},
exampleProductId: '<string>'
})
};
fetch('https://staging-platform.arcade.ai/v1/pricing/previewRule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging-platform.arcade.ai/v1/pricing/previewRule"
payload = {
"target": { "type": "account" },
"change": {
"operation": "set",
"rule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
}
},
"exampleProductId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "previewRule",
"current": {
"ruleId": "<string>",
"revision": "<string>",
"configuredRule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
},
"target": {
"type": "account"
},
"targetStatus": "active"
},
"preview": {
"basis": {
"type": "product",
"productId": "<string>",
"quantity": 0
},
"effectiveRule": {
"source": {
"type": "account"
},
"rule": {
"type": "fixed",
"price": {
"amount": "<string>",
"currency": "USD"
}
}
},
"msrp": {
"status": "available",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"wholesale": {
"status": "available",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"resale": {
"status": "available",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"floor": {
"status": "below",
"price": {
"amount": "<string>",
"currency": "<string>"
}
},
"calculatedResale": {
"amount": "<string>",
"currency": "<string>"
}
}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}{
"code": "<string>",
"status": 123,
"message": "<string>",
"data": {}
}