提交已签名的买单接受请求
curl --request POST \
--url https://dev-api.renaiss.xyz/v2/marketplace/sell \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>",
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '9007199254740993',
askData: {
salt: '<string>',
deadline: '<string>',
usdcAmount: '<string>',
owner: '<string>',
tokenId: '9007199254740993'
},
askSignature: '<string>',
bidOrderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://dev-api.renaiss.xyz/v2/marketplace/sell', 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"
payload = {
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>",
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "ask",
"orderId": "<string>",
"status": "ACTIVE",
"executed": true,
"executionTxHash": "<string>",
"matchedOrderId": "<string>"
}Malformed JSON in request body{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_CREDENTIAL"
}{
"error": "Invalid wallet action proof",
"code": "API_AUTH_INVALID_ACTION"
}{
"error": "Collectible not found",
"code": "COLLECTIBLE_NOT_FOUND"
}Payload Too Large{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server Error订单
接受买单
提交卖家已签名的订单和选定的买单 ID,接受该笔出价。 调试面板使用测试网请求格式。当前主网字段见本页说明。
POST
/
v2
/
marketplace
/
sell
提交已签名的买单接受请求
curl --request POST \
--url https://dev-api.renaiss.xyz/v2/marketplace/sell \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>",
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '9007199254740993',
askData: {
salt: '<string>',
deadline: '<string>',
usdcAmount: '<string>',
owner: '<string>',
tokenId: '9007199254740993'
},
askSignature: '<string>',
bidOrderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://dev-api.renaiss.xyz/v2/marketplace/sell', 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"
payload = {
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>",
"bidOrderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "ask",
"orderId": "<string>",
"status": "ACTIVE",
"executed": true,
"executionTxHash": "<string>",
"matchedOrderId": "<string>"
}Malformed JSON in request body{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_CREDENTIAL"
}{
"error": "Invalid wallet action proof",
"code": "API_AUTH_INVALID_ACTION"
}{
"error": "Collectible not found",
"code": "COLLECTIBLE_NOT_FOUND"
}Payload Too Large{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server ErrortokenId,并从 payload 中复制 askData 和 bidOrderId。提交时附上卖家的 askSignature。在测试网上,请提交此处所示的顶层 tokenId。主网更新前,请将准备响应的 payload.collectibleId 作为主网请求的顶层 collectibleId。签名订单数据应与准备响应保持一致。请求
需要开发者密钥和钱包签名
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | ASK_HAS_ALREADY_EXPIRED | error | Ask has already expired接受授权在处理期间过期。请延长有效期并重新准备、签名。 |
400 | ASK_TOKEN_ID_MISMATCH | error | Signed order token ID differs from the submitted token IDAsk token ID does not match the collectible核对 tokenId 与 askData.tokenId 是否指向同一张卡牌。两个字段都应取自同一次准备响应。 |
400 | BID_HAS_ALREADY_EXPIRED | error | Bid has already expired买单已过期。请刷新买单列表,不要重发原请求。 |
400 | BID_LOWER_THAN_ASK | error | Bid price is lower than ask price买单价格低于已签署的卖价。请重新准备并签名。 |
400 | BID_TOKEN_ID_MISMATCH | error | Bid token ID does not match the collectible该买单对应其他藏品。请刷新买单列表,不要重发原请求。 |
400 | COLLECTIBLE_ONCHAIN_OWNER_MISMATCH | error | {onchainOwner} is the on chain owner.该钱包不是链上持有人。请使用持有藏品的钱包。 |
400 | INSUFFICIENT_ALLOWANCE | error | Insufficient token allowance for Permit2出价方未授权足够的 USDT。请刷新买单列表,不要重发原请求。 |
400 | INVALID_ASK_SIGNATURE | error | Ask signature is invalid接受买单的签名无效。请重新准备并让钱包签署新数据。 |
400 | INVALID_BID_FEE_BPS | error | Invalid bid fee BPS无法接受该买单。请刷新买单列表,不要重发原请求。 |
400 | INVALID_BID_SIGNATURE | error | Bid signature is invalid买单签名无法用于成交。请刷新买单列表,不要重发原请求。 |
400 | INVALID_OFFER_STATUS | error | Bid offer has expiredBid offer is no longer active买单已失效、过期或已使用。请刷新买单列表,不要重发原请求。 |
400 | INVALID_OFFER_TYPE | error | Order is not a bid offer提交的订单不是买单。请刷新买单列表,不要重发原请求。 |
400 | MATCHING_BID_PERMIT_NOT_FOUND | error | Stored bid payload is invalid无法接受该买单。请刷新买单列表,不要重发原请求。 |
400 | WRONG_REQUEST_PARAMS | error | Invalid marketplace request: tokenId: RequiredInvalid marketplace request: Expected object, received array请用 JSON 对象传入必填字段。复制准备响应顶层的 tokenId,并省略 collectibleId。 |
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 | API_AUTH_INVALID_ACTION | error | Invalid wallet action proof钱包签名与准备数据不符或已过期。请重新准备和签名。合约钱包的 isValidSignature 对准备数据的 EIP-712 摘要必须返回 0x1626ba7e。 |
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,无需重试。 |
404 | COLLECTIBLE_NOT_FOUND | error | Collectible not found代币 ID 未知或藏品在该 API 中不可用。请核对 ID,不要用同一 ID 重试。 |
404 | OFFER_NOT_FOUND | error | Bid offer 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_FAILEDMATCHING_BID_PERMIT_NOT_FOUNDASK_ORDER_INSERT_FAILEDACCEPT_OFFER_HANDLER_FAILEDEXECUTE_TRADE_INTERNAL_FAILEDOP_WALLET_NOT_AVAILABLETRANSACTION_VERIFICATION_FAILEDRPC_BLOCK_NUMBER_NOT_UPDATED | error | Internal server error重新提交前,请查询订单和钱包活动。 |
授权
请求体
application/json