Marketplace API

Buy orders#

Use this API to fill listings.

Request address#

POST https://www.okx.com/api/v5/mktplace/nft/markets/buy

Request param#

  • Body param
ParameterTypeRequiredDescription
chainStringYesChain name refer to Supported blockchains for details
walletAddressStringYesAddress of wallet filling.
itemsobject[]YesList of item to buy.

Request example#

shell
curl -X POST "https://www.okx.com/api/v5/mktplace/nft/markets/buy" \
     -H "Content-Type: application/json" \
     -H 'OK-ACCESS-KEY: XXX' \
     -H 'OK-ACCESS-TIMESTAMP: XXX' \
     -H 'OK-ACCESS-PASSPHRASE: XXX' \
     -H 'OK-ACCESS-SIGN: XXX' \
     -d '{
            "chain": "bsc",
            "items": [
                {
                    "orderId": 1440952735,
                    "takeCount": 1
                },
                {
                    "orderId": 1440952735,
                    "takeCount": 1
                }
            ],
            "walletAddress": "0xb0295f8ed896413eecc1032b9f97ecc8608c55ad"
         }'

Response example#

200
{
    "code":0,
    "data":{
      "errors":[
      ],
      "steps":[
        {
          "action":"ApprovalCurrency",
          "items":[
            {
              "amount":"300000000000000000",
              "approvalAddress":"0xcce3e3f79cf9091386f84610bb06947e2fc232a3",
              "chain":56,
              "currency":"USDC",
              "currencyUrl":"https://static.coinall.ltd/cdn/explorer/okexchain/exchain_usdc.png",
              "description":"Approval ERC20 to OKX",
              "kind":"erc20Approval",
              "orderIds":[
                "1156591403"
              ],
              "platform":{
                "icon":"https://static.coinall.ltd/cdn/nft/2ffcd699-3e14-4ac3-b6fc-e8e5369ab2fd.png",
                "name":"OKX",
                "source":4
              },
              "status":"complete",
              "tokenAddress":"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d"
            }
          ]
        },
        {
          "action":"TakeOrders",
          "items":[
            {
              "chain":56,
              "contractAddress":"0xcce3e3f79cf9091386f84610bb06947e2fc232a3",
              "description":"Buy tokens on OKX",
              "input":"0x92e6f80700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001183e781264880a5ca05dd025967c1e6dd790e1bd425adc1d14fced1b45bf102000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004e4e7acab24000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004c0618cf13c76c1ffc2168fc47c98453dcc6134f5c88888888888888888888888880000000000000000000000006c7874e005654fc975c82d55830b675e9b11a09100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000b1f442c5a971e00599bf7858114b43fdc71347000000000000000000000000b74932867f98c4ca5099f7799cb364a6c97a07c600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000645a0df00000000000000000000000000000000000000000000000000000000065475be9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b169239bd2f184618cf13c76c1ffc2168fc47c98453dcc6134f5c888888888888888888888888800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000047b4608e69317aa2ebc71148bec5b9f65ead61e5000000000000000000000000000000000000000000000000000000000000767f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000000429d069189e000000000000000000000000000000b1f442c5a971e00599bf7858114b43fdc713470000000000000000000000000000000000000000000000000000000000000041c66d1c598227b6fff21f06a9735b41d46a933a38512e9d9cb6b7aa4a3de851ab72ada2f67f5ddc7715d7761ba65a7447218f961a693d6f80c24447fe91e7d3a41b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000047b4608e69317aa2ebc71148bec5b9f65ead61e5000000000000000000000000000000000000000000000000000000000000767f000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000003c00b1f442c5a971e00599bf7858114b43fdc713476c7874e005654fc975c82d55830b675e9b11a091000000000000000000000000000000000000000000000000",
              "kind":"transaction",
              "orderIds":[
                "1156591403"
              ],
              "platform":{
                "icon":"https://static.coinall.ltd/cdn/nft/2ffcd699-3e14-4ac3-b6fc-e8e5369ab2fd.png",
                "name":"OKX",
                "source":4
              },
              "status":"incomplete",
              "totalPrice":"0.3",
              "value":"0"
            }
          ]
        }
      ]
    },
    "msg":""
  }