API to update an template by template id

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

Authorization

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

Path parameters

NameTypeRequiredExampleDescription
templateIdstringYes6578278e879ad2646715ba9cTemplate Id

Body

NameTypeRequiredExampleDescription
altIdstringYes6578278e879ad2646715ba9caccount Id / company Id based on altType
altTypestringYesaccountAlt Type Possible values: 'account'
internalbooleanNo
namestringYesNew TemplateName of the template
  • businessDetails (object, required)

    • logoUrl (string): Business Logo URL Example: https://example.com/logo.png

    • name (string): Business Name Example: ABC Corp.

    • phoneNo (string): Business Phone Number Example: +1-214-559-6993

    • address (object): Business Address Example: 9931 Beechwood, TX

    • website (string): Business Website Link Example: wwww.example.com

    • customValues (string[]): Custom Values

NameTypeRequiredExampleDescription
currencystringYes
  • items (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

  • 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' ]

NameTypeRequiredExampleDescription
termsNotesstringNo
titlestringNoNew TemplateTemplate title
miscellaneousChargesobjectNomiscellaneous charges for the invoice

Responses

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

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

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

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

  • businessDetails (object, required): Business Details

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

  • discount (object): Discount

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

  • invoiceNumberPrefix (string): prefix for invoice number Example: INV-

  • total (number, required): Total Amount 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

json
{
  "_id": "6578278e879ad2646715ba9c",
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "name": "New Template",
  "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"
  },
  "currency": "USD",
  "discount": {
    "type": "percentage",
    "value": 0
  },
  "items": [
    {
      "taxes": [],
      "_id": "c6tZZU0rJBf30ZXx9Gli",
      "productId": "c6tZZU0rJBf30ZXx9Gli",
      "priceId": "c6tZZU0rJBf30ZXx9Gli",
      "currency": "USD",
      "name": "Macbook Pro",
      "qty": 1,
      "amount": 999
    }
  ],
  "invoiceNumberPrefix": "INV-",
  "total": 999,
  "createdAt": "2023-12-12T09:27:42.355Z",
  "updatedAt": "2023-12-12T09:27:42.355Z"
}
400 - Bad Request
json
{}
401 - Unauthorized
json
{}
422 - Unprocessable Entity
json
{}

Example

curl -X PUT 'https://services.leadconnectorhq.com/invoices/template/YOUR_templateId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "internal": true,
  "name": "New Template",
  "businessDetails": {
    "logoUrl": "https://example.com/logo.png",
    "name": "ABC Corp.",
    "phoneNo": "+1-214-559-6993",
    "address": "9931 Beechwood, TX",
    "website": "wwww.example.com",
    "customValues": [
      "string"
    ]
  },
  "currency": "string",
  "items": [
    {
      "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
    }
  ],
  "discount": {
    "value": 10,
    "type": "percentage",
    "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
  },
  "termsNotes": "string",
  "title": "New Template"
}'

Last updated October 26, 2026

Was this page helpful?