The way InstantDEX API works is you ask for an orderbook, it shows all the orders from everyone. If you see an order you want to match, it will have the exact syntax needed for a "makeoffer" API. So copy it and submit it as an API call.
This will in turn generate a processutx API to send to the remote node
Which receives it and send back a respondtx API along with the signedtx bytes that can be pushed to the network.
Node A
curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "SuperNET", "params": ["{\"requestType\":\"makeoffer\",\"baseid\":\"11060861818140490423\",\"baseamount\":\"101111100\",\"relid\":\"17554243582654188572\",\"relamount\":\"617900\",\"other\":\"8279528579993996036\",\"subscribe\":\"1\"}"] }' -H 'content-type: text/plain;'
http://127.0.0.1:7777/send.([{"requestType":"processutx","NXT":"12240549928875772593","utx":"0211665557020a00ec7f665fccae39025531b1cb3c48e584916dba00a7034edc60f9e4111f86145
d048b3c6e60cbe672000000000000000000e1f50500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000
000001000000158e05004253a05e77c0de7201b7faf17b381380997f27000000000000016000008
07b22617373657441223a223131303630383631383138313430343930343233222c227174794122
3a223130313131222c22617373657442223a2231373535343234333538323635343138383537322
22c2271747942223a22363137393030227d","sig":"a447c703c03cbf851c15ec3564e3b4c681af187fd42146bb824a57c3e904c116","full":"d724a350527244c127cc4a69d58fb9a69fb38d0e5b31e327260eadc4fe582765","timestamp":1424572325},{"token":"phfmcvvc65ag4edesl43pith02t6r4c4c3e4s0t7gofh3p7patamcn8k1k774l02mbloiquivhhhbhh
nkolce88962m7s1bo4v7e6hn2bgcgbbmqbo21tinhddujjtisl0vp1ut1ll7jt7j2vvpslcnihe45qk
86"}]) to NXT.8279528579993996036
Node B
send ({"requestType":"respondtx","NXT":"8279528579993996036","signedtx":"0211575557020a00ac24ff73f21425e9e68936141f8861ac206f72e1cfd18a6a84747c211eb9800
0b1ca129e4e2bdfa9000000000000000000e1f50500000000d724a350527244c127cc4a69d58fb9
a69fb38d0e5b31e327260eadc4fe58276553c7a314591e36e85f9fa704a3dc79b595b868aa9bd0f
aef2413a6d33b93e90399b9f4667dac6e484c792231e187bca63488c4f76149c2a8eb733b073f29
bd4a01000000158e05004253a05e77c0de72011c8cc83488339df3ac6d090000000000013000008
07b22617373657441223a223131303630383631383138313430343930343233222c227174794122
3a223130313131227d","timestamp":1424572310}) to 12240549928875772593
Node A
RESPONDTX.(0211575557020a00ac24ff73f21425e9e68936141f8861ac206f72e1cfd18a6a84747c211eb9800
0b1ca129e4e2bdfa9000000000000000000e1f50500000000d724a350527244c127cc4a69d58fb9
a69fb38d0e5b31e327260eadc4fe58276553c7a314591e36e85f9fa704a3dc79b595b868aa9bd0f
aef2413a6d33b93e90399b9f4667dac6e484c792231e187bca63488c4f76149c2a8eb733b073f29
bd4a01000000158e05004253a05e77c0de72011c8cc83488339df3ac6d090000000000013000008
07b22617373657441223a223131303630383631383138313430343930343233222c227174794122
3a223130313131227d) from (8279528579993996036)
TRADECOMPLETE.({"result":"tradecompleted","txid":"9945291270561970098","signedtx":"0211675e57020a00ec7f665fccae39025531b1cb3c48e584916dba00a7034edc60f9e4111f86145
d048b3c6e60cbe672000000000000000000e1f50500000000000000000000000000000000000000
000000000000000000000000000000000024e4a6b506cff53e92236a228408d1bfc6850367eae34
3d1aecc5d84409c810d878a5b7e68314df84e0e7227c38a6f4eee674e8ffb93c58df636b124b3c8
8eec010000002b8e050034aa683cca0d112701b7faf17b381380997f27000000000000013100008
07b22617373657442223a223137353534323433353832363534313838353732222c227174794222
3a22363137393030227d","othertxid":"4233802116116130288"})
Now this is without anything fancy and requires fill or kill exact match and still a lot of error handling to put around it, but the basic atomic exchange is working again. depending on how long the NXT takes to generate the tx, the exchange happens very quickly. In fact I saw one trade happen immediately as I pressed enter, but usually there is a few second pause for the NXT to generate the tx.
Also the trade is completed offchain and then pushed to the network and with both sides verifying the signatures and details, it is a matter of time before it will get confirmed(*). but until it is, it cant be re-traded.
You can see the matched transactions on the NXT mainnet: 9945291270561970098 and 4233802116116130288
James
(*) there is a small chance for some funny business by the block generator so if you are trading with that node, some precautions are needed. But this is a detail and just requires a bit of fine tuning to the basic mechanism, along with adding a small fee for matching trades.