直达内容

创建或者检查支持

POST /payments

这个接口主要实现了两个功能:

  1. 生成一个多签支付的 code, 相关注意事项
    a. 需要授权才能访问
    b. 如果 trace_id 不是自己的,会返回 403
    c. 如果已经支持 state 值是 paid, 未支付是 pending

  2. 或者检查支付参数是否正确。
    a. 不需要授权访问
    b. 如果已经支持 state 值是 paid, 未支付是 pending

API 端点 URL

 https://api.mixin.one/payments

授权和其他选项

授权
Authorized
限制No limitation

生成多签支持的请求参数

请求体

{
"asset_id": "资产的 uuid",
"amount": "金额, 例如: "0.01"",
"trace_id": "防止重复转帐或提现",
"memo": "可选,最大 200 字符",
"opponent_multisig": {
"receivers": "接收者的数组, 最大 256",
"threshold": "数字,需要小于等于接收者",
},
}

检测支付参数及状态

请求体

{
"asset_id": "资产的 uuid",
"amount": "金额, 例如: "0.01"",
"trace_id": "防止重复转帐或提现",
"opponent_id": "可选,接收者 uuid",
"address_id": "可选,地址的 uuid",
"destination": "提现地址",
"tag": "可选, 提现备注"
}

请求示例

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/payments --data {"asset_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","amount":"0.01","trace_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","memo":"","opponent_multisig":{"receivers":["c6d0c728-2624-429b-8e0d-d9d19b6592fa","c6d0c728-2624-429b-8e0d-d9d19b6592fa"],"threshold":1}}
{
"data": {
"type": "payment",
"payment_id": "773e5e77-4107-45c2-b648-8fc722ed77f5",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "-10",
"trace_id": "7c67e8e8-b142-488b-80a3-61d4d29c90bf",
"memo": "hello",
"threshold": 2,
"receivers": ["7c67e8e8-b142-488b-80a3-61d4d29c90bf", "7c67e8e8-b142-488b-80a3-61d4d29c90bf", "7c67e8e8-b142-488b-80a3-61d4d29c90bf"],
"created_at": "2017-12-23T18:23:26.996149Z",
}
}

请求示例

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/payments --data {"asset_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","amount":"0.01","trace_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","address_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa"}

请求示例

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/payments --data {"asset_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","amount":"0.01","trace_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","opponent_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa"}

请求示例

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/payments --data {"asset_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","amount":"0.01","trace_id":"c6d0c728-2624-429b-8e0d-d9d19b6592fa","destination":"3GqjTwAwWyJ2YZ3v1vYPCkC4SzwVHLgivj","key":""}