curl --request POST \
--url https://omnicommerce.sg/api/v1/price-books \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"platform": "shopee",
"marginValue": 10
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({platform: 'shopee', marginValue: 10})
};
fetch('https://omnicommerce.sg/api/v1/price-books', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/price-books"
payload = {
"platform": "shopee",
"marginValue": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"rule": {}
}Create Price Book Rule
Create a marketplace price book rule for a platform (optional store and country). Does not change Omni product prices. Requires price_books:write.
expression is the buyer formula and replaces markup percent. price in that formula is the catalog price, not cost price. Without an expression, marginValue is the markup percent.
curl --request POST \
--url https://omnicommerce.sg/api/v1/price-books \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"platform": "shopee",
"marginValue": 10
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({platform: 'shopee', marginValue: 10})
};
fetch('https://omnicommerce.sg/api/v1/price-books', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/price-books"
payload = {
"platform": "shopee",
"marginValue": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"rule": {}
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Body
shopee, lazada, tiktok, shopify, whatsapp, zalora, amazon, ebay Markup percent applied to the catalog price. Ignored when expression is set.
0 <= x <= 500Required for session auth across multiple organizations. Optional for OAuth/API keys bound to one organization.
120Optional connected store ID. Null/omit applies to all stores for the platform.
200Optional country scope (name or code). Null/omit applies to all countries.
80Buyer formula. price is the catalog price. Supports arithmetic, percentages, CEILING, IF, and CURRENCY(rate, "USD"). Replaces markup percent.
500Defaults to currency_minor when omitted.
none, currency_minor, nearest_0_05, nearest_1 Optional ISO 4217 currency for currency_minor rounding.
3Whether the rule is active. Defaults to true.
Response
Price book rule created.