API "initAmount": P2P

I have my code

“advNo”: “XXXX”, # SELL ad ID
“price”: price_buy,
“initAmount”: 155,
“advStatus”: 1, # Assuming 1 means active
“tradeType”: “SELL”, # Trade type as SELL

but when I try to execute it, I get an error in initAmount
I need to insert the total amount of USDT in my ad, in this case 155, but I get an error

IF I REMOVE THE LINE EVERYTHING WORKS NORMAL

Failed to update SELL ad: 400 - {“code”:83996,“msg”:“Please check the input info”}

Failed to update SELL ad: 400 - {“code”:83996,“msg”:“Please check the input info”} indicates that there is a problem with the information provided in the request. This could mean that one or more fields are not adhering to the API’s expected format, values, or data types.

Can you please check on the below:
Make sure that:

  1. initAmount is an integer or a float as expected by the API (not a string).
  2. The value of initAmount meets any specified constraints (like minimum or maximum values, increments, etc.).

If you can use the below validation function…

Example of a simple validation function

def validate_params(params):
errors =
if not isinstance(params[‘initAmount’], (int, float)):
errors.append(‘initAmount must be a number’)

# Add other validations as per the API documentation

return errors

params = {
“advNo”: “XXXX”, # SELL ad ID
“price”: price_buy,
“initAmount”: 155,
“advStatus”: 1, # Assuming 1 means active
“tradeType”: “SELL” # Trade type as SELL
}

errors = validate_params(params)
if errors:
print(“Validation errors:”, errors)
else:
response = send_signed_request(“POST”, “/sapi/v1/c2c/ads/updateStatus”, params)
print(response)

1 Like

no working friend…

Did you get some error message? If you can share that please.