Skip to main content

marketplace_push_offer

Publishes a new marketplace offer on behalf of this wallet by broadcasting a transaction that carries the offer as a service attachment.

Request

{
"jsonrpc": "2.0",
"id": 0,
"method": "marketplace_push_offer",
"params": {
"od": {
"ot": 0,
"ap": "5000000000000",
"at": "120000000000",
"b": "",
"t": "USD",
"p": "NIR",
"lco": "US",
"lci": "ChIJD7fiBh9u5kcRYJSMaMOCCwQ",
"cnt": "[email protected]",
"com": "Fast settlement, business hours only",
"pt": "bank transfer, cash",
"do": "full amount",
"cat": "currency exchange",
"url": "",
"et": 10,
"fee": 10000000000
}
}
}

Request parameters

  • od - object; the offer to publish. Field names are the compact keys used on the wire.
  • od.ot - unsigned int; offer type: 0 — primary-to-target (sell order), 1 — target-to-primary (buy order), 2 — goods-to-primary, 3 — primary-to-goods.
  • od.ap - string; amount of the primary currency, in atomic units (1 coin = 10^12 atomic units), serialized as a decimal string.
  • od.at - string; amount of the target currency or goods, in atomic units, serialized as a decimal string.
  • od.b - string; bonus description; may be empty.
  • od.t - string; target currency or goods designator, for example USD.
  • od.p - string; primary currency designator, for example NIR.
  • od.lco - string; location country, for example US.
  • od.lci - string; location city (Google geo-autocomplete place id).
  • od.cnt - string; contact details to publish with the offer (e-mail, messenger, website, and so on).
  • od.com - string; free-form comment.
  • od.pt - string; accepted payment types (bank transfer, internet money, cash, and so on).
  • od.do - string; deal option, for example full amount only or partial deals.
  • od.cat - string; offer category.
  • od.url - string; preview image URL; may be empty.
  • od.et - unsigned int; offer lifetime in days since publication.
  • od.fee - unsigned int; fee paid for the publishing transaction, in atomic units. A higher fee ranks the offer higher in marketplace listings.

The offer's identity fields (tx_hash, tx_original_hash, index_in_tx, timestamp, security) belong to the same object schema but are ignored on publication — the wallet fills them in from the transaction it builds. Use the returned tx_hash together with the offer index to later update or cancel this offer.


Response

{
"id": 0,
"jsonrpc": "2.0",
"result": {
"tx_hash": "c1f6a8d9037e5b1c2a4d6e8f0123cb0d0a1a4e1c6f6a2c1c9e6b8f0a3d7e4b25",
"tx_blob_size": 3218
}
}

Response information

  • tx_hash - string; hash of the broadcast transaction carrying the new offer. Pass it as tx_id to marketplace_push_update_offer or marketplace_cancel_offer.
  • tx_blob_size - unsigned int; size of the broadcast transaction in bytes.