Digital Goods Store
In the Nxt client interface, the Digital Goods Store (DGS) is referred to as Marketplace.
DGS Delisting
Delist a listed product. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsDelisting
- goods is the goods ID
Response: Refer to Create Transaction Response.
DGS Delisting Example
http://localhost:7876/nxt?
requestType=dgsDelisting&
goods=11813734897437346473
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60
{
"signatureHash": "87dd2aa00690acaa5da4e8cd9db6ab94b5ed8bf0f8fe2c2ba6a39c57d3073105",
"unsignedTransactionBytes": "03111852e2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "39ee52204d0a32c0bbd0e4bc6a6fb52299cd7d16ab74e9a040f857d3b1c3e...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "40e64c357e240f9b7ca5780e757e34d48a58ae93eeb19e62d020d5719b43e2b6",
"version": 1,
"ecBlockId": "5345754442518111082",
"signatureHash": "87dd2aa00690acaa5da4e8cd9db6ab94b5ed8bf0f8fe2c2ba6a39c57d3073105",
"attachment": {
"version.DigitalGoodsDelisting": 1,
"goods": "11813734897437346473"
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 1,
"amountNQT": "0",
"sender": "15323192282528158131",
"ecBlockHeight": 292903,
"deadline": 60,
"transaction": "11173189325008201280",
"timestamp": 31609368,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 5188,
"transactionBytes": "03111852e2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "40e64c357e240f9b7ca5780e757e34d48a58ae93eeb19e62d020d5719b43e2b6",
"transaction": "11173189325008201280"
}
DGS Delivery
Deliver a product. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsDelivery
- purchase is the purchase order ID
- discountNQT 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 if goodsData provided)
- goodsIsText is false if goodsToEncrypt is a hex string (optional)
- goodsData is AES-encrypted (using Encrypt To) goodsToEncrypt, up to 1000 bytes long (required only if secretPhrase is omitted)
- goodsNonce is the unique nonce associated with the encrypted data (required only if secretPhrase 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.
DGS Delivery Example
http://localhost:7876/nxt?
requestType=dgsDelivery&
purchase=3723760852542296589&
goodsToEncrypt=Download Code.&
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60
{
"signatureHash": "f3f1f1bf30c7a6f5a7776aa23502dfe5240efe0d5c016760f8e8a152c4eb1b1b",
"unsignedTransactionBytes": "0315b20fe1013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "b96c42161ce38177168de5a8906ce747a5415017df5b16cdce1c015cb6e1f10b...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "349926ea025b627117c05fbe3ff298e97a8efdb07f7ae552b5a91e7112c5b82b",
"version": 1,
"ecBlockId": "15813950788992376142",
"signatureHash": "f3f1f1bf30c7a6f5a7776aa23502dfe5240efe0d5c016760f8e8a152c4eb1b1b",
"attachment": {
"goodsIsText": true,
"discountNQT": "0",
"purchase": "3723760852542296589",
"goodsData": "aef91bfe543844964b0dadc51c6fe4c624b6b0c72c23c5c61f7e626f51e15...",
"version.DigitalGoodsDelivery": 1,
"goodsNonce": "4cb474ec53a590c6fd20d050c429d009ddefd286b2782eb3a0782ae45c2bbbbd"
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 5,
"amountNQT": "0",
"sender": "15323192282528158131",
"recipientRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"recipient": "7580519603555678830",
"ecBlockHeight": 292069,
"deadline": 60,
"transaction": "8170192742079961396",
"timestamp": 31526834,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 8832,
"transactionBytes": "0315b20fe1013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "349926ea025b627117c05fbe3ff298e97a8efdb07f7ae552b5a91e7112c5b82b",
"transaction": "8170192742079961396"
}
DGS Feedback
Give feedback about a purchased product after delivery. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsFeedback
- purchase is the purchase order ID
- message is unencrypted (public) feedback text up to 1000 bytes
Note: The unencrypted message parameter is used for public feedback, but in addition or instead, an encrypted message can be used for private feedback to the seller and/or an encrypted message can be sent to self (buyer) although the current NRS client does not recognize non-public feedback messages.
Response: Refer to Create Transaction Response.
DGS Feedback Example
http://localhost:7876/nxt?
requestType=dgsFeedback&
purchase=10234639413366748292&
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60&
message=Thank You!
{
"signatureHash": "bf31e4e3b2037bfe223efd72519e3a2d25cd1e0dc1a62e3eeefe59179e16a7a4",
"unsignedTransactionBytes": "0316a463e2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "a3ee76ce4bec0328fe5cfc1a2adfc229a8c9959a81b7912664de51156987c...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "491d94b9031b7a7a32d9ab5d0491b81364941eb080ee9029de58cb6ffa0161f6",
"version": 1,
"ecBlockId": "5484311742753527844",
"signatureHash": "bf31e4e3b2037bfe223efd72519e3a2d25cd1e0dc1a62e3eeefe59179e16a7a4",
"attachment": {
"purchase": "10234639413366748292",
"version.Message": 1,
"messageIsText": true,
"version.DigitalGoodsFeedback": 1,
"message": "Thank you!"
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 6,
"amountNQT": "0",
"sender": "15323192282528158131",
"recipientRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"recipient": "7580519603555678830",
"ecBlockHeight": 292938,
"deadline": 60,
"transaction": "8825396122598251849",
"timestamp": 31613860,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 9343,
"transactionBytes": "0316a463e2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "491d94b9031b7a7a32d9ab5d0491b81364941eb080ee9029de58cb6ffa0161f6",
"transaction": "8825396122598251849"
}
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 is dgsListing
- name is the name of the product up to 100 characters in length
- description is a description of the product up to 1000 characters in length
- tags 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 sale
- priceNQT is the price (in NQT) of the product
Response: Refer to Create Transaction Response. The transaction ID is also the goods ID.
DGS Listing Example
http://localhost:7876/nxt?
requestType=dgsListing&
secretPhrase=IWontTellYou&
name=Test Product&
description=Testing the DGS.
tags=test, product, tag, extra&
quantity=3&
priceNQT=100000000&
feeNQT=100000000&
deadline=60
{
"signatureHash": "565bc0a6140ae1331cd5db009fbd9da164d8802330939ef40204a9bc343b3149",
"unsignedTransactionBytes": "031092aedf013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "465ed3dfef9a02fc97fc18a6f83bb9f07c285aef41ff78c957d59cda2972ba...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "a98a63204cd1f2a3304cee79776854f290f0472883c576056fec16a23efa90df",
"version": 1,
"ecBlockId": "4480409615309425420",
"signatureHash": "565bc0a6140ae1331cd5db009fbd9da164d8802330939ef40204a9bc343b3149",
"attachment": {
"priceNQT": "100000000",
"quantity": 3,
"name": "Test Product",
"description": "Testing the DGS.",
"version.DigitalGoodsListing": 1,
"tags": "test, product, tag, extra"
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 0,
"amountNQT": "0",
"sender": "15323192282528158131",
"ecBlockHeight": 291240,
"deadline": 60,
"transaction": "11813734897437346473",
"timestamp": 31436434,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 8958,
"transactionBytes": "031092aedf013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473b...",
"fullHash": "a98a63204cd1f2a3304cee79776854f290f0472883c576056fec16a23efa90df",
"transaction": "11813734897437346473"
}
DGS Price Change
Change the price of a listed product. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsPriceChange
- goods is the goods ID of the product
- priceNQT is the new price of the product
Response: Refer to Create Transaction Response.
DGS Price Change Example
http://localhost:7876/nxt?
requestType=dgsPriceChange&
goods=11813734897437346473&
priceNQT=200000000&
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60
{
"signatureHash": "aad88476935eda8ca3a9190163b83106e6ca95733ddfa274d29a0378d773cc3c",
"unsignedTransactionBytes": "0312cebbdf013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "533f9c330100cab8a7a0f9375b49a09f6432b0e029660ab715a728ac75e6c2...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "1964e4fe11f4a00a96c79e274f9da21f64d7fe10ed77a154975b92d3c65f1287",
"version": 1,
"ecBlockId": "14411471768450948944",
"signatureHash": "aad88476935eda8ca3a9190163b83106e6ca95733ddfa274d29a0378d773cc3c",
"attachment": {
"goods": "11813734897437346473",
"priceNQT": "200000000",
"version.DigitalGoodsPriceChange": 1
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 2,
"amountNQT": "0",
"sender": "15323192282528158131",
"ecBlockHeight": 291259,
"deadline": 60,
"transaction": "765880294780986393",
"timestamp": 31439822,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 6444,
"transactionBytes": "0312cebbdf013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "1964e4fe11f4a00a96c79e274f9da21f64d7fe10ed77a154975b92d3c65f1287",
"transaction": "765880294780986393"
}
DGS Purchase
Purchase a product for sale. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsPurchase
- goods is the goods ID of the product
- priceNQT is the price of the product
- quantity is the quantity to be purchased
- deliveryDeadlineTimestamp 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.
DGS Purchase Example
http://localhost:7876/nxt?
requestType=dgsPurchase&
goods=1587116104511359906&
quantity=1&
deliveryDeadlineTimestamp=31800000&
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60
{
"signatureHash": "03e112d8707ae33ec37ff4405f31920c0e67c58439e33033c248b3eaca81d2c3",
"unsignedTransactionBytes": "0314805be2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "a2739ef63024d9d3c61bebbb2692e7a2092666e13fc380c2e8b29c3a3fc24...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "84f4ef2d52be088e011e5b7857fbab88665918e0df02102a8333aee53c3bb88b",
"version": 1,
"ecBlockId": "3186563001195424357",
"signatureHash": "03e112d8707ae33ec37ff4405f31920c0e67c58439e33033c248b3eaca81d2c3",
"attachment": {
"goods": "1587116104511359906",
"priceNQT": "100000000",
"quantity": 1,
"deliveryDeadlineTimestamp": 31800000,
"version.DigitalGoodsPurchase": 1
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 4,
"amountNQT": "0",
"sender": "15323192282528158131",
"recipientRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"recipient": "7580519603555678830",
"ecBlockHeight": 292925,
"deadline": 60,
"transaction": "10234639413366748292",
"timestamp": 31611776,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 5536,
"transactionBytes": "0314805be2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "84f4ef2d52be088e011e5b7857fbab88665918e0df02102a8333aee53c3bb88b",
"transaction": "10234639413366748292"
}
DGS Quantity Change
Change the quantity of a listed product. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsQuantityChange
- goods is the goods ID of the product
- deltaQuantity 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.
DGS Quantity Change Example
http://localhost:7876/nxt?
requestType=dgsQuantityChange&
goods=11813734897437346473&
deltaQuantity=-1&
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60
{
"signatureHash": "5c60fc94452980f88423c3a16a74d49209d246d0f7454024c87cc76ea3221500",
"unsignedTransactionBytes": "031334b7df013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "7eaf8e48a780f51aa7e01c01091c9388b72a1bf075dddbd3594d55ad169272...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "f3cd9046bba3706dd6f63cf387f23c7c29532ff15e3423f57900613c844a646f",
"version": 1,
"ecBlockId": "14589429051005044326",
"signatureHash": "5c60fc94452980f88423c3a16a74d49209d246d0f7454024c87cc76ea3221500",
"attachment": {
"goods": "11813734897437346473",
"version.DigitalGoodsQuantityChange": 1,
"deltaQuantity": -1
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 3,
"amountNQT": "0",
"sender": "15323192282528158131",
"ecBlockHeight": 291249,
"deadline": 60,
"transaction": "7885982972263845363",
"timestamp": 31438644,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 7474,
"transactionBytes": "031334b7df013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "f3cd9046bba3706dd6f63cf387f23c7c29532ff15e3423f57900613c844a646f",
"transaction": "7885982972263845363"
}
DGS Refund
Refund a purchase. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is dgsRefund
- purchase is the purchase order ID
- refundNQT is the amount (in NQT) of the refund
Response: Refer to Create Transaction Response.
DGS Refund Example
http://localhost:7876/nxt?
requestType=dgsRefund&
purchase=3723760852542296589&
refundNQT=100000000&
secretPhrase=IWontTellYou&
feeNQT=100000000&
deadline=60
{
"signatureHash": "dafa980759db6bd6e5f11aa7bdc1cff1bb201be750328c397870f1758cef975c",
"unsignedTransactionBytes": "0317944ee2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"transactionJSON": {
"senderPublicKey": "57fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b473beec228f79ff93c",
"signature": "43a90c1f0dde1bca84623e69b0abe0284883600d7bfb5286b3489a9ee417...",
"feeNQT": "100000000",
"type": 3,
"fullHash": "64c2af2811da3306f4671002ed1f12655fca1937a0b68164da2a71f3ee63adce",
"version": 1,
"ecBlockId": "11418000967717599433",
"signatureHash": "dafa980759db6bd6e5f11aa7bdc1cff1bb201be750328c397870f1758cef975c",
"attachment": {
"purchase": "3723760852542296589",
"version.DigitalGoodsRefund": 1,
"refundNQT": "100000000"
},
"senderRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"subtype": 7,
"amountNQT": "0",
"sender": "15323192282528158131",
"recipientRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"recipient": "7580519603555678830",
"ecBlockHeight": 292899,
"deadline": 60,
"transaction": "446940555271717476",
"timestamp": 31608468,
"height": 2147483647
},
"broadcasted": true,
"requestProcessingTime": 10509,
"transactionBytes": "0317944ee2013c0057fb6f3a958e320bb49c4e81b4c2cf28b9f25d086c143b...",
"fullHash": "64c2af2811da3306f4671002ed1f12655fca1937a0b68164da2a71f3ee63adce",
"transaction": "446940555271717476"
}
Get DGS Expired Purchases
Get purchase orders which have expired without being delivered, given a seller ID, in reverse chronological order.
Request:
- requestType is getDGSExpiredPurchases
- seller is the account ID of the product seller
- 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)
- 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 if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Expired Purchases Example
http://localhost:7876/nxt?
requestType=getDGSExpiredPurchases&
seller=NXT-XK4R-7VJU-6EQG-7R335
{
"purchases": [
{
"seller": "5873880488492319831",
"priceNQT": "1000000000",
"quantity": 1,
"deliveryDeadlineTimestamp": 44955165,
"buyerRS": "NXT-XK4R-7VJU-6EQG-7R335",
"pending": false,
"purchase": "17272258199467687054",
"name": "MyProduct",
"goods": "4830545483228225683",
"sellerRS": "NXT-XK4R-7VJU-6EQG-7R335",
"buyer": "5873880488492319831",
"timestamp": 44397533
}
],
"requestProcessingTime": 1
}
Get DGS Good
Get a DGS product given a goods ID.
Request:
- requestType is getDGSGood
- goods is the goods ID of the product
- includeCounts is true 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 ID
- quantity (N) is the quantity of the product remaining for sale
- goods (S) is the ID of the product
- description (S) is the description of the product
- sellerRS (S) is the Reed-Solomon address of the seller's account
- requestProcessingTime (N) is the API request processing time (in millisec)
- delisted (B) is true if the product has been delisted, false otherwise
- parsedTags (A) is an array of up to three tag strings, parsed from the tags field
- tags (S) is the comma separated list of tags provided by the seller when the listing was created
- priceNQT (S) is the current price of the product
- numberOfPublicFeedbacks (N) is the number of public feedbacks given for the product
- name (S) is the name of the product
- numberOfPurchases (N) is the number of purchases of the product
- timestamp (N) is the timestamp (in seconds since the genesis block) of the creation of the product listing
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
Get DGS Good Example
http://localhost:7876/nxt?
requestType=getDGSGood&
goods=11813734897437346473
{
"seller": "15323192282528158131",
"quantity": 3,
"goods": "11813734897437346473",
"description": "Testing the DGS.",
"sellerRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"requestProcessingTime": 1,
"delisted": false,
"parsedTags": [
"test",
"product",
"tag"
],
"tags": "test, product, tag, extra",
"priceNQT": "100000000",
"numberOfPublicFeedbacks": 0,
"name": "Test Product",
"numberOfPurchases": 0,
"timestamp": 31436434
}
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 is getDGSGoods
- 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 is false if out-of-stock products (zero quantity) are to be retrieved (optional)
- hideDelisted is true if delisted products are to be omitted (optional)
- includeCounts is true 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)
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 if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Goods Example
http://localhost:7876/nxt?
requestType=getDGSGoods&
seller=NXT-L6FM-89WK-VK8P-FCRBB
{
"goods": [
{
"seller": "15323192282528158131",
"quantity": 2,
"goods": "11813734897437346473",
"description": "Testing the DGS.",
"sellerRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"delisted": false,
"parsedTags": [
"test",
"product",
"tag"
],
"tags": "test, product, tag, extra",
"priceNQT": "200000000",
"numberOfPublicFeedbacks": 0,
"name": "Test Product",
"numberOfPurchases": 0,
"timestamp": 31436434
}
],
"requestProcessingTime": 46
}
Get DGS Goods Count
Get the number of products for sale by a given seller or all sellers.
Request:
- requestType is getDGSGoodsCount
- seller is the account ID of the seller (optional, default is all sellers combined)
- inStockOnly is false 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 the seller
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- 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.
Get DGS Goods Count Example
http://localhost:7876/nxt?
requestType=getDGSGoodsCount&
seller=NXT-L6FM-89WK-VK8P-FCRBB
{
"numberOfGoods": 1,
"requestProcessingTime": 2
}
Get DGS Goods Purchase Count
Get the number of completed purchase orders given a goods ID.
Request:
- requestType is getDGSGoodsPurchaseCount
- goods is the goods ID
- withPublicFeedbacksOnly is true if purchase orders without public feedback are to be omitted (optional)
- completed is true 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 orders
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Goods Purchase Count Example
http://localhost:7876/nxt?
requestType=getDGSGoodsPurchaseCount&
goods=11813734897437346473
{
"numberOfPurchases": 1,
"requestProcessingTime": 1
}
Get DGS Goods Purchases
Get completed purchase orders given a goods ID and optionally a buyer ID in reverse chronological order.
Request:
- requestType is getDGSGoodsPurchases
- goods is the goods ID
- buyer 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 is true if purchase orders without public feedback are to be omitted (optional)
- completed is true 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 if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Goods Purchases Example
http://localhost:7876/nxt?
requestType=getDGSGoodsPurchases&
goods=11813734897437346473
{
"purchases": [
{
"seller": "15323192282528158131",
"quantity": 2,
"pending": false,
"purchase": "3723760852542296589",
"goods": "11813734897437346473",
"sellerRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"buyer": "7580519603555678830",
"priceNQT": "200000000",
"deliveryDeadlineTimestamp": 31600000,
"goodsIsText": false,
"buyerRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"name": "Test Product",
"goodsData": {
"data": "aef91bfe543844964b0dadc51c6fe4c624b6b0c72c23c5c61f7e626f51e15...",
"nonce": "4cb474ec53a590c6fd20d050c429d009ddefd286b2782eb3a0782ae45c2bbbbd"
},
"timestamp": 31520720
}
],
"requestProcessingTime": 305
}
Get DGS Pending Purchases
Get pending purchase orders given a seller ID in reverse chronological order.
Request:
- requestType is getDGSPendingPurchases
- seller is the account ID of the seller
- 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)
- 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 if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Pending Purchases Example
http://localhost:7876/nxt?
requestType=getDGSPendingPurchases&
seller=NXT-L6FM-89WK-VK8P-FCRBB
{
"purchases": [
{
"seller": "15323192282528158131",
"priceNQT": "200000000",
"quantity": 2,
"deliveryDeadlineTimestamp": 31600000,
"buyerRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"pending": true,
"purchase": "3723760852542296589",
"name": "Test Product",
"goods": "11813734897437346473",
"sellerRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"buyer": "7580519603555678830",
"timestamp": 31520720
}
],
"requestProcessingTime": 1
}
Get DGS Purchase
Get a purchase order given a purchase order ID.
Request:
- requestType is getDGSPurchase
- purchase is the purchase order ID
- sharedKey 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 seller
- quantity (N) is the quantity of the product to be purchased
- feedbackNotes (A) is an array of AES-encrypted objects, each with data (S) and nonce (S) fields, in reverse chronological order, if applicable
- publicFeedbacks (A) is an array of feedback strings in reverse chronological order if applicable
- pending (B) is true if the deliveryDeadline has not passed, false otherwise
- purchase (S) is the purchase order ID
- goods (S) is the ID of the product
- sellerRS (S) is the Reed-Solomon address of the seller
- buyer (S) is the account number of the buyer
- priceNQT (S) is the price (in NQT) of the product
- deliveryDeadlineTimestamp (N) is the timestamp (in seconds since the genesis block) by which the product must be delivered
- goodsIsText (B) is false if the message is a hex string, otherwise the message is text (optional)
- buyerRS (S) is the Reed-Solomon address of the buyer
- refundNQT (S) is the amount (in NQT) refunded, if applicable
- name (S) is the name of the product
- goodsData (O) is an object with the two fields data (S) (the encrypted product hex string) and nonce (S), if the product has been delivered
- timestamp (N) is the timestamp (in seconds since the genesis block) of the purchase order
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Purchase Example
http://localhost:7876/nxt?
requestType=getDGSPurchase&
purchase=10234639413366748292
{
"seller": "7580519603555678830",
"quantity": 1,
"feedbackNotes": [
{
"data": "7086a82f4da0708d4eaa9b16d5fc5a25c556596ea29d957d0a1dddd0a482c...",
"nonce": "c521481ce67f7778c41c6716806047d4ea641005392cd7e5ce8d20c49623dad8"
}
],
"publicFeedbacks": [
"Thank you again!",
"Thank you!"
],
"pending": false,
"purchase": "10234639413366748292",
"goods": "1587116104511359906",
"sellerRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"requestProcessingTime": 1,
"buyer": "15323192282528158131",
"priceNQT": "100000000",
"deliveryDeadlineTimestamp": 31800000,
"goodsIsText": false,
"buyerRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"discountNQT": "100000000",
"name": "Test Product",
"goodsData": {
"data": "5f4868022381aa9532614a7aae1600e59e84c80571add107dabca891df97e7...",
"nonce": "c017b846de4375741ebc9f3bff894270d218ff4090a66dfd505770ccdc2f54bd"
},
"timestamp": 31611776
}
Get DGS Purchase Count
Get the number of purchase orders given a seller and/or buyer ID, or all orders combined.
Request:
- requestType is getDGSPurchaseCount
- 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 is true if purchase orders without public feedback are to be omitted (optional)
- completed is true 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 buyer
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Purchase Count Example
http://localhost:7876/nxt?
requestType=getDGSPurchaseCount&
seller=NXT-L6FM-89WK-VK8P-FCRBB
{
"numberOfPurchases": 2,
"requestProcessingTime": 1
}
Get DGS Purchases
Get purchase orders given a seller and/or buyer ID in reverse chronological order.
Request:
- requestType is getDGSPurchases
- seller is the account ID of the seller (optional)
- buyer is the account ID of the buyer (optional if seller 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 is true if purchase orders without public feedback are to be omitted (optional)
- completed is true 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 if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Purchases Example
http://localhost:7876/nxt?
requestType=getDGSPurchases&
seller=NXT-L6FM-89WK-VK8P-FCRBB&
lastIndex=0
{
"purchases": [
{
"seller": "15323192282528158131",
"priceNQT": "200000000",
"quantity": 2,
"deliveryDeadlineTimestamp": 31600000,
"buyerRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"pending": true,
"purchase": "3723760852542296589",
"name": "Test Product",
"goods": "11813734897437346473",
"sellerRS": "NXT-L6FM-89WK-VK8P-FCRBB",
"buyer": "7580519603555678830",
"timestamp": 31520720
}
],
"requestProcessingTime": 1
}
Get DGS Tag Count
Get the number of tags used by all sellers.
Request:
- requestType is getDGSTagCount
- inStockOnly is false 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 tags
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Get DGS Tag Count Example
http://localhost:7876/nxt?
requestType=getDGSTagCount
{
"numberOfTags": 383,
"requestProcessingTime": 472
}
Get DGS Tags
Get tags used by all sellers in reverse inStockCount, reverse totalCount, tag order.
Request:
- requestType is getDGSTags
- inStockOnly is false 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 tagged
- tag (S) is the tag word
- totalCount (N) is the total number of products as tagged
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- 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.
Get DGS Tags Example
http://localhost:7876/nxt?
requestType=getDGSTags&
lastIndex=0
{
"requestProcessingTime": 2,
"tags": [
{
"inStockCount": 40,
"tag": "domains",
"totalCount": 42
}
]
}
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 is getDGSTagsLike
- tagPrefix is the prefix (at least 2 characters long) of the tag
- inStockOnly is false 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 tagged
- tag (S) is the tag word
- totalCount (N) is the total number of products as tagged
- lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
- 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.
Get DGS Tags Like Example
http://localhost:7876/nxt?
requestType=getDGSTagsLike&
tagPrefix=item
{
"requestProcessingTime": 1,
"tags": [
{
"inStockCount": 1,
"tag": "items",
"totalCount": 1
}
]
}
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 is searchDGSGoods
- query is a full text query on the goods fields name and description in the standard Lucene syntax (optional)
- tag is a query on the good field tags in the standard Lucene syntax (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 is false if out-of-stock products (zero quantity) are to be retrieved (optional)
- hideDelisted is true if delisted products are to be omitted (optional)
- includeCounts is true 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:
- 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 if requireBlock is provided but not requireLastBlock)
- requestProcessingTime (N) is the API request processing time (in millisec)
Search DGS Goods Example
http://localhost:7876/nxt?
requestType=searchDGSGoods&
tag=te?t AND prod*
{
"goods": [
{
"seller": "7580519603555678830",
"quantity": 1,
"goods": "1587116104511359906",
"description": "This is a test. Please do not order.",
"sellerRS": "NXT-6GMG-FC5F-YSX6-8CVEL",
"delisted": false,
"parsedTags": [
"test",
"product",
"tag"
],
"tags": "test,product,tag",
"priceNQT": "100000000",
"numberOfPublicFeedbacks": 1,
"name": "Test Product",
"numberOfPurchases": 1,
"timestamp": 31611435
}
],
"requestProcessingTime": 4
}