Regarding editing invoice using PUT request

Hi,

I am trying to edit the existing invoice using the below request body, but sometimes giving error as below,

[
{
"$severity": "error",
"$dataCode": "UnexpectedError",
"$message": "An unexpected error occurred.",
"$source": ""
}
]

Below is my request body:


{
"sales_invoice":{
"id": "0df6c66d9cf5448480f9bb1938401b80",
"displayed_as": "SI-1",
"$path": "/sales_invoices/0df6c66d9cf5448480f9bb1938401b80",
"created_at": "2019-07-22T11:51:38Z",
"updated_at": "2019-07-22T11:51:38Z",
"links": [
{
"href": "https://accounting.na.sageone.com/invoicing/sales_invoices/0df6c66d9cf5448480f9bb1938401b80",
"rel": "alternate",
"type": "text/html"
}
],
"editable": true,
"tax_calculation_method": null,
"transaction": {
"id": "3af777ba850f4705b559b19b49df775f",
"displayed_as": "",
"$path": "/transactions/3af777ba850f4705b559b19b49df775f"
},
"transaction_type": {
"id": "SALES_INVOICE",
"displayed_as": "Sales Invoice",
"$path": "/transaction_types/SALES_INVOICE"
},
"contact": {
"id": "48c73e6d6fa04c47be3d34bf19525617",
"displayed_as": "Saurabh",
"$path": "/contacts/48c73e6d6fa04c47be3d34bf19525617"
},
"invoice_number_prefix": "SI-",
"invoice_number": "SI-1",
"contact_name": "Saurabh",
"contact_reference": null,
"date": "2019-07-22",
"due_date": "2019-08-21",
"reference": "",
"main_address_free_form": "134 Main Street\nBoston AB",
"main_address": {
"id": "c558e49ede144e45bf2e2755c0d05ae2",
"displayed_as": "134 Main Street\nBoston AB",
"$path": "/contacts/c558e49ede144e45bf2e2755c0d05ae2",
"address_type": {
"id": "SALES",
"displayed_as": "Sales",
"$path": "/address_types/SALES"
},
"address_line_1": "134 Main Street",
"address_line_2": "",
"city": "Boston",
"region": "AB",
"postal_code": "",
"country": {
"id": "CA",
"displayed_as": "Canada (CA)",
"$path": "/countries/CA"
},
"country_group": {
"id": "CA",
"displayed_as": "Canada",
"$path": "/country_groups/CA"
}
},
"delivery_address_free_form": "134 Main Street\nBoston AB",
"delivery_address": {
"id": "d0b38bc722eb4118ba9f6fb357e7ba76",
"displayed_as": "134 Main Street\nBoston AB",
"$path": "/contacts/d0b38bc722eb4118ba9f6fb357e7ba76",
"address_type": {
"id": "DELIVERY",
"displayed_as": "Delivery",
"$path": "/address_types/DELIVERY"
},
"address_line_1": "134 Main Street",
"address_line_2": "",
"city": "Boston",
"region": "AB",
"postal_code": "",
"country": {
"id": "CA",
"displayed_as": "Canada (CA)",
"$path": "/countries/CA"
},
"country_group": {
"id": "CA",
"displayed_as": "Canada",
"$path": "/country_groups/CA"
}
},
"notes": "",
"terms_and_conditions": "",
"shipping_net_amount": "0.0",
"shipping_tax_rate": {
"id": "CA_ZERO",
"displayed_as": "Zero Rated 0.00%",
"$path": "/tax_rates/CA_ZERO"
},
"shipping_tax_amount": "0.0",
"shipping_tax_breakdown": [],
"shipping_total_amount": "0.0",
"net_amount": "230.0",
"tax_amount": "0.0",
"total_amount": "230.0",
"payments_allocations_total_amount": "0.0",
"payments_allocations_total_discount": "0.0",
"total_paid": "0.0",
"outstanding_amount": "230.0",
"currency": {
"id": "CAD",
"displayed_as": "Canadian Dollar (CAD)",
"$path": "/currencies/CAD"
},
"exchange_rate": "1.0",
"inverse_exchange_rate": "1.0",
"base_currency_shipping_net_amount": "0.0",
"base_currency_shipping_tax_amount": "0.0",
"base_currency_shipping_tax_breakdown": [],
"base_currency_shipping_total_amount": "0.0",
"total_quantity": "2.0",
"total_discount_amount": "0.0",
"base_currency_total_discount_amount": "0.0",
"base_currency_net_amount": "230.0",
"base_currency_tax_amount": "0.0",
"base_currency_total_amount": "230.0",
"base_currency_outstanding_amount": "230.0",
"status": {
"id": "UNPAID",
"displayed_as": "Unpaid",
"$path": "/artefact_statuses/UNPAID"
},
"sent": true,
"sent_by_email": true,
"void_reason": null,
"invoice_lines": [
{
"id": "d46f2e33104b43f08aa7254b3116d094",
"displayed_as": "Paper",
"description": "Paper",
"product": {
"id": "bf9ca41125d64d6499e8acc0fe482719",
"displayed_as": "Paper",
"$path": "/products/bf9ca41125d64d6499e8acc0fe482719"
},
"service": null,
"ledger_account": {
"id": "41ac37c0ac7311e9934112dfbffd6e70",
"displayed_as": "Sales - Products (4000)",
"$path": "/ledger_accounts/41ac37c0ac7311e9934112dfbffd6e70"
},
"trade_of_asset": false,
"quantity": "2.0",
"unit_price": "100.0",
"net_amount": "230.0",
"tax_rate": {
"id": "CA_ZERO",
"displayed_as": "Zero Rated 0.00%",
"$path": "/tax_rates/CA_ZERO"
},
"tax_amount": "0.0",
"tax_breakdown": [],
"total_amount": "230.0",
"base_currency_unit_price": "100.0",
"unit_price_includes_tax": false,
"base_currency_net_amount": "230.0",
"base_currency_tax_amount": "0.0",
"base_currency_tax_breakdown": [],
"base_currency_total_amount": "230.0",
"eu_goods_services_type": null,
"discount_amount": "0.0",
"base_currency_discount_amount": "0.0",
"discount_percentage": "0.0"
}
],

"last_paid": "",
"original_quote_estimate": null,
"tax_address_region": {
"id": "CA-AB",
"displayed_as": "Alberta",
"$path": "/address_regions/CA-AB"
},

"withholding_tax_rate": null,
"withholding_tax_amount": null,
"base_currency_withholding_tax_amount": null,
"tax_reconciled": false

}
}

Can anybody help me resolve this issue.

Thanks & Regards,

Saurabh.

Parents Reply Children
No Data