PHP API creating Sales Order

PHP API creating Sales Order

Can someone please help me with creating a Sales Order using API? I can provide code and response. I tried a lot of things but nothing works for me.

Thank you!

Code:
$access_token = access_token_value();
$data = array(
"customer_id" => "1481060XXXXXXXXXXXXX",
"salesorder_number" => "026986",
"date" => "2021-09-27",
"delivery_method" => "free_shipping",
"line_items" => array(
"item_id" => "272000000247",
"rate" => "112",
"quantity" => "2"
)
);
//$data_string = "JSONString=".urlencode(json_encode($data));
echo "<br><br>".json_encode($data)."<br><br>";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, "https://inventory.zoho.com/api/v1/salesorders?organization_id=XXXXXXXX");
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_HTTPHEADER, array (
'Authorization: Zoho-oauthtoken ' . $access_token,
'Content-Type: application/x-www-form-urlencoded'
));
$response = curl_exec($ch);
$response=json_decode($response);
var_dump($response);

My response:
object(stdClass)#7078 (2) { ["code"]=> int(4) ["message"]=> string(35) "Invalid value passed for JSONString" }
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方