外观
储值充值
POST /members/{memberId}/recharges
| 权限范围 | 幂等 | operationId |
|---|---|---|
finance:write | channel + externalPaymentId | Recharges_recharge |
外部平台(淘宝、闲鱼、抖音、线下……)收到钱后,把钱充进会员的神运储值。 channel + externalPaymentId 在本店唯一,重复请求返回首次的充值。入账资金账户取店铺在应用设置里选的「开放平台充值入账账户」。 受店铺设置的「每日充值上限」「单笔上限」约束。
幂等单号:channel + externalPaymentId。同号同参数重复请求返回首次结果(响应头 X-Sy-Replayed: true),同号不同参数返回 409 OUT_BIZ_NO_CONFLICT。
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
memberId | 路径 | string | 是 | 会员 ID(mb_…) |
请求体
CreateRecharge
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
amountCents | integer | 是 | 金额(分)(≥1,≤1000000000) |
channel | string | 是 | 外部渠道:taobao / xianyu / douyin / pdd / meituan / wechat / alipay / offline / other,或自定义(小写字母数字下划线)(格式 [a-z0-9_]{1,32}) |
externalPaymentId | string | 是 | 外部平台收款单号;channel + externalPaymentId 在本店唯一(格式 [\x21-\x7E]{1,64}) |
triggerActivities | boolean | 是否参与充值返利活动(默认 true);成长值、成就照常计算 | |
fundAccountId | string | 入账资金账户(覆盖应用设置里的默认账户,可空)(fa_…) | |
remark | string | 备注(≤200 字) |
示例
js
const res = await client.post("/members/mb_1sKVu55B92JYxO8sHKyX1Cd/recharges", {
"amountCents": 10000,
"channel": "taobao",
"externalPaymentId": "TB-20261130-0001",
"triggerActivities": true,
"fundAccountId": "fa_1We9UOafvDFUAD2ds71Oc6x",
"remark": "淘宝订单 TB-20261130-0001"
});http
POST /open/v1/members/mb_1sKVu55B92JYxO8sHKyX1Cd/recharges HTTP/1.1
Host: api.sybb.pw
Authorization: SY-HMAC-SHA256 Credential=ak_…, Timestamp=1796035200, Nonce=…, Signature=…
Content-Type: application/json
{
"amountCents": 10000,
"channel": "taobao",
"externalPaymentId": "TB-20261130-0001",
"triggerActivities": true,
"fundAccountId": "fa_1We9UOafvDFUAD2ds71Oc6x",
"remark": "淘宝订单 TB-20261130-0001"
}响应 200:
json
{
"rechargeId": "rc_1qBBpfxbnLlLiHX5I50ot4F",
"memberId": "mb_1sKVu55B92JYxO8sHKyX1Cd",
"amountCents": 10000,
"refundedCents": 0,
"refundableCents": 10000,
"status": "succeeded",
"channel": "taobao",
"externalPaymentId": "TB-20261130-0001",
"createdAt": "2026-11-30T20:15:00+08:00"
}响应
RechargeView
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
rechargeId | string | 充值 ID(rc_…) | |
memberId | string | 会员 ID(mb_…) | |
amountCents | integer | 是 | 金额(分) |
refundedCents | integer | 是 | 金额(分) |
refundableCents | integer | 是 | 金额(分) |
status | string | succeeded 已到账 / partially_refunded 部分退款 / refunded 已全额退款 | |
channel | string | 外部渠道 | |
externalPaymentId | string | 外部平台收款单号 | |
createdAt | string | 时间(RFC 3339) |
错误
| HTTP | 错误码 | 含义 |
|---|---|---|
| 404 | NOT_FOUND | 资源不存在或不属于本店 |
| 409 | OUT_BIZ_NO_CONFLICT | 这个业务单号已用于参数不同的请求 |
| 409 | DAILY_LIMIT_EXCEEDED | 超过店铺为应用设置的每日或单笔上限 |
| 422 | BUSINESS_RULE | 业务规则不满足 |
签名、权限、限流等通用错误见错误处理。