Update invoice by ID
curl --request PUT \
--url https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/invoices/{invoiceId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tax_rate": "0.00",
"title": "some string"
}
'import requests
url = "https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/invoices/{invoiceId}"
payload = {
"tax_rate": "0.00",
"title": "some string"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tax_rate: '0.00', title: 'some string'})
};
fetch('https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/invoices/{invoiceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": false,
"response": {}
}{
"error": true,
"errors": [
"error message",
"error message"
]
}{
"message": "Unauthorized"
}{
"message": "Request URL or object not found"
}{
"message": "Internal Server Error"
}Invoices
Update invoice by ID
Update an invoice
PUT
/
invoices
/
{invoiceId}
Update invoice by ID
curl --request PUT \
--url https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/invoices/{invoiceId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tax_rate": "0.00",
"title": "some string"
}
'import requests
url = "https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/invoices/{invoiceId}"
payload = {
"tax_rate": "0.00",
"title": "some string"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tax_rate: '0.00', title: 'some string'})
};
fetch('https://ywe3crmpll.execute-api.us-east-2.amazonaws.com/stage/invoices/{invoiceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": false,
"response": {}
}{
"error": true,
"errors": [
"error message",
"error message"
]
}{
"message": "Unauthorized"
}{
"message": "Request URL or object not found"
}{
"message": "Internal Server Error"
}Body raw (json)
{
"customer_id"// optional | nullable | integer | required if job_id is not set and is_template is not set or false | existing customer id
"job_id"// optional | nullable | integer | required if is_template is not set or false | existing job id
"status"// optional | integer | acceptable_values: 2(draft),3(invoiced),4(paid),5(partialy paid),6(void)
"status_id"// optional | integer | existing invoice type custom status id
"status_workflow_id"// optional | integer | existing invoice type status workflow id
"notes"// optional | string | max:4000
"invoiced_date"// optional | nullable | timestamp
"due_date"// optional | nullable | timestamp
"tax_rate"// required | string | numeric | example: "0.00"
"is_template"// optional | boolean | Description: if true, the invoice will be template
"title"// optional | string | max:255
"author_id"// optional | nullable | integer | existing user id
"location_id"// optional | nullable | integer | existing location id
"contract_id"// optional | nullable | integer | existing contract id
"commission_type"// optional | integer | between:0,3
"commission_percent"// optional | integer | between:0,100
"invoice_use_logo"// optional | nullable | boolean
"invoice_show_line_item_unit_price"// optional | nullable | boolean
"invoice_show_line_item_qty"// optional | nullable | boolean
"invoice_show_line_item_taxed"// optional | nullable | boolean
"invoice_show_line_item_total"// optional | nullable | boolean
"invoice_show_line_item_desc"// optional | nullable | boolean
"invoice_show_line_item_sku"// optional | nullable | boolean
"invoice_show_total_tax"// optional | nullable | boolean
"invoice_show_job_title"// optional | nullable | boolean
"invoice_show_job_location"// optional | nullable | boolean
"invoice_show_assigned_members"// optional | nullable | boolean
"invoice_show_author"// optional | nullable | boolean
"invoice_show_service_address"// optional | nullable | boolean
"invoice_contract_signature_lines"// optional | integer | between:0,2
"invoice_amount_due_display_type"// optional | string | acceptable_values: remaining_balance,set_amount,percentage_of_total,none
"invoice_amount_due_display_value"// optional | string
"invoice_pdf_title"// optional | string | max:100
"estimate_status"// optional | integer
"theme_id"// optional | nullable | integer | existing theme id
"internal_notes"// optional | nullable | string
"reference"// optional | nullable | string
"hvi"// optional | numeric
"company_profile_id"// optional | nullable | integer | existing alternate company profile id
"maintenance_agreement_id"// optional | nullable | integer | existing maintenance agreement id
"maintenance_occurrence_id"// optional | nullable | integer | existing maintenance occurrence id
"occurrence_date"// optional | nullable | required when maintenance agreement id is set and maintenance occurrence id is empty
"qbd_class_id" // optional | nullable | integer | existing Quickbook Class id
"qbd_discount_id" // optional | nullable | integer | existing Quickbook Discount Item id
"qbo_sales_tax_code_id" // optional | nullable | integer | existing Quickbook Tax Code id
"display_settings": {// optional | nullable | object
"show_payment_button"// required | boolean
"show_signature_button"// required | boolean
"show_company_title"// optional | boolean
"is_customer_phone_visible"// optional | boolean
"is_modified_customer"// optional | boolean
"modified_customer_display_name"// optional | string
"modified_customer_display_address"// optional | string
}
"estimate_display_settings": {// optional | nullable | object
"show_payment_button"// required | boolean
"show_company_title"// optional | boolean
"is_customer_phone_visible"// optional | boolean
}
"expenses": [// optional | nullable | array of objects
{
"amount"// required | string | numeric
"description"// optional | string | max:1000
"title"// required | string | min:3 | max:60
"type"// required | string | acceptable_values: service,product
}
]
"options": [// optional | nullable | array of objects
{
"is_selected"// required | boolean
"is_default"// required | boolean
"group_number"// required | integer
"title"// optional | nullable | string
"description"// optional | nullable | string
"photo_id"// optional | nullable | integer | existing file id
"qbd_discount_id"// optional | nullable | integer | existing Quickbook Discount Item id
"tab_title"// optional | nullable | string
"line_discount": { // optional | nullable | object
"title"// required | string
"description"// optional | nullable | string
"type"// required | string
"amount"// required | string | numeric | example: "0.00"
}
}
]
"add_on_options": [// optional | nullable | array of objects
{
"is_selected"// required | boolean
"is_default"// required | boolean
"group_number"// required | integer
"title"// optional | nullable | string
"description"// optional | nullable | string
"photo_id"// optional | nullable | integer | existing file id
"tab_title"// optional | nullable | string
}
]
"line_items": [ // optional | nullable | array of objects | required if company xero is enabled and not_optional_line_items is not set
{
"line_number"// required | nullable | integer
"line_type"// optional | nullable | string | accepatable_values: item, group
"line_title"// required | nullable | string
"line_description"// optional | nullable | string
"line_price_visibility"// required | nullable | string | accepatable_values: all, component, group
"line_visibility"// required | nullable | string | accepatable_values: all, component, group
"line_quantity"// nullable | numeric
"is_selected"// nullable | boolean
"is_optional"// nullable | boolean
"qbo_group_item_ref"// optional | nullable | string
"source"// optional | nullable | integer
"group_number"// nullable | integer
"commission_amount"// nullable | string | numeric | example: "0.00"
"hvi_amount"// string | numeric | example: "0.00"
"pricebook_id" // nullable | integer | existing Pricebook id
"flat_rate_job_id" // nullable | integer | existing pricebook flat rate job id
"line_components": [
{
"id"// required | integer | existing item id
"title"// optional | string |
"description"// optional | string | required if title is not set
"xero_sales_account"// optional | nullable | string | max:1000
"xero_tax_account"// optional | nullable | string | max:1000
"tax_rate"// optional | string | max:1000 | example: "0.00"
"file_ids"// optional | array | description: array of existing file ids
"price_update_method"// nullable | string | accepatable_values: set_price_manually,automatic_markup,use_cmp_pricing
"automatic_markup_percentage"// nullable | string | required, if price_update_method is automatic_markup
"line_discount"// nullable | array
"line_surcharge"// nullable | array
"serialized_inventory_id"// nullable | integer
"qbo_line_item_id"// nullable | integer
"qbo_sales_tax_code_id"// optional | nullable | integer | existing Quickbook Tax Code id
"unit_price"// required | numeric
"quantity"// required | numeric
"taxable" // required | boolean
}
]
}
]
"optional_line_items": [
{
"line_number"// required | nullable | integer
"line_type"// optional | nullable | string | accepatable_values: item, group
"line_title"// required | nullable | string
"line_description"// optional | nullable | string
"line_price_visibility"// required | nullable | string | accepatable_values: all, component, group
"line_visibility"// required | nullable | string | accepatable_values: all, component, group
"line_quantity"// nullable | numeric
"is_selected"// nullable | boolean
"is_optional"// nullable | boolean
"qbo_group_item_ref"// optional | nullable | string
"source"// optional | nullable | integer
"group_number"// nullable | integer
"commission_amount"// nullable | string | numeric | example: "0.00"
"hvi_amount"// string | numeric | example: "0.00"
"pricebook_id" // nullable | integer | existing Pricebook id
"flat_rate_job_id" // nullable | integer | existing pricebook flat rate job id
"line_components": [
{
"id"// required | integer | existing item id
"title"// optional | string |
"description"// optional | string | required if title is not set
"xero_sales_account"// optional | nullable | string | max:1000
"xero_tax_account"// optional | nullable | string | max:1000
"tax_rate"// optional | string | max:1000 | example: "0.00"
"file_ids"// optional | array | description: array of existing file ids
"price_update_method"// nullable | string | accepatable_values: set_price_manually,automatic_markup,use_cmp_pricing
"automatic_markup_percentage"// nullable | string | required, if price_update_method is automatic_markup
"line_discount"// nullable | array
"line_surcharge"// nullable | array
"serialized_inventory_id"// nullable | integer
"qbo_line_item_id"// nullable | integer
"qbo_sales_tax_code_id"// optional | nullable | integer | existing Quickbook Tax Code id
"unit_price"// required | numeric
"quantity"// required | numeric
"taxable" // required | boolean
}
]
}
]
"not_optional_line_items": [
{
"line_number"// required | nullable | integer
"line_type"// optional | nullable | string | accepatable_values: item, group
"line_title"// required | nullable | string
"line_description"// optional | nullable | string
"line_price_visibility"// required | nullable | string | accepatable_values: all, component, group
"line_visibility"// required | nullable | string | accepatable_values: all, component, group
"line_quantity"// nullable | numeric
"is_selected"// nullable | boolean
"is_optional"// nullable | boolean
"qbo_group_item_ref"// optional | nullable | string
"source"// optional | nullable | integer
"group_number"// nullable | integer
"commission_amount"// nullable | string | numeric | example: "0.00"
"hvi_amount"// string | numeric | example: "0.00"
"pricebook_id" // nullable | integer | existing Pricebook id
"flat_rate_job_id" // nullable | integer | existing pricebook flat rate job id
"line_components": [
{
"id"// required | integer | existing item id
"title"// optional | string |
"description"// optional | string | required if title is not set
"xero_sales_account"// optional | nullable | string | max:1000
"xero_tax_account"// optional | nullable | string | max:1000
"tax_rate"// optional | string | max:1000 | example: "0.00"
"file_ids"// optional | array | description: array of existing file ids
"price_update_method"// nullable | string | accepatable_values: set_price_manually,automatic_markup,use_cmp_pricing
"automatic_markup_percentage"// nullable | string | required, if price_update_method is automatic_markup
"line_discount"// nullable | array
"line_surcharge"// nullable | array
"serialized_inventory_id"// nullable | integer
"qbo_line_item_id"// nullable | integer
"qbo_sales_tax_code_id"// optional | nullable | integer | existing Quickbook Tax Code id
"unit_price"// required | numeric
"quantity"// required | numeric
"taxable" // required | boolean
}
]
}
]
"payments": [// optional | nullable | array of objects
{
"invoice_id"// required | integer | existing invoice id
"payment_date"// required | timestamp
"amount"// required | string | numeric | example: "1.00"
"method"// required | string | accepatable_values: cash,check,card,square,bank_transfer,other
"payment_method_id"// optional | nullable | integer | existing payment method id
"qbd_discount_account_id"// optional | nullable | integer | required if qbd_discount_amount is set | existing Quickbooks Account id
"qbd_discount_amount"// optional | nullable | string | numeric | example: "1.00"
"notes"// optional | string | max:4000
"square_transaction_id"// optional | string | max:4000
"can_sync_with_integrations"// optional | nullable | boolean
}
],
"customfields": [ // optional | array | description: array of custom fleds
{
"id" // optional | nullable | required if field_instance_id is not set | integer | custom field id
"field_instance_id" // optional | nullable | required if id is not set | integer | custom field instance id
"value" // required | string | custom value
},
{
"id" // optional | nullable | required if field_instance_id is not set | integer | custom field id
"field_instance_id" // optional | nullable | required if id is not set | integer | custom field instance id
"value" // required | string | custom value
}
],
// THis is for sending invoice via email
"emaildata": {// optional | nullable | object
"from_name"// required | string | max:255
"from_email"// required| email | max:255
"to_email"// required| email | max:255
"cc_address"// optional | comma separated emails
"bcc_address"// optional | comma separated emails
"subject"// required | string | max:500
"body"// required | string
"payment_request_amount"// optional | nullable | numeric | min:0
"payment_request_amount_type"// optional | nullable | string | accepatable_values: amount, percent
"attachment_ids"// optional | nullable | array | existing file ids
"visible_file_ids"// optional | nullable | array | existing file ids
"attach_dynamic_url_to_email"// optional | nullable | boolean
"show_signature_request"// optional | nullable | boolean
"show_payment_request"// optional | nullable | boolean
"is_credit_card_payment_enabled"// optional | nullable | boolean
"is_ach_payment_enabled"// optional | nullable | boolean
"is_pdf_send_mode"// optional | nullable | boolean
"is_dynamic_send_mode"// optional | nullable | boolean
"include_invoice_pdf"// optional | nullable | boolean
"is_card_fee_recovery_enabled"// optional | nullable | boolean
}
}
Body
application/json
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Required if company xero is enabled and not_optional_line_items is not set.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes