Hi All I'm getting an incomplete response from the...
# suitescript
s
Hi All I'm getting an incomplete response from the https.POST request, and because of that I'm unable to use JSON.parse() or can we specify the response length? Request: var invoice_obj_Response = https.request({ method: https.Method.POST, headers: headerObj, url: 'https://www.zohoapis.com/books/v3/invoices', body: JSON.stringify(zoho_Invoice) }); Response: {"code":0,"message":"The invoice has been created.","invoice":{"invoice_id":"2679666000006194023","invoice_number":"PRJ00805","date":"2023-12-01","due_date":"2023-12-16","offline_created_date_with_time":"","customer_id":"2679666000000130033","customer_name":"AAA Ltd","customer_custom_fields":[],"customer_custom_field_hash":{},"email":"","currency_id":"2679666000000000099","invoice_source":"Api","currency_code":"INR","currency_symbol":"₹","currency_name_formatted":"INR- Indian Rupee","status":"draft","custom_fields":[],"custom_field_hash":{},"recurring_invoice_id":"","place_of_supply":"MH","payment_terms":15,"payment_terms_label":"Net 15","payment_reminder_enabled":true,"payment_made":0.00,"zcrm_potential_id":"","zcrm_potential_name":"","reference_number":"","is_inventory_valuation_pending":false,"lock_details":{},"line_items":[{"line_item_id":"2679666000006194025","item_id":"2679666000005779047","sku":"","item_order":1,"product_type":"goods","has_product_type_mismatch":false,"has_invalid_hsn":false,"name":"3D Printers","internal_name":"","description":"","unit":"","quantity":1.00,"discount_amount":0.00,"discount":0.00,"discounts":[],"bcy_rate":45000.00,"rate":45000.00,"account_id":"2679666000000000388","account_name":"Sales","header_id":"","header_name":"","pricebook_id":"","tax_id":"2679666000001705243","tax_name":"GST18","tax_type":"tax_group","tax_percentage":18,"gst_treatment_code":"","item_total":45000.00,"item_custom_fields":[{"field_id":"2679666000005140059","customfield_id":"2679666000005140059","show_in_store":false,"show_in_portal":false,"is_active":true,"index":1,"label":"Batch No","show_on_pdf":true,"edit_on_portal":false,"edit_on_store":false,"api_name":"cf_batch_no","show_in_all_pdf":true,"value_formatted":"0","search_entity":"item","data_type":"number","placeholder":"cf_batch_no","value":"0","is_dependent_field":false},{"field_id":"2679666000005140085","customfield_id":"2679666000005140085","show_in_store":false,"show_in_portal":false,"is_active":true,"index":2,"label":"Expiry date","show_on_pdf":true,"edit_on_portal":false,"edit_on_store":false,"api_name":"cf_expiry_date","show_in_all_pdf":true,"value_formatted":"16/10/2023","search_entity":"item","data_type":"date","placeholder":"cf_expiry_date","value":"2023-10-16","is_dependent_field":false},{"field_id":"2679666000005165003","customfield_id":"2679666000005165003","show_in_store":false,"show_in_portal":false,"is_active":true,"index":3,"label":"Locations","show_on_pdf":true,"edit_on_portal":false,"edit_on_store":false,"api_name":"cf_locations","show_in_all_pdf":true,"value_formatted":"PUNE","search_entity":"item","data_type":"string","placeholder":"cf_locations","value":"PUNE","is_dependent_field":false}],"pricing_scheme":"unit","tags":[],"documents":[],"hsn_or_sac":"84779000","reverse_charge_tax_id":"","line_item_taxes":[{"tax_id":"2679666000001705235","tax_name":"SGST9 (9%)","tax_amount":4050.00},{"tax_id":"2679666000001705239","tax_name":"CGST9 (9%)","tax_amount":4050.00}],"bill_id":"","bill_item_id":"","warehouse_id":"2679666000001705032","warehouse_name":"Pune","track_serial_for_package":false,"track_batch_for_package":false,"project_id":"","time_entry_ids":[],"expense_id":"","item_type":"inventory","expense_receipt_name":"","purchase_rate":42000.000000,"salesorder_item_id":"","cost_amount":0,"markup_percent":0},{"line_item_id":"2679666000006194027","item_id":"2679666000005779047","sku":"","item_order":2,"product_type":"goods","has_product_type_mismatch":false,"has_invalid_hsn":false,"name":"3D Printers","internal_name":"","description":"","unit":"","quantity":3.00,"discount_amount":0.00,"discount":0.00,"discounts":[],"bcy_rate":400.00,"rate":400.00,"account_id":"2679666000000000388","account_name":"Sales","header_id":"","header_name":"","pricebook_id":"","tax_id":"2679666000001705243","tax_name":"GST18","tax_type":"tax_group","tax_percentage":18,"gst_treatment_code":"","item_total":1200.00,"item_custom_fields":[{"field_id":"2679666
b
are you sure the response is incomplete
or do you not know the limitations of log.debug
🙌 1