SelSup Developers

公共的 API · 参考 API

计算器

计算器的终点,包括精确的路线,参数,请求机器和可扩展的响应方案.

2 终点/api/calculator稳定机器可读的描述 ↗
{ }

通过可编辑的独立合同来支持本页面. 在生产使用之前,验证使用测试数据的写作操作.

/api/calculator

准备使用的工作流程

准备使用的工作流程

01

开始使用计算器

使用专用API代币,首先验证测试数据的读取操作.

  1. 保存代币服务器侧,然后将其发送到Authorization标题中.
  2. 检查所需参数,并扩大请求或响应方案.
  3. 在应用错误中处理HTTP状态和稳定的error字段.

数据模型

数据结构

模型在此列出一次,并且可以直接从使用它们的终端点扩展.

UnitCalculator31 字段
purchasePricenumber · double

买价.

purchasePercentnumber · double

购买百分比.

widthinteger · int32

宽度.

heightinteger · int32

高.

depthinteger · int32

深度.

categoryIdinteger · int64

类别的ID.

servicestring

服务.

salePricenumber · double

售价.

commissionnumber · double

委员会.

wildberriesFbsBaseCommissionnumber · double

野生果联邦调查局基地委员会.

wildberriesFbsPlannedTransferHoursnumber · double

野生果联邦调查局计划转移时间.

wildberriesFbsTransferNormHoursnumber · double

果公司的联邦调查局转移正常时间.

wildberriesFbsSpeedCoefficientnumber · double

果的FBS速度系数.

wildberriesFbsEffectiveCommissionnumber · double

野生果联邦调查局有效委员会.

wildberriesFbsTransferHoursSourcestring

果公司的转移时间来源:

wildberriesFbsSpeedCoefficientValidFromstring · date

野生果FBS速度系数有效

wildberriesFbsSpeedCoefficientSourcestring

果的FBS速度系数来源.

logisticnumber · double

后勤.

warehouseRationumber · double

仓库比例.

logisticRationumber · double

后勤比例.

ktrnumber · double

现在,我们要去.

expensesnumber · double

费用.

newPriceByRubnumber · double

的新价格.

newPriceByMarginalitynumber · double

根据边缘性,新价格.

desiredMarginPercentnumber · double

预期的利率.

desiredProfitRubnumber · double

想要的利.

profitnumber · double

利.

markUpnumber · double

标记起来.

marginalitynumber · double

边缘化.

organizationIdinteger · int64

组织身份证.

taxRatenumber · double

税率.

错误合同

如何返回应用错误

编程的代码在每个地方都相同,而用户面向的消息由服务器翻译. 建立在error周围的应用逻辑,仅用于显示.

鱼类

稳定机器可读的代码用于集成逻辑.

鱼类

在API代币用户语言中显示准备的消息.

鱼类

服务器在本地化消息模板中插入的值.

localMessage使用了 API代币的用户的lang字段.文档语言和 Accept-Language标题不会改变它;当用户没有语言配置时,使用俄语.

RU用户位置是 ru
{
  "error": "error_brand_already_exists",
  "localMessage": "Бренд Base уже существует",
  "params": {
    "name": "Base"
  }
}
CN中文 (cn)
{
  "error": "error_brand_already_exists",
  "localMessage": "品牌 Base 已经存在",
  "params": {
    "name": "Base"
  }
}

终点

终点

GET

/api/calculator/profit
读取访问的标志

使用GET/api/calculator/profit.的利

查询参数

字段类型必填描述
purchasePrice number · double 买价.
purchasePercent number · double 购买百分比.
width integer · int32 宽度.
height integer · int32 高.
depth integer · int32 深度.
categoryId integer · int64 类别的ID.
service stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC 服务.
salePrice number · double 售价.
commission number · double 委员会.
wildberriesFbsBaseCommission number · double 野生果联邦调查局基地委员会.
wildberriesFbsPlannedTransferHours number · double 野生果联邦调查局计划转移时间.
wildberriesFbsTransferNormHours number · double 果公司的联邦调查局转移正常时间.
wildberriesFbsSpeedCoefficient number · double 果的FBS速度系数.
wildberriesFbsEffectiveCommission number · double 野生果联邦调查局有效委员会.
wildberriesFbsTransferHoursSource string 果公司的转移时间来源:
wildberriesFbsSpeedCoefficientValidFrom string · date 野生果FBS速度系数有效
wildberriesFbsSpeedCoefficientSource string 果的FBS速度系数来源.
logistic number · double 后勤.
warehouseRatio number · double 仓库比例.
logisticRatio number · double 后勤比例.
ktr number · double 现在,我们要去.
expenses number · double 费用.
newPriceByRub number · double 的新价格.
newPriceByMarginality number · double 根据边缘性,新价格.
desiredMarginPercent number · double 预期的利率.
desiredProfitRub number · double 想要的利.
profit number · double 利.
markUp number · double 标记起来.
marginality number · double 边缘化.
organizationId integer · int64 组织身份证.
taxRate number · double 税率.
curl --request GET 'https://api.selsup.ru/api/calculator/profit' \
  --header 'Authorization: YOUR_API_TOKEN'

