准备接受买单
curl --request POST \
--url https://dev-api.renaiss.xyz/v2/marketplace/sell/prepare \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"tokenId": "9007199254740993",
"walletAddress": "0x1111111111111111111111111111111111111111",
"expiresAt": null,
"bidOrderId": "12345678-1234-4123-8123-123456789abc"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '9007199254740993',
walletAddress: '0x1111111111111111111111111111111111111111',
expiresAt: null,
bidOrderId: '12345678-1234-4123-8123-123456789abc'
})
};
fetch('https://dev-api.renaiss.xyz/v2/marketplace/sell/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev-api.renaiss.xyz/v2/marketplace/sell/prepare"
payload = {
"tokenId": "9007199254740993",
"walletAddress": "0x1111111111111111111111111111111111111111",
"expiresAt": None,
"bidOrderId": "12345678-1234-4123-8123-123456789abc"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "sell",
"tokenId": "<string>",
"sellerWalletAddress": "<string>",
"quote": {
"sellerReceivesInUsdt": "<string>",
"platformFeeInUsdt": "<string>",
"totalPriceInUsdt": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bidderWalletAddress": "<string>",
"amountInUsdt": "<string>"
},
"typedData": {
"domain": {},
"types": {},
"primaryType": "<string>",
"message": {}
},
"payload": {
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"collectibleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "<string>"
}
}
}Malformed JSON in request body{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_CREDENTIAL"
}{
"error": "Only the collectible owner can accept a bid",
"code": "UNAUTHORIZED"
}{
"error": "Collectible not found",
"code": "COLLECTIBLE_NOT_FOUND"
}Payload Too Large{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server Error订单
准备接受买单
选择一笔资金充足的买单,获取待卖家核对和签名的卖单。 调试面板使用测试网请求格式。当前主网字段见本页说明。
POST
/
v2
/
marketplace
/
sell
/
prepare
准备接受买单
curl --request POST \
--url https://dev-api.renaiss.xyz/v2/marketplace/sell/prepare \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"tokenId": "9007199254740993",
"walletAddress": "0x1111111111111111111111111111111111111111",
"expiresAt": null,
"bidOrderId": "12345678-1234-4123-8123-123456789abc"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '9007199254740993',
walletAddress: '0x1111111111111111111111111111111111111111',
expiresAt: null,
bidOrderId: '12345678-1234-4123-8123-123456789abc'
})
};
fetch('https://dev-api.renaiss.xyz/v2/marketplace/sell/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev-api.renaiss.xyz/v2/marketplace/sell/prepare"
payload = {
"tokenId": "9007199254740993",
"walletAddress": "0x1111111111111111111111111111111111111111",
"expiresAt": None,
"bidOrderId": "12345678-1234-4123-8123-123456789abc"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "sell",
"tokenId": "<string>",
"sellerWalletAddress": "<string>",
"quote": {
"sellerReceivesInUsdt": "<string>",
"platformFeeInUsdt": "<string>",
"totalPriceInUsdt": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bidderWalletAddress": "<string>",
"amountInUsdt": "<string>"
},
"typedData": {
"domain": {},
"types": {},
"primaryType": "<string>",
"message": {}
},
"payload": {
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"collectibleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "<string>"
}
}
}Malformed JSON in request body{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_CREDENTIAL"
}{
"error": "Only the collectible owner can accept a bid",
"code": "UNAUTHORIZED"
}{
"error": "Collectible not found",
"code": "COLLECTIBLE_NOT_FOUND"
}Payload Too Large{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server ErrorexpiresAt: null 可使用默认到期时间。主网更新前,请同时省略 expiresAt 和 expiresInSeconds 以使用主网默认值。请求
需要开发者密钥
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | MATCHING_BID_PERMIT_NOT_FOUND | error | Stored bid payload is invalid无法接受该买单。请刷新买单列表,不要重发原请求。 |
400 | WRONG_REQUEST_PARAMS | error | Invalid marketplace request: tokenId: RequiredInvalid marketplace request: expiresAt: RequiredexpiresAt must be null or a future UTC timestamp within 180 days检查报错中提到的字段。要使用默认有效期,请传入 "expiresAt": null。 |
400 | 无错误码 | text/plain | Malformed JSON in request body |
401 | API_AUTH_INVALID_CREDENTIAL | error | Invalid authentication credential开发者密钥格式错误、未知、已过期或已撤销。请核对并更换密钥。 |
401 | API_AUTH_MISSING_CREDENTIAL | error | Required authentication credential is missing请在 x-builder-api-key 请求头中提供开发者密钥。 |
403 | API_AUTH_CREDENTIAL_NOT_ALLOWED | error | Credential is not allowed by this policy此路由只接受开发者密钥。移除 Authorization 请求头及其他凭据,再重新发送。 |
403 | GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API | error | This builder checks out on its own surface, not on the public API此密钥无法用于当前 API。请联系 Renaiss,无需重试。 |
403 | UNAUTHORIZED | error | Only the collectible owner can accept a bid只有藏品所有者可以接受买单。请使用持有藏品的钱包。 |
404 | COLLECTIBLE_NOT_FOUND | error | Collectible not found代币 ID 未知或藏品在该 API 中不可用。请核对 ID,不要用同一 ID 重试。 |
404 | ORDER_NOT_FOUND | error | Bid not found该买单对当前藏品无效、已过期或不存在。请刷新买单列表。 |
413 | 无错误码 | text/plain | Payload Too Large |
429 | API_AUTH_RATE_LIMITED | error | Authentication rate limit exceeded已达到密钥的请求频率上限。稍候再以较低频率重试。 |
500 | API_AUTH_ERROR | error | Internal server error |
500 | FUNCTION_ERROR | error | Internal server error |
500 | 无错误码 | text/plain | Internal Server Error |
500 | COLLECTIBLE_GET_FAILED | error | Internal server error若问题持续出现,请将 x-request-id 提供给 Renaiss。 |
授权
请求体
application/json