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.
requestTypeisdgsDelistinggoodsis 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.
requestTypeisdgsDeliverypurchaseis the purchase order IDdiscountNQTis a discount (in NQT) off the selling price (optional, default is zero)goodsToEncryptis the product, a text or a hex string to be encrypted (optional ifgoodsDataprovided)goodsIsTextisfalseifgoodsToEncryptis a hex string (optional)goodsDatais AES-encrypted (using Encrypt To)goodsToEncrypt, up to 1000 bytes long (required only ifsecretPhraseis omitted)goodsNonceis the unique nonce associated with the encrypted data (required only ifsecretPhraseis 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.
requestTypeisdgsFeedbackpurchaseis the purchase order IDmessageis 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.
requestTypeisdgsListingnameis the name of the product up to 100 characters in lengthdescriptionis a description of the product up to 1000 characters in lengthtagsare up to three comma separated keywords describing the product up to 100 characters in length (optional)quantityis the quantity of the product for salepriceNQTis 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.
requestTypeisdgsPriceChangegoodsis the goods ID of the productpriceNQTis 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.
requestTypeisdgsPurchasegoodsis the goods ID of the productpriceNQTis the price of the productquantityis the quantity to be purchaseddeliveryDeadlineTimestampis 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.
requestTypeisdgsQuantityChangegoodsis the goods ID of the productdeltaQuantityis 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.
requestTypeisdgsRefundpurchaseis the purchase order IDrefundNQTis 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:
requestTypeisgetDGSExpiredPurchasesselleris the account ID of the product sellerfirstIndexis a zero-based index to the first purchase order to retrieve (optional)lastIndexis a zero-based index to the last purchase order to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSGoodgoodsis the goods ID of the productincludeCountsistrueif the fields beginning with numberOf... are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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) istrueif the product has been delisted,falseotherwiseparsedTags(A) is an array of up to three tag strings, parsed from thetagsfieldtags(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 ifrequireBlockis 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:
requestTypeisgetDGSGoodsselleris the account ID of the product seller (optional)firstIndexis a zero-based index to the first product to retrieve (optional)lastIndexis a zero-based index to the last product to retrieve (optional)inStockOnlyisfalseif out-of-stock products (zero quantity) are to be retrieved (optional)hideDelistedistrueif delisted products are to be omitted (optional)includeCountsistrueif the fields beginning withnumberOf...are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSGoodsCountselleris the account ID of the seller (optional, default is all sellers combined)inStockOnlyisfalseif out-of-stock (zero quantity) products are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 thesellerlastBlock(S) is the last block ID on the blockchain (applies ifrequireBlockis 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:
requestTypeisgetDGSGoodsPurchaseCountgoodsis the goods IDwithPublicFeedbacksOnlyistrueif purchase orders without public feedback are to be omitted (optional)completedistrueif only completed purchase orders are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSGoodsPurchasesgoodsis the goods IDbuyeris a buyer ID (optional)firstIndexis a zero-based index to the first purchase order to retrieve (optional)lastIndexis a zero-based index to the last purchase order to retrieve (optional)withPublicFeedbacksOnlyistrueif purchase orders without public feedback are to be omitted (optional)completedistrueif only completed purchase orders are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSPendingPurchasesselleris the account ID of the sellerfirstIndexis a zero-based index to the first purchase order to retrieve (optional)lastIndexis a zero-based index to the last purchase order to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSPurchasepurchaseis the purchase order IDsharedKeyis the shared key used to decrypt the message (optional) (see Get Shared Key)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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) istrueif thedeliveryDeadlinehas not passed,falseotherwisepurchase(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) isfalseif 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 ifrequireBlockis 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:
requestTypeisgetDGSPurchaseCountselleris the account ID of the seller (optional, default is all sellers)buyeris the account ID of the buyer (optional, default is all buyers)withPublicFeedbacksOnlyistrueif purchase orders without public feedback are to be omitted (optional)completedistrueif only completed purchase orders are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSPurchasesselleris the account ID of the seller (optional)buyeris the account ID of the buyer (optional ifsellerprovided)firstIndexis a zero-based index to the purchase order to retrieve (optional)lastIndexis a zero-based index to the purchase order to retrieve (optional)withPublicFeedbacksOnlyistrueif purchase orders without public feedback are to be omitted (optional)completedistrueif only completed purchase orders are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSTagCountinStockOnlyisfalseif tags with no associated in-stock products are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSTagsinStockOnlyisfalseif out-of-stock tags are to be retrieved (optional)firstIndexis a zero-based index to the first tag to retrieve (optional)lastIndexis a zero-based index to the last tag to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeisgetDGSTagsLiketagPrefixis the prefix (at least 2 characters long) of thetaginStockOnlyisfalseif out-of-stock tags are to be retrieved (optional)firstIndexis a zero-based index to the first tag to retrieve (optional)lastIndexis a zero-based index to the last tag to retrieve (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis 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:
requestTypeissearchDGSGoodsqueryis a full text query on the goods fieldsnameanddescriptionin the standard Lucene syntax (opens in a new tab) (optional)tagis a query on the good fieldtagsin the standard Lucene syntax (opens in a new tab) (optional)selleris the account ID of the product seller (optional)firstIndexis a zero-based index to the first product to retrieve (optional)lastIndexis a zero-based index to the last product to retrieve (optional)inStockOnlyisfalseif out-of-stock products (zero quantity) are to be retrieved (optional)hideDelistedistrueif delisted products are to be omitted (optional)includeCountsistrueif the fields beginning withnumberOf...are to be included (optional)requireBlockis the block ID of a block that must be present in the blockchain during execution (optional)requireLastBlockis 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 ifrequireBlockis provided but notrequireLastBlock)requestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Search DGS Goods example.