Setting a discount to the sales order using the API.

Setting a discount to the sales order using the API.

I have encountered a problem while implementing Sales Order creation via the API. When I try to set the discount field for a Sales Order record and declare the overall discount - it is not applied to the record: http://prntscr.com/qn1md0.

In the v1 API the "Discount" and "Adjustment" fields were set the same way:
...
<FL val="Adjustment">123</FL>
<FL val="Discount">123</FL>
...

Now when I try to do a simmilar thing in the v2 API, it no longer works:

$record = ZCRMRestClient::getInstance()->getRecordInstance("Sales_Orders", $id_zoho);
...
$record->setFieldValue('Adjustment', (float)$order->total_shipping);
$record->setFieldValue('Discount', (float)$order->total_discounts_tax_incl);
...
$record->create();

The Adjustment value gets applied correctly, but the discount is ignored. How can I apply the total discount to Sales Order records?

    Access your files securely from anywhere









                          Zoho Developer Community




                                                • Desk Community Learning Series


                                                • Digest


                                                • Functions


                                                • Meetups


                                                • Kbase


                                                • Resources


                                                • Glossary


                                                • Desk Marketplace


                                                • MVP Corner


                                                • Word of the Day


                                                • Ask the Experts





                                                          Manage your brands on social media



                                                                Zoho TeamInbox Resources



                                                                    Zoho CRM Plus Resources

                                                                      Zoho Books Resources


                                                                        Zoho Subscriptions Resources

                                                                          Zoho Projects Resources


                                                                            Zoho Sprints Resources


                                                                              Qntrl Resources


                                                                                Zoho Creator Resources



                                                                                    Zoho CRM Resources

                                                                                    • CRM Community Learning Series

                                                                                      CRM Community Learning Series


                                                                                    • Kaizen

                                                                                      Kaizen

                                                                                    • Functions

                                                                                      Functions

                                                                                    • Meetups

                                                                                      Meetups

                                                                                    • Kbase

                                                                                      Kbase

                                                                                    • Resources

                                                                                      Resources

                                                                                    • Digest

                                                                                      Digest

                                                                                    • CRM Marketplace

                                                                                      CRM Marketplace

                                                                                    • MVP Corner

                                                                                      MVP Corner







                                                                                        Design. Discuss. Deliver.

                                                                                        Create visually engaging stories with Zoho Show.

                                                                                        Get Started Now


                                                                                          Zoho Show Resources

                                                                                            Zoho Writer

                                                                                            Get Started. Write Away!

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

                                                                                              Zoho CRM コンテンツ






                                                                                                Nederlandse Hulpbronnen


                                                                                                    ご検討中の方