SelSup Developers

公共的 API · 参考 API

收费

费用结尾点,包括精确的路线,参数,请求机构和可扩展的响应方案.

1 终点/api/billing/find稳定机器可读的描述 ↗
{ }

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

/api/billing/find

准备使用的工作流程

准备使用的工作流程

01

开始使用 发票

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

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

数据模型

数据结构

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

Billing17 字段
idinteger · int64

Id.

namestring

姓名.

productIdinteger · int64

产品身份证

itemIdinteger · int64

标签:

orderIdinteger · int64

订单身份证.

pricenumber · double

价格.

volumeinteger · int32

音量.

weightinteger · int32

体重.

quantityinteger · int32

量量.

totalPricenumber · double

总价格.

tariffIdinteger · int64

关税证.

linkedClientIdinteger · int64

链接的客户身份证.

clientIdinteger · int64

客户身份证.

fromstring · date-time

没有.

tostring · date-time

为了.

datestring · date-time

约会.

userIdinteger · int64

用户身份证

FindResponseBilling1 字段
rowsBilling[]

排列.

错误合同

如何返回应用错误

编程的代码在每个地方都相同,而用户面向的消息由服务器翻译. 建立在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/billing/find
读取访问的标志

使用 GET /api/billing/find.获得账单操作

查询参数

字段类型必填描述
from string · date-time 没有.
to string · date-time 为了.
limit integer · int32 限制.
page integer · int32 页面.
count boolean 伯爵.
sortBy string 排序了.
ascending boolean 升高.
curl --request GET 'https://api.selsup.ru/api/billing/find?limit=50&page=1' \
  --header 'Authorization: YOUR_API_TOKEN'

成功的反应

200
对象场 FindResponseBilling
字段类型必填描述
rows Billing[] 排列.
阵列项结构 Billing
字段类型必填描述
id integer · int64 Id.
name string 姓名.
productId integer · int64 产品身份证
itemId integer · int64 标签:
orderId integer · int64 订单身份证.
price number · double 价格.
volume integer · int32 音量.
weight integer · int32 体重.
quantity integer · int32 量量.
totalPrice number · double 总价格.
tariffId integer · int64 关税证.
linkedClientId integer · int64 链接的客户身份证.
clientId integer · int64 客户身份证.
from string · date-time 没有.
to string · date-time 为了.
date string · date-time 约会.
userId integer · int64 用户身份证
{
  "rows": "string"
}
错误5

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

401auth_required
需要进行认证

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

400error_access_denied
拒绝访问

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

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

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

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

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

400error_subscription_expired
你的费率已经过期。支付关税以继续使用该服务。

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

Authorization

测试请求的标志

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

试一试

实际请求参数

现场API响应

发送请求查看SelSup的响应.