79483584

Date: 2025-03-04 11:50:58
Score: 0.5
Natty:
Report link
Based on furas answer,I discovered that not only body must be included, but also the parameters. So the create_withdrawal must be implemented like this:

def create_withdrawal(self, ccy, amount):
  clientId = self.create_client_id()
  endpoint = f'/api/v5/fiat/create-withdrawal?paymentAcctId=my-account?ccy={ccy}?amt={amount}?paymentMethod=PIX?clientId={clientId}'
  body = {
      "paymentAcctId": "my-account",
      "ccy": ccy,
      "amt": amount,
      "paymentMethod": "PIX",
      "clientId": clientId,
  }
  url = self.baseURL + endpoint
  request = 'POST'
  header = self.get_header(request, endpoint, body = json.dumps(body))
  response = requests.post(url, headers = header, data = json.dumps(body))
  return response.json()
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Nilson Cesar