Skip to main content

Quote Secondary Market Purchase

Prices a buy of quantity tokens from one secondary-market listing without submitting it. The price comes off the listing named by deal_id, because two listings of the same token can sell at different prices. Both sides of the trade are reported: the buyer pays the buy-order fee on top of the listing amount (total), the seller pays the sell-order fee out of it (seller_proceeds). The fee is resolved and applied exactly as Buy On Secondary Market does it.

A listing is bought whole, so to quote the buy you will submit, send the listing's own quantity (from List Token Listings). The quote is refused when the listing is not open, the token is not listed or the token is closed to the secondary market.

Required permission: purchase:view

Request​

GET /v2/users/purchases/tokens/{token_id}/secondary-market/quote

Parameters​

NameTypeInDescription
token_idstringpathRequired. Token ID
deal_idintegerqueryRequired. Listing (deal) ID
quantityintegerqueryRequired. Whole tokens to price, at least 1

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>

Example​

curl --request GET \
--url '{{baseUrl}}/v2/users/purchases/tokens/68ae06cfcccf4e8fc19362d1/secondary-market/quote?deal_id=13&quantity=10' \
--header 'Authorization: Bearer <access_token>'

Response​

{
"token_id": "68ae06cfcccf4e8fc19362d1",
"market_type": "secondary",
"deal_id": 13,
"quantity": 10,
"unit_price": "12",
"subtotal": "120",
"buyer_fee": {
"percentage": "1.5",
"amount": "1.8"
},
"total": "121.8",
"seller_fee": {
"percentage": "1",
"amount": "1.2"
},
"seller_proceeds": "118.8",
"currency": {
"symbol": "VUSD",
"decimal": 6,
"address": "0xf2d90affe805280c004d0135343f2cbd7c96ce98"
}
}

Response Fields​

FieldTypeDescription
token_idstringToken priced
market_typestringAlways secondary on this endpoint
deal_idintegerListing priced
quantityintegerQuantity priced
unit_pricestringThe listing's price for one token
subtotalstringunit_price × quantity: the listing amount before fees
buyer_fee.percentagestringTotal buy-order fee rate (owner, platform owner and node summed)
buyer_fee.amountstringBuy-order fee amount: the sum of each recipient's share, each truncated to the currency's decimals
totalstringWhat the buyer pays: subtotal + buyer_fee.amount
seller_fee.percentagestringTotal sell-order fee rate the seller pays
seller_fee.amountstringSell-order fee amount
seller_proceedsstringWhat the seller receives: subtotal − seller_fee.amount
currency.symbolstringSymbol of the payment currency every amount is in
currency.decimalintegerDecimals of the payment currency
currency.addressstringContract address of the payment currency

All amounts are decimal strings; see Amounts and Percentages.

Errors​

StatusCodeDescription
40010015Validation failed (deal_id or quantity missing or invalid) — see details
40010016token_id is not a valid 24-character hex id
40011001No listing with this deal_id on this token (domain 11, secondary market not found)
40011002The listing is not open (domain 11, secondary market is not active)
40010001Token not found (domain 5)
40010011Token is not listed (domain 5, token is not active)
40010012Token is not open to the secondary market (domain 5)
50010000Unexpected server-side failure

See Errors for the error format and common codes.