Digital Goods Store Operations
In the BLX client interface, the Digital Goods Store (DGS)
is referred to as the Marketplace
DGS Delisting
Delist a listed product. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsDelisting
goods
is the goods ID
Response: Refer to Create Transaction Response.
Example: Refer to DGS Delisting example.
DGS Delivery
Deliver a product. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsDelivery
purchase
is the purchase order IDdiscountNQT
is a discount (in NQT) off the selling price (optional, default is zero)goodsToEncrypt
is the product, a text or a hex string to be encrypted (optional ifgoodsData
provided)goodsIsText
isfalse
ifgoodsToEncrypt
is a hex string (optional)goodsData
is AES-encrypted (using Encrypt To)goodsToEncrypt
, up to 1000 bytes long (required only ifsecretPhrase
is omitted)goodsNonce
is the unique nonce associated with the encrypted data (required only ifsecretPhrase
is omitted)
Note: If the encrypted goods data is longer than 1000 bytes, use a prunable encrypted message to deliver the goods.
Response: Refer to Create Transaction Response.
Example: Refer to DGS Delivery example.
DGS Feedback
Give feedback about a purchased product after delivery. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsFeedback
purchase
is the purchase order IDmessage
is unencrypted (public) feedback text up to 1000 bytes
Note: The unencrypted message
parameter is used for public feedback.
Response: Refer to Create Transaction Response.
Example: Refer to DGS Feedback example.
DGS Listing
List a product in the DGS by creating a listing transaction. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsListing
name
is the name of the product up to 100 characters in lengthdescription
is a description of the product up to 1000 characters in lengthtags
are up to three comma separated keywords describing the product up to 100 characters in length (optional)quantity
is the quantity of the product for salepriceNQT
is the price (in NQT) of the product
Response: Refer to Create Transaction Response. The transaction ID is also the goods ID.
Example: Refer to DGS Listing example.
DGS Price Change
Change the price of a listed product. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsPriceChange
goods
is the goods ID of the productpriceNQT
is the new price of the product
Response: Refer to Create Transaction Response.
Example: Refer to DGS Price Change example.
DGS Purchase
Purchase a product for sale. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsPurchase
goods
is the goods ID of the productpriceNQT
is the price of the productquantity
is the quantity to be purchaseddeliveryDeadlineTimestamp
is the timestamp (in seconds since the genesis block) by which delivery of the product must occur
Response: Refer to Create Transaction Response. The transaction ID is also the purchase order ID.
Example: Refer to DGS Purchase example.
DGS Quantity Change
Change the quantity of a listed product. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsQuantityChange
goods
is the goods ID of the productdeltaQuantity
is the change in the quantity of the product for sale (use negative numbers for a decrease in quantity)
Response: Refer to Create Transaction Response.
Example: Refer to DGS Quantity Change example.
DGS Refund
Refund a purchase. POST only.
Request: Refer to Create Transaction Request for common parameters.
requestType
isdgsRefund
purchase
is the purchase order IDrefundNQT
is the amount (in NQT) of the refund
Response: Refer to Create Transaction Response.
Example: Refer to DGS Refund example.
Get DGS Expired Purchases
Get purchase orders which have expired without being delivered, given a seller ID, in reverse chronological order.
Request:
requestType
isgetDGSExpiredPurchases
seller
is the account ID of the product sellerfirstIndex
is a zero-based index to the first purchase order to retrieve (optional)lastIndex
is a zero-based index to the last purchase order to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
purchases
(A) is an array of purchase orders (refer to Get DGS Purchase for details)lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Expired Purchases example.
Get DGS Good
Get a DGS product given a goods ID.
Request:
requestType
isgetDGSGood
goods
is the goods ID of the productincludeCounts
istrue
if the fields beginning with numberOf... are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
seller
(S) is the seller's account IDquantity
(N) is the quantity of the product remaining for salegoods
(S) is the ID of the productdescription
(S) is the description of the productsellerRS
(S) is the Reed-Solomon address of the seller's accountrequestProcessingTime
(N) is the API request processing time (in millisec)delisted
(B) istrue
if the product has been delisted,false
otherwiseparsedTags
(A) is an array of up to three tag strings, parsed from thetags
fieldtags
(S) is the comma separated list of tags provided by the seller when the listing was createdpriceNQT
(S) is the current price of the productnumberOfPublicFeedbacks
(N) is the number of public feedbacks given for the productname
(S) is the name of the productnumberOfPurchases
(N) is the number of purchases of the producttimestamp
(N) is the timestamp (in seconds since the genesis block) of the creation of the product listinglastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)
Example: Refer to Get DGS Good example.
Get DGS Goods
Get DGS products for sale in reverse chronological listing creation order unless a seller is given, then in product name order.
Request:
requestType
isgetDGSGoods
seller
is the account ID of the product seller (optional)firstIndex
is a zero-based index to the first product to retrieve (optional)lastIndex
is a zero-based index to the last product to retrieve (optional)inStockOnly
isfalse
if out-of-stock products (zero quantity) are to be retrieved (optional)hideDelisted
istrue
if delisted products are to be omitted (optional)includeCounts
istrue
if the fields beginning withnumberOf...
are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Note: If none of the optional parameters are specified, all in-stock products in the blockchain are retrieved at once, which may take a long time.
Response:
goods
(A) is an array of goods (refer to Get DGS Good for details)lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Goods example.
Get DGS Goods Count
Get the number of products for sale by a given seller or all sellers.
Request:
requestType
isgetDGSGoodsCount
seller
is the account ID of the seller (optional, default is all sellers combined)inStockOnly
isfalse
if out-of-stock (zero quantity) products are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
numberOfGoods
(N) is the number of goods for sale by theseller
lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Note: The numberOfGoods
field refers to the number of distinct products for sale, regardless of the quantity of each.
Example: Refer to Get DGS Goods Count example.
Get DGS Goods Purchase Count
Get the number of completed purchase orders given a goods ID.
Request:
requestType
isgetDGSGoodsPurchaseCount
goods
is the goods IDwithPublicFeedbacksOnly
istrue
if purchase orders without public feedback are to be omitted (optional)completed
istrue
if only completed purchase orders are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
numberOfPurchases
(N) is the number of completed purchase orderslastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Goods Purchase Count example.
Get DGS Goods Purchases
Get completed purchase orders given a goods ID and optionally a buyer ID in reverse chronological order.
Request:
requestType
isgetDGSGoodsPurchases
goods
is the goods IDbuyer
is a buyer ID (optional)firstIndex
is a zero-based index to the first purchase order to retrieve (optional)lastIndex
is a zero-based index to the last purchase order to retrieve (optional)withPublicFeedbacksOnly
istrue
if purchase orders without public feedback are to be omitted (optional)completed
istrue
if only completed purchase orders are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
purchases
(A) is an array of purchase orders (refer to Get DGS Purchase for details)lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Goods Purchases example.
Get DGS Pending Purchases
Get pending purchase orders given a seller ID in reverse chronological order.
Request:
requestType
isgetDGSPendingPurchases
seller
is the account ID of the sellerfirstIndex
is a zero-based index to the first purchase order to retrieve (optional)lastIndex
is a zero-based index to the last purchase order to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
purchases
(A) is an array of pending purchase orders (refer to Get DGS Purchase for details)lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Pending Purchases example.
Get DGS Purchase
Get a purchase order given a purchase order ID.
Request:
requestType
isgetDGSPurchase
purchase
is the purchase order IDsharedKey
is the shared key used to decrypt the message (optional) (see Get Shared Key)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
seller
(S) is the account number of the sellerquantity
(N) is the quantity of the product to be purchasedfeedbackNotes
(A) is an array of AES-encrypted objects, each withdata
(S) andnonce
(S) fields, in reverse chronological order, if applicablepublicFeedbacks
(A) is an array of feedback strings in reverse chronological order if applicablepending
(B) istrue
if thedeliveryDeadline
has not passed,false
otherwisepurchase
(S) is the purchase order IDgoods
(S) is the ID of the productsellerRS
(S) is the Reed-Solomon address of the sellerbuyer
(S) is the account number of the buyerpriceNQT
(S) is the price (in NQT) of the productdeliveryDeadlineTimestamp
(N) is the timestamp (in seconds since the genesis block) by which the product must be deliveredgoodsIsText
(B) isfalse
if the message is a hex string, otherwise the message is text (optional)buyerRS
(S) is the Reed-Solomon address of the buyerrefundNQT
(S) is the amount (in NQT) refunded, if applicablename
(S) is the name of the productgoodsData
(O) is an object with the two fieldsdata
(S) (the encrypted product hex string) andnonce
(S), if the product has been deliveredtimestamp
(N) is the timestamp (in seconds since the genesis block) of the purchase orderlastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Purchase example.
Get DGS Purchase Count
Get the number of purchase orders given a seller and/or buyer ID, or all orders combined.
Request:
requestType
isgetDGSPurchaseCount
seller
is the account ID of the seller (optional, default is all sellers)buyer
is the account ID of the buyer (optional, default is all buyers)withPublicFeedbacksOnly
istrue
if purchase orders without public feedback are to be omitted (optional)completed
istrue
if only completed purchase orders are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
numberOfPurchases
(N) is the number of purchase orders associated with the seller and/or buyerlastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Purchase Count example.
Get DGS Purchases
Get purchase orders given a seller and/or buyer ID in reverse chronological order.
Request:
requestType
isgetDGSPurchases
seller
is the account ID of the seller (optional)buyer
is the account ID of the buyer (optional ifseller
provided)firstIndex
is a zero-based index to the purchase order to retrieve (optional)lastIndex
is a zero-based index to the purchase order to retrieve (optional)withPublicFeedbacksOnly
istrue
if purchase orders without public feedback are to be omitted (optional)completed
istrue
if only completed purchase orders are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
purchases
(A) is an array of purchase orders (refer to Get DGS Purchase for details)lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Purchases example.
Get DGS Tag Count
Get the number of tags used by all sellers.
Request:
requestType
isgetDGSTagCount
inStockOnly
isfalse
if tags with no associated in-stock products are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
numberOfTags
(N) is the number of tagslastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Get DGS Tag Count example.
Get DGS Tags
Get tags used by all sellers in reverse inStockCount
, reverse totalCount
, tag
order.
Request:
requestType
isgetDGSTags
inStockOnly
isfalse
if out-of-stock tags are to be retrieved (optional)firstIndex
is a zero-based index to the first tag to retrieve (optional)lastIndex
is a zero-based index to the last tag to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
tags
(A) is an array of tag objects with the following fields for each tag:inStockCount
(N) is the number of products available for sale as taggedtag
(S) is the tag wordtotalCount
(N) is the total number of products as tagged
lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Note: The ...Count
fields refer to the number of distinct products tagged, regardless of the quantity of each.
Example: Refer to Get DGS Tags example.
Get DGS Tags Like
Get all tags starting with a given prefix (at least 2 characters long) in reverse inStockCount
, reverse totalCount
, tag
order.
Request:
requestType
isgetDGSTagsLike
tagPrefix
is the prefix (at least 2 characters long) of thetag
inStockOnly
isfalse
if out-of-stock tags are to be retrieved (optional)firstIndex
is a zero-based index to the first tag to retrieve (optional)lastIndex
is a zero-based index to the last tag to retrieve (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
tags
(A) is an array of tag objects with the following fields for each tag:inStockCount
(N) is the number of products available for sale as taggedtag
(S) is the tag wordtotalCount
(N) is the total number of products as tagged
lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Note: The ...Count
fields refer to the number of distinct products tagged, regardless of the quantity of each.
Example: Refer to Get DGS Tags Like example.
Search DGS Goods
Get product listings that have a name or description that match a given query in reverse relevance order, then name order (given a seller), then reverse chronological order.
Request:
requestType
issearchDGSGoods
query
is a full text query on the goods fieldsname
anddescription
in the standard Lucene syntax (opens in a new tab) (optional)tag
is a query on the good fieldtags
in the standard Lucene syntax (opens in a new tab) (optional)seller
is the account ID of the product seller (optional)firstIndex
is a zero-based index to the first product to retrieve (optional)lastIndex
is a zero-based index to the last product to retrieve (optional)inStockOnly
isfalse
if out-of-stock products (zero quantity) are to be retrieved (optional)hideDelisted
istrue
if delisted products are to be omitted (optional)includeCounts
istrue
if the fields beginning withnumberOf...
are to be included (optional)requireBlock
is the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlock
is the block ID of a block that must be last in the blockchain during execution (optional)
Response:
goods
(A) is an array of goods objects (refer to Get DGS Good for details)lastBlock
(S) is the last block ID on the blockchain (applies ifrequireBlock
is provided but notrequireLastBlock
)requestProcessingTime
(N) is the API request processing time (in millisec)
Example: Refer to Search DGS Goods example.