Coder Social home page Coder Social logo

Comments (3)

MoroZvlg avatar MoroZvlg commented on May 30, 2024

Probably, we didn't receive nested parameters. It all depends on how you send and encode parameters
Your data looks correct

from 3commas-official-api-docs.

kirosc avatar kirosc commented on May 30, 2024

@MoroZvlg

I also tried it in Postman but still the same error.
Also, in the error response, the step number in take_profit[steps] changes every time.

POST https://api.3commas.io/public/api/v2/smart_trades?account_id=29187784&pair=USDT_BNB&leverage[enabled]=false&position[type]=buy&position[order_type]=limit&position[units][value]=5&position[price][value]=19.6&take_profit[enabled]=true&take_profit[steps][0][order_type]=limit&take_profit[steps][0][price][type]=bid&take_profit[steps][0][price][value]=21&take_profit[steps][0][volume]=100.0&take_profit[steps][0][trailing][enabled]=false&stop_loss[enabled]=false&api_key=hidden&secret=hidden

image

{
    "error": "record_invalid",
    "error_description": "Invalid parameters",
    "error_attributes": {
        "take_profit[steps]": [
            "is invalid"
        ],
        "take_profit[steps][2][price][type]": [ // Note the step number change every time
            "is missing"
        ],
        "value,percent": [
            "are missing, exactly one parameter must be provided"
        ]
    }
}

from 3commas-official-api-docs.

kirosc avatar kirosc commented on May 30, 2024

Turn out that, I can sign the request with a JSON object instead of a query string. This fixes the problem.

from 3commas-official-api-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.