Skip to main content
PUT
/
api
/
sale-invoices
/
{id}
Edit the given sale invoice.
curl --request PUT \
  --url https://api.example.com/api/sale-invoices/{id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'organization-id: <organization-id>' \
  --data '
{
  "customerId": 1,
  "invoiceDate": "2023-01-01T00:00:00Z",
  "dueDate": "2023-01-15T00:00:00Z",
  "entries": [
    {
      "index": 1,
      "itemId": 1,
      "rate": 1,
      "quantity": 1,
      "discount": 1,
      "discountType": "percentage",
      "description": "This is a description",
      "taxCode": "123456",
      "taxRateId": 1,
      "warehouseId": 1,
      "projectId": 1,
      "projectRefId": 1,
      "projectRefType": "TASK",
      "projectRefInvoicedAmount": 100,
      "sellAccountId": 1020,
      "costAccountId": 1021
    }
  ],
  "attachments": [
    {
      "key": "123456"
    }
  ],
  "invoiceNo": "INV-001",
  "referenceNo": "REF-001",
  "delivered": false,
  "invoiceMessage": "Thank you for your business",
  "termsConditions": "Payment due within 14 days",
  "exchangeRate": 1,
  "warehouseId": 1,
  "branchId": 1,
  "projectId": 1,
  "isInclusiveTax": false,
  "pdfTemplateId": 1,
  "paymentMethods": [
    {
      "paymentIntegrationId": 1,
      "enable": true
    }
  ],
  "discount": 10,
  "discountType": "percentage",
  "adjustment": 5,
  "fromEstimateId": 1
}
'

Headers

Authorization
string
required

Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.

Example:

"Bearer bc_1234567890abcdef"

organization-id
string
required

Required if Authorization is a JWT token. The organization ID to operate within.

Path Parameters

id
number
required

The sale invoice id

Body

application/json
customerId
number
required

Customer ID

Example:

1

invoiceDate
string<date-time>
required

Invoice date

Example:

"2023-01-01T00:00:00Z"

dueDate
string<date-time>
required

Due date

Example:

"2023-01-15T00:00:00Z"

entries
object[]
required

Invoice line items

Minimum array length: 1
attachments
string[]
required

The attachments of the sale receipt

Example:
[{ "key": "123456" }]
invoiceNo
string

Invoice number

Example:

"INV-001"

referenceNo
string

Reference number

Example:

"REF-001"

delivered
boolean
default:false

Whether the invoice is delivered

invoiceMessage
string

Invoice message

Example:

"Thank you for your business"

termsConditions
string

Terms and conditions

Example:

"Payment due within 14 days"

exchangeRate
number

Exchange rate

Required range: x >= 0
Example:

1

warehouseId
number

Warehouse ID

Example:

1

branchId
number

Branch ID

Example:

1

projectId
number

Project ID

Example:

1

isInclusiveTax
boolean

Whether tax is inclusive

Example:

false

pdfTemplateId
number

PDF template ID

Example:

1

paymentMethods
object[]

Payment methods

discount
number

Discount value

Example:

10

discountType
enum<string>

Discount type

Available options:
percentage,
amount
Example:

"percentage"

adjustment
number

Adjustment amount

Example:

5

fromEstimateId
number

ID of the estimate this invoice is created from

Example:

1

Response

Sale invoice edited successfully