API to update invoice by invoice id

http
PUT https://services.leadconnectorhq.com/invoices/{invoiceId}

Authorization

NameTypeRequiredExampleDescription
AuthorizationstringYesBearer token generated from the Leadway portal. See Authentication.
VersionstringYes2021-07-28API version.

Path parameters

NameTypeRequiredExampleDescription
invoiceIdstringYes6578278e879ad2646715ba9cInvoice Id

Body

NameTypeRequiredExampleDescription
altIdstringYes6578278e879ad2646715ba9caccount Id / company Id based on altType
altTypestringYesaccountAlt Type Possible values: 'account'
namestringYesNew InvoiceName to be updated
titlestringNoINVOICETitle for the invoice
currencystringYesUSDCurrency
descriptionstringNoABC Corp paymentsDescription
businessDetailsobjectNoBusiness details which need to be updated
invoiceNumberstringNo1001Invoice Number
contactIdstringNo6578278e879ad2646715ba9cId of the contact which you need to send the invoice
  • contactDetails (object)

    • id (string, required): Contact ID Example: 6578278e879ad2646715ba9c

    • name (string, required): Contact Name Example: Alex

    • phoneNo (string, required): Contact Phone Number Example: +1234567890

    • email (string, required): Contact Email Example: alex@example.com

    • additionalEmails (object[]): Secondary email addresses for the contact to be saved

      • email (string, required): Example: alex@example.com

    • companyName (string): Contact Company Name Example: ABC Corp.

    • address (object)

      • addressLine1 (string): Address Line 1 Example: 9931 Beechwood

      • addressLine2 (string): Address Line 2 Example: Beechwood

      • city (string): City Example: St. Houston

      • state (string): State Example: TX

      • countryCode (string): Country Code Example: US

      • postalCode (string): Postal Code Example: 559-6993

    • customFields (string[]): Custom Values

NameTypeRequiredExampleDescription
termsNotesstringNo<p>This is a default terms.</p>Terms notes, Also supports HTML markups
  • discount (object)

    • value (number): Discount Value Example: 10

    • type (string, required): Discount type Possible values: 'percentage', 'fixed' Example: percentage

    • validOnProductIds (string[]): Product Ids on which discount is applicable Example: [ '6579751d56f60276e5bd4154' ]

  • invoiceItems (object[], required)

    • name (string, required): Invoice Item Name Example: ABC Product

    • description (string): Invoice descriptions Example: ABC Corp.

    • productId (string): Product Id Example: 6578278e879ad2646715ba9c

    • priceId (string): Price Id Example: 6578278e879ad2646715ba9c

    • currency (string, required): Currency Example: USD

    • amount (number, required): Product amount Example: 999

    • qty (number, required): Product Quantity Example: 1

    • taxes (object[]): Tax

      • _id (string, required)

      • name (string, required)

      • rate (number, required)

      • calculation (string): Possible values: 'exclusive'

      • description (string)

      • taxId (string)

    • automaticTaxCategoryId (string): Tax category id for calculating automatic tax Example: 6578278e879ad2646715ba9c

    • isSetupFeeItem (boolean): Setupfee item, only created when 1st invoice of recurring schedule is generated

    • type (string): Price type of the item Possible values: 'one_time', 'recurring' Example: one_time

    • taxInclusive (boolean): true if item amount is tax inclusive Example: True

NameTypeRequiredExampleDescription
automaticTaxesEnabledbooleanNoTrueAutomatic taxes enabled for the Invoice
liveModebooleanNoPayment mode
issueDatestringYes2023-01-01Issue date in YYYY-MM-DD format
dueDatestringYes2023-01-14Due date in YYYY-MM-DD format
paymentScheduleobjectNosplit invoice into payment schedule summing up to full invoice amount
tipsConfigurationobjectNotips configuration for the invoice
xeroDetailsobjectNo
invoiceNumberPrefixstringNoINV-prefix for invoice number
paymentMethodsobjectNoPayment Methods for Invoices
  • attachments (object[]): attachments for the invoice

    • id (string, required): Id of the file selected Example: 6241712be68f7a98102ba272

    • name (string, required): Name of the file Example: Electronics.pdf

    • url (string, required): URL of the file Example: https://example.com/digital-delivery

    • type (string, required): Type of the file

    • size (number, required): Size of the file Example: 10000

NameTypeRequiredExampleDescription
miscellaneousChargesobjectNomiscellaneous charges for the invoice

Responses

