Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

261
Views
Binance batchOrder API calling signature error

I was trying to call binance batchOrder CLICK HERE for the documentation reference. Basically i was trying to call binnace batchOrder api for placing multiple order i have provided the clear code and output along with my input. I am looking forward to expert advice

Here is the batchOrder data

 [

 {

  symbol: 'ETHUSDT',

  quantity: 0.425,

  positionSide: 'LONG',         

  side: 'SELL',

  type: 'MARKET'              

 },

 {

  symbol: 'LTCUSDT',

  quantity: 20.765,

  positionSide: 'LONG',

  side: 'SELL',

  type: 'MARKET'

 }

]
const timestamp = Date.now() - 1000
    const recvWindow = 60000
    let doneFlag = false

    var burl = "https://testnet.binancefuture.com";
    var endPoint = "/fapi/v1/batchOrders";
    var dataQueryString = `batchOrders=${encodeURIComponent(JSON.stringify(allOpositeOrders))}&recvWindow=${recvWindow}&timestamp=${timestamp}`;
    var signature = crypto.createHmac('sha256', api_secret).update(dataQueryString).digest('hex');
    var url = burl + endPoint + '?' + dataQueryString + '&signature=' + signature;
    await axios
    .post(url,{}, {
        headers: {
            'Content-Type': 'application/json',
            'X-MBX-APIKEY': api_key
        }
    })
    .then((result) => {
        if (result) {
            return result.data
        } else {
            return null
        }
    }).catch((err) => {
        console.log('err', err)
    });

This is the header of my request

headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'X-MBX-APIKEY': '772d7e9f365aad46411b867c5c110731a32d19fec30ee179bda21d486c9cd129',
      'User-Agent': 'axios/0.27.2',
      'Content-Length': 2
    },
    method: 'post',
    url: 'https://testnet.binancefuture.com/fapi/v1/batchOrders?batchOrders=%5B%7B%22symbol%22%3A%22ETHUSDT%22%2C%22quantity%22%3A0.425%2C%22positionSide%22%3A%22LONG%22%2C%22side%22%3A%22SELL%22%2C%22type%22%3A%22MARKET%22%7D%2C%7B%22symbol%22%3A%22LTCUSDT%22%2C%22quantity%22%3A20.765%2C%22positionSide%22%3A%22LONG%22%2C%22side%22%3A%22SELL%22%2C%22type%22%3A%22MARKET%22%7D%5D&recvWindow=60000&timestamp=1655141771830&signature=275e55faa71e0ba87e444e3ae82b81d98eaf69946e06a659a984d9a58ced0de0',
    data: '{}'
  },

but i am getting following error. I have also tried with .post(url,data=null, {}.... but it return the same error

data: { code: -1022, msg: 'Signature for th9s request is not valid.' }
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!