latestOpenAPI 3.1.02026-08-106725.2 KB

09a793a37d89

API SERVICE

Buy energy 创建订单,购买能量

post/v1/order

Query parameters

quantityinteger required

delegation energy quantity,must >= 65000 购买的能量数,不小于65000

receiverstring required

Address to receive the resource 接收能量的地址

durationstring required

Duration of the order: allowed values are 1h 代理能量的最大持续时间,允许的值:1h

client_order_idstring

客户自定义订单ID(长度小于等于64),保持唯一性,传入之前的客户订单号,将不创建新订单

activateboolean

Whether activation is required. Defaults to true. If set to false and the recipient address is not activated, an error will be returned. 是否需要激活,默认为true,如果为false且接受能量地址未激活,则返回错误信息。

Headers

CF-ACCESS-KEYstring required

The API Access key as a string API所使用的KEY

CF-ACCESS-SIGNstring required

The Base64-encoded signature (see signing messages subsection for details) 使用HMAC SHA256哈希函数获得哈希值,再使用Base-64编码(请参阅签名)

CF-ACCESS-TIMESTAMPstring required

The UTC timestamp of your request .e.g : 2008-08-08T08:08:08.888Z 发起请求的时间(UTC),如:2008-08-08T08:08:08.888Z

Response

OK

codeinteger

成功返回0,其他均为错误

msgstring

发生错误时候返回的消息

sub_codestring
sub_msgstring