200 - Successful response
  • _id (string, required): Invoice Id Example: 6578278e879ad2646715ba9c

  • status (string, required): Invoice Status Possible values: 'draft', 'sent', 'payment_processing', 'paid', 'void', 'partially_paid' Example: draft

  • liveMode (boolean, required): Live Mode Example: False

  • amountPaid (number, required): Amount Paid Example: 0

  • altId (string, required): Account Id or Agency Id Example: 6578278e879ad2646715ba9c

  • altType (string, required): Possible values: 'account'

  • name (string, required): Name of the invoice Example: New Invoice

  • businessDetails (object, required): Business Details

  • invoiceNumber (number, required): Invoice Number Example: 19

  • currency (string, required): Currency Example: USD

  • contactDetails (object, required): Contact Details

  • issueDate (string, required): Issue date in YYYY-MM-DD format Example: 2023-01-01

  • dueDate (string, required): Due date in YYYY-MM-DD format Example: 2023-01-01

  • discount (object): Discount

  • invoiceItems (string[], required): Invoice Items

  • total (number, required): Total Amount Example: 999

  • title (string, required): Title Example: INVOICE

  • amountDue (number, required): Total Amount Due Example: 999

  • createdAt (string, required): created at Example: 2023-12-12T09:27:42.355Z

  • updatedAt (string, required): updated at Example: 2023-12-12T09:27:42.355Z

  • automaticTaxesEnabled (boolean): Automatic taxes enabled for the Invoice Example: True

  • automaticTaxesCalculated (boolean): Is Automatic taxes calculated for the Invoice items Example: True

  • paymentSchedule (object): split invoice into payment schedule summing up to full invoice amount

json
{
  "_id": "6578278e879ad2646715ba9c",
  "status": "draft",
  "liveMode": false,
  "amountPaid": 0,
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "name": "New Invoice",
  "businessDetails": {
    "name": "Alex",
    "address": {
      "addressLine1": "9931 Beechwood",
      "city": "St. Houston",
      "state": "TX",
      "countryCode": "USA",
      "postalCode": "559-6993"
    },
    "phoneNo": "+1-214-559-6993",
    "website": "www.example.com"
  },
  "invoiceNumber": "19",
  "currency": "USD",
  "contactDetails": {
    "id": "c6tZZU0rJBf30ZXx9Gli",
    "phoneNo": "+1-214-559-6993",
    "email": "alex@example.com",
    "customFields": [],
    "name": "Alex",
    "address": {
      "countryCode": "US"
    }
  },
  "issueDate": "2023-01-01",
  "dueDate": "2023-01-01",
  "discount": {
    "type": "percentage",
    "value": 0
  },
  "invoiceItems": [
  // truncado: 20 lineas mas
}
400 - Bad Request
json
{}
401 - Unauthorized
json
{}
422 - Unprocessable Entity
json
{}

Example

curl -X PUT 'https://services.leadconnectorhq.com/invoices/YOUR_invoiceId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "name": "New Invoice",
  "title": "INVOICE",
  "currency": "USD",
  "description": "ABC Corp payments",
  "businessDetails": {
    "name": "Alex",
    "address": {
      "addressLine1": "9931 Beechwood",
      "city": "St. Houston",
      "state": "TX",
      "countryCode": "USA",
      "postalCode": "559-6993"
    },
    "phoneNo": "+1-214-559-6993",
    "website": "www.example.com"
  },
  "invoiceNumber": "1001",
  "contactId": "6578278e879ad2646715ba9c",
  "contactDetails": {
    "id": "6578278e879ad2646715ba9c",
    "name": "Alex",
    "phoneNo": "+1234567890",
    "email": "alex@example.com",
    "additionalEmails": [
      {
        "email": "alex@example.com"
      }
    ],
    "companyName": "ABC Corp.",
    "address": {
      "addressLine1": "9931 Beechwood",
      "addressLine2": "Beechwood",
      "city": "St. Houston",
      "state": "TX",
      "countryCode": "US",
      "postalCode": "559-6993"
    },
    "customFields": [
      "string"
    ]
  },
  "termsNotes": "<p>This is a default terms.</p>",
  "discount": {
    "value": 10,
    "type": "percentage",
    "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
  },
  "invoiceItems": [
    {
      "name": "ABC Product",
      "description": "ABC Corp.",
      "productId": "6578278e879ad2646715ba9c",
      "priceId": "6578278e879ad2646715ba9c",
      "currency": "USD",
      "amount": 999,
      "qty": 1,
      "taxes": [
        {}
      ],
      "automaticTaxCategoryId": "6578278e879ad2646715ba9c",
      "isSetupFeeItem": true,
      "type": "one_time",
      "taxInclusive": true
    }
  ],
  "automaticTaxesEnabled": true,
  "liveMode": true,
  "issueDate": "2023-01-01",
  "dueDate": "2023-01-14",
  "xeroDetails": {},
  "invoiceNumberPrefix": "INV-",
  "attachments": [
    {
      "id": "6241712be68f7a98102ba272",
      "name": "Electronics.pdf",
      "url": "https://example.com/digital-delivery",
      "type": "string",
      "size": 10000
    }
  ]
}'

Last updated October 26, 2026

Was this page helpful?