Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems during postOrderCreate - body not json #17

Open
Savchuk opened this issue Jan 7, 2023 · 5 comments
Open

Problems during postOrderCreate - body not json #17

Savchuk opened this issue Jan 7, 2023 · 5 comments

Comments

@Savchuk
Copy link

Savchuk commented Jan 7, 2023

Hello
I'm using $bybit->privates()->postOrderCreate with necessary parameters
[body] => {"0":{"side":"Sell","symbol":"ETHUSDT","qty":0.2,"price":1261.15},"api_key":"...","timestamp":16730...,"sign":"..."}

but getting the answer:
[ret_msg] => body not json
Help plese
Thank you

@zhouaini528
Copy link
Owner

[body] => {"api_key":"....","order_type":"Limit","price":"4000","qty":"1","side":"Buy","symbol":"BTCUSD","time_in_force":"GoodTillCancel","timestamp":1673401541233,"sign":"...."}

your body is not right.

@zhouaini528
Copy link
Owner

Hello I'm using $bybit->privates()->postOrderCreate with necessary parameters [body] => {"0":{"side":"Sell","symbol":"ETHUSDT","qty":0.2,"price":1261.15},"api_key":"...","timestamp":16730...,"sign":"..."}

but getting the answer: [ret_msg] => body not json Help plese Thank you
2023-01-11 17-36-00屏幕截图

$bybit=new BybitLinear($key,$secret);

$result=$bybit->privates()->postOrderCreate([
        //'order_link_id'=>'xxxxxxxxxxxxxx',
        'side'=>'Sell',
        'symbol'=>'ETHUSDT',
        'order_type'=>'Limit',
        'qty'=>'0.25',
        'price'=>'40000',
        'time_in_force'=>'GoodTillCancel',

        'reduce_only'=>'false',
        'close_on_trigger'=>'false',
    ]);
    print_r($result);

@Savchuk
Copy link
Author

Savchuk commented Jan 21, 2023 via email

@Savchuk
Copy link
Author

Savchuk commented Jan 25, 2023 via email

@Savchuk
Copy link
Author

Savchuk commented Jan 25, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants