Jump to content

Main address and delivery address are not saving in sales invoices


 Share

Recommended Posts

Hi Mark,
              I am sending below post data and I am expecting this main address to be reflect in sales invoice in sage application. But it's not reflecting.
             {
  "sales_invoice": {
    "contact_id": "00d6b44eacd94619990586a51ec59a43",
    "date": "2023-09-21",
    "invoice_number_prefix": "INVN#",
    "invoice_number": "78694",
    
  },
  "delivery_address": {
    "address_line_1": "2-188\/2,Loyal society",
    "address_line_2": "3-188\/3,Loyal society",
    "city": "Atlantic city",
    "postal_code": 0,
    "country_id": "US",
    "address_type_id": "DELIVERY",
    "region": ""
  },
  "main_address": {
    "address_line_1": "2-188\/2,Loyal society",
    "address_line_2": "3-188\/3,Loyal society",
    "city": "Atlantic city",
    "postal_code": 0,
    "country_id": "US",
    "address_type_id": "SALES"
  }
}


Thanks 
Ananth

Link to comment
Share on other sites

Thanks Ananth,

There are a few different issues with your body, some which would be ignored and others that would cause an http 422 response.

The invoice_number_prefix is set using the invoice_settings API sales_invoice_number_prefix and cannot be defined when creating the sales_invoice.
The same is also true for the invoice_number. This is assigned incrementally on creation based on the next_invoice_number in invoice_settings. 

The major issue with the params is that you have not included any invoice_lines with the value of the transaction. 

I provided the below body as an example to POST a sales_invoice and have also included a screenshot of the UI displaying the resulting sales_invoice. You'll need to change the id's for those belonging to the business you are using.

This guide may also provide some additional information in relation to what you are attempting.

 

{
	"sales_invoice": {
		"contact_id": "8f9cbf3eb26f4a5fb2e38d29c914f317",
		"date": "2023-09-22",
		"reference": "Test Invoice",
		"invoice_lines": [{
				"description": "Test Item Line description",
				"ledger_account_id": "08c7664018ed11edbcc60e97dc3b579b",
				"unit_price": "1.23",
				"quantity": "10 ",
                "tax_rate_id": "79a5623d3469494c95e6ea906172f390",   
                "tax_amount":"0.74"
                }],
            "main_address":{
                 "address_line_1":"2-188\/2,Loyal society",
                 "address_line_2":"3-188\/3,Loyal society",
                 "City":"Atlantic city",
                 "postal_code":"0",
                 "country_id": "US"
             },
             "delivery_address":{
                 "address_line_1":"2-188\/2,Loyal society",
                 "address_line_2":"3-188\/3,Loyal society",
                 "City":"Atlantic city",
                 "postal_code":"0",
                 "region": "",
                 "country_id": "US"
             }

}}

 

Screenshot 2023-09-22 at 12.14.23.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...