Problem in creating new Sales invoice using api

,

While Creating Sales invoice using api it doesn’t enter the total and the base amount
Here are my JSON request:
{ "selling_price_list": "Standard Selling", "items" : [ { "base_amount" : 8.0, "rate" : 4.0, "cost_center" :"Main - PAM", "item_name" :"Sugar", "sales_order": "SO-00114", "amount" : 8.0, "docstatus" : 1, "description" : "Sugar", "base_rate": 4.0, "doctype":"Sales Invoice Item", "income_account": "Sales - PAM", "parenttype":"Sales Invoice" } ], "price_list_currency":"EGP", "base_net_total": 8.0, "debit_to": "Debtors - PAM", "conversion_rate" :1, "company" : "PAm", "grand_total" : 8.0, "base_paid_amount": 8.0, "paid_amount" : 8.0, "posting_date":"2017-04-02", "naming_series": "SINV-", "currency": "EGP", "base_grand_total": 8.0, "due_date":"2017-04-02", "plc_conversion_rate": 1, "customer": "Hossam Afify", "Status": "Paid", "doc_status" :1 }

And This the response:

{ "data": { "cash_bank_account": null, "base_write_off_amount": 0, "modified_by": "ahakim@panarab-media.com", "title": "", "packed_items": [], "selling_price_list": "Standard Selling", "return_against": null, "tc_name": null, "source": null, "submit_on_creation": 0, "base_in_words": "", "due_date": "2017-04-02", "doctype": "Sales Invoice", "ignore_pricing_rule": 0, "write_off_cost_center": null, "customer_group": "Individual", "base_discount_amount": 0, "base_total_taxes_and_charges": 0, "items": [ { "item_group": null, "base_price_list_rate": 0, "image": null, "creation": "2017-04-02 17:10:46.314989", "base_amount": 0, "qty": 0, "margin_rate_or_amount": 0, "rate": 4, "dn_detail": null, "owner": "ahakim@panarab-media.com", "cost_center": "Main - PAM", "target_warehouse": null, "actual_qty": 0, "base_net_amount": 0, "quality_inspection": null, "so_detail": null, "modified_by": "ahakim@panarab-media.com", "base_net_rate": 4, "discount_percentage": 0, "item_name": "Sugar", "sales_order": "SO-00114", "amount": 0, "net_rate": 4, "stock_uom": "Nos", "asset": null, "warehouse": null, "docstatus": 0, "actual_batch_qty": 0, "delivery_note": null, "serial_no": null, "description": "Sugar", "parent": "SINV-00454", "brand": null, "barcode": null, "base_rate": 4, "item_code": null, "margin_type": "", "page_break": 0, "doctype": "Sales Invoice Item", "pricing_rule": null, "delivered_qty": 0, "delivered_by_supplier": 0, "price_list_rate": 0, "name": "4eccceede8", "idx": 1, "item_tax_rate": null, "income_account": "Sales - PAM", "modified": "2017-04-02 17:10:46.314989", "expense_account": null, "parenttype": "Sales Invoice", "is_sample_item": 0, "customer_item_code": null, "batch_no": null, "net_amount": 0, "total_margin": 0, "is_fixed_asset": 0, "parentfield": "items" } ], "discount_amount": 0, "name": "SINV-00454", "is_return": 0, "write_off_outstanding_amount_automatically": 0, "taxes": [], "select_print_heading": null, "is_pos": 0, "parentfield": null, "against_income_account": "Sales - PAM", "write_off_amount": 0, "creation": "2017-04-02 17:10:46.314989", "party_account_currency": "EGP", "net_total": 0, "owner": "ahakim@panarab-media.com", "price_list_currency": "EGP", "contact_display": null, "timesheets": [], "write_off_account": null, "payments": [], "next_date": null, "terms": null, "parent": null, "shopify_order_id": null, "shipping_address": null, "customer_address": null, "total_commission": 0, "contact_mobile": null, "c_form_applicable": "No", "base_net_total": 0, "language": "en-US", "rounded_total": 0, "debit_to": "Debtors - PAM", "apply_discount_on": "Grand Total", "offline_pos_name": null, "repeat_on_day_of_month": 0, "contact_person": null, "in_words": "", "recurring_print_format": null, "additional_discount_percentage": 0, "campaign": null, "base_paid_amount": 0, "conversion_rate": 1, "to_date": null, "total_advance": 0, "posting_time": "17:10:46.195209", "total": 0, "customer_name": "Hossam Afify", "commission_rate": 0, "update_stock": 0, "base_total": 0, "from_date": null, "account_for_change_amount": null, "territory": "All Territories", "sales_partner": null, "end_date": null, "company": "PAm", "base_rounded_total": 0, "customer": "Hossam Afify", "grand_total": 0, "notify_by_email": 0, "is_recurring": 0, "idx": 0, "modified": "2017-04-02 17:10:46.314989", "project": null, "is_opening": "No", "posting_date": "2017-04-02", "shipping_address_name": null, "address_display": null, "naming_series": "SINV-", "currency": "EGP", "letter_head": null, "recurring_id": null, "shipping_rule": null, "paid_amount": 0, "base_change_amount": 0, "amended_from": null, "base_grand_total": 0, "recurring_type": "", "advances": [], "docstatus": 0, "status": "Draft", "total_billing_amount": 0, "taxes_and_charges": null, "outstanding_amount": 0, "change_amount": 0, "remarks": "No Remarks", "notification_email_address": null, "c_form_no": null, "plc_conversion_rate": 1, "parenttype": null, "total_taxes_and_charges": 0, "contact_email": null, "sales_team": [] } }

you can take a look at this REST API example for Sales Invoice

1 Like

This topic was automatically closed after 24 hours. New replies are no longer allowed.