成功的反应

200
对象场 UnitCalculator
字段类型必填描述
purchasePrice number · double 买价.
purchasePercent number · double 购买百分比.
width integer · int32 宽度.
height integer · int32 高.
depth integer · int32 深度.
categoryId integer · int64 类别的ID.
service stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC 服务.
salePrice number · double 售价.
commission number · double 委员会.
wildberriesFbsBaseCommission number · double 野生果联邦调查局基地委员会.
wildberriesFbsPlannedTransferHours number · double 野生果联邦调查局计划转移时间.
wildberriesFbsTransferNormHours number · double 果公司的联邦调查局转移正常时间.
wildberriesFbsSpeedCoefficient number · double 果的FBS速度系数.
wildberriesFbsEffectiveCommission number · double 野生果联邦调查局有效委员会.
wildberriesFbsTransferHoursSource string 果公司的转移时间来源:
wildberriesFbsSpeedCoefficientValidFrom string · date 野生果FBS速度系数有效
wildberriesFbsSpeedCoefficientSource string 果的FBS速度系数来源.
logistic number · double 后勤.
warehouseRatio number · double 仓库比例.
logisticRatio number · double 后勤比例.
ktr number · double 现在,我们要去.
expenses number · double 费用.
newPriceByRub number · double 的新价格.
newPriceByMarginality number · double 根据边缘性,新价格.
desiredMarginPercent number · double 预期的利率.
desiredProfitRub number · double 想要的利.
profit number · double 利.
markUp number · double 标记起来.
marginality number · double 边缘化.
organizationId integer · int64 组织身份证.
taxRate number · double 税率.
{
  "purchasePrice": 1,
  "purchasePercent": 1,
  "width": 1,
  "height": 1,
  "depth": 1,
  "categoryId": 1001
}
错误12

应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑

401auth_required
需要进行认证

Authorization 缺失,空,或包含无效的代币.

400error_access_denied
拒绝访问

代币存在,但它的作用不能执行这个操作.

500error_unknown
发生了一个未知的错误。如果该问题再次发生,请联系支持

节省请求时间和联系支持;不要盲目重新尝试突变.

400error_category_not_found
未找到类别

应用逻辑中使用稳定的error_category_not_found代码;localMessage包含上述翻译.

400error_depth_not_found
未指定深度

应用逻辑中使用稳定的error_depth_not_found代码;localMessage包含上述翻译.

400error_height_not_found
未指定高度

应用逻辑中使用稳定的error_height_not_found代码;localMessage包含上述翻译.

400error_no_client
没有找到该客户或已被删除。写信给支持部门

应用逻辑中使用稳定的error_no_client代码;localMessage包含上述翻译.

400error_organization_not_found
没有发现任何组织

应用逻辑中使用稳定的error_organization_not_found代码;localMessage包含上述翻译.

400error_purchase_percent_not_found
未指定购买百分比

应用逻辑中使用稳定的error_purchase_percent_not_found代码;localMessage包含上述翻译.

400error_sale_price_not_found
未指定销售价格

应用逻辑中使用稳定的error_sale_price_not_found代码;localMessage包含上述翻译.

400error_service_not_found
未选择市场

应用逻辑中使用稳定的error_service_not_found代码;localMessage包含上述翻译.

400error_width_not_found
未指定宽度

应用逻辑中使用稳定的error_width_not_found代码;localMessage包含上述翻译.

GET

价格

/api/calculator/price
读取访问的标志

使用GET/api/calculator/price.的价格

查询参数

字段类型必填描述
purchasePrice number · double 买价.
purchasePercent number · double 购买百分比.
width integer · int32 宽度.
height integer · int32 高.
depth integer · int32 深度.
categoryId integer · int64 类别的ID.
service stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC 服务.
salePrice number · double 售价.
commission number · double 委员会.
wildberriesFbsBaseCommission number · double 野生果联邦调查局基地委员会.
wildberriesFbsPlannedTransferHours number · double 野生果联邦调查局计划转移时间.
wildberriesFbsTransferNormHours number · double 果公司的联邦调查局转移正常时间.
wildberriesFbsSpeedCoefficient number · double 果的FBS速度系数.
wildberriesFbsEffectiveCommission number · double 野生果联邦调查局有效委员会.
wildberriesFbsTransferHoursSource string 果公司的转移时间来源:
wildberriesFbsSpeedCoefficientValidFrom string · date 野生果FBS速度系数有效
wildberriesFbsSpeedCoefficientSource string 果的FBS速度系数来源.
logistic number · double 后勤.
warehouseRatio number · double 仓库比例.
logisticRatio number · double 后勤比例.
ktr number · double 现在,我们要去.
expenses number · double 费用.
newPriceByRub number · double 的新价格.
newPriceByMarginality number · double 根据边缘性,新价格.
desiredMarginPercent number · double 预期的利率.
desiredProfitRub number · double 想要的利.
profit number · double 利.
markUp number · double 标记起来.
marginality number · double 边缘化.
organizationId integer · int64 组织身份证.
taxRate number · double 税率.
curl --request GET 'https://api.selsup.ru/api/calculator/price' \
  --header 'Authorization: YOUR_API_TOKEN'

成功的反应

200
对象场 UnitCalculator
字段类型必填描述
purchasePrice number · double 买价.
purchasePercent number · double 购买百分比.
width integer · int32 宽度.
height integer · int32 高.
depth integer · int32 深度.
categoryId integer · int64 类别的ID.
service stringNONE, WILDBERRIES, OZON, YANDEX_MARKET, FAMILIYA, NATIONAL_CATALOG, ALIEXPRESS, OTHER, MOY_SKLAD, SBER_MEGA_MARKET, CISLINK, ONE_C, AVITO, LEROY_MERLIN, DETMIR, KAZAN_EXPRESS, EVOTOR, WEBASYST, AMAZON, EBAY, SIMALAND, INSALES, LAMODA, OZON_PERFORMANCE, WALMART, GOOGLE, YANDEX_DISC, EMAIL, WOOCOMMERCE, MAGNIT, OPENCART, M_VIDEO, TAKEALOT, UZUM, SHOPIFY, MAKRO, YANDEX_KIT, BOB_SHOP, KASPI, DIADOC 服务.
salePrice number · double 售价.
commission number · double 委员会.
wildberriesFbsBaseCommission number · double 野生果联邦调查局基地委员会.
wildberriesFbsPlannedTransferHours number · double 野生果联邦调查局计划转移时间.
wildberriesFbsTransferNormHours number · double 果公司的联邦调查局转移正常时间.
wildberriesFbsSpeedCoefficient number · double 果的FBS速度系数.
wildberriesFbsEffectiveCommission number · double 野生果联邦调查局有效委员会.
wildberriesFbsTransferHoursSource string 果公司的转移时间来源:
wildberriesFbsSpeedCoefficientValidFrom string · date 野生果FBS速度系数有效
wildberriesFbsSpeedCoefficientSource string 果的FBS速度系数来源.
logistic number · double 后勤.
warehouseRatio number · double 仓库比例.
logisticRatio number · double 后勤比例.
ktr number · double 现在,我们要去.
expenses number · double 费用.
newPriceByRub number · double 的新价格.
newPriceByMarginality number · double 根据边缘性,新价格.
desiredMarginPercent number · double 预期的利率.
desiredProfitRub number · double 想要的利.
profit number · double 利.
markUp number · double 标记起来.
marginality number · double 边缘化.
organizationId integer · int64 组织身份证.
taxRate number · double 税率.
{
  "purchasePrice": 1,
  "purchasePercent": 1,
  "width": 1,
  "height": 1,
  "depth": 1,
  "categoryId": 1001
}
错误12

应用错误通常以 JSON, error,localMessage和 params为回归. 如何返回应用错误 ↑

401auth_required
需要进行认证

Authorization 缺失,空,或包含无效的代币.

400error_access_denied
拒绝访问

代币存在,但它的作用不能执行这个操作.

500error_unknown
发生了一个未知的错误。如果该问题再次发生,请联系支持

节省请求时间和联系支持;不要盲目重新尝试突变.

400error_category_not_found
未找到类别

应用逻辑中使用稳定的error_category_not_found代码;localMessage包含上述翻译.

400error_depth_not_found
未指定深度

应用逻辑中使用稳定的error_depth_not_found代码;localMessage包含上述翻译.

400error_fill_purchase_price
无采购价格

应用逻辑中使用稳定的error_fill_purchase_price代码;localMessage包含上述翻译.

400error_height_not_found
未指定高度

应用逻辑中使用稳定的error_height_not_found代码;localMessage包含上述翻译.

400error_no_client
没有找到该客户或已被删除。写信给支持部门

应用逻辑中使用稳定的error_no_client代码;localMessage包含上述翻译.

400error_organization_not_found
没有发现任何组织

应用逻辑中使用稳定的error_organization_not_found代码;localMessage包含上述翻译.

400error_purchase_percent_not_found
未指定购买百分比

应用逻辑中使用稳定的error_purchase_percent_not_found代码;localMessage包含上述翻译.

400error_service_not_found
未选择市场

应用逻辑中使用稳定的error_service_not_found代码;localMessage包含上述翻译.

400error_width_not_found
未指定宽度

应用逻辑中使用稳定的error_width_not_found代码;localMessage包含上述翻译.

Authorization

测试请求的标志

代币存储在本浏览器的本地存储库中,只会在要求的Authorization头上发送到 api.selsup.ru.

试一试

实际请求参数

现场API响应

发送请求查看SelSup的响应.