Get Started
Usage API
More information

PUT api/2.0/crm/invoice/{id} This function requires authentication

Description

Updates the selected invoice with the parameters (contact ID, consignee ID, etc.) specified in the request.

Parameters
Name Description Type Example
id
sent in url
Invoice ID number 1234
issueDate
sent in body
New invoice issue date Date and Time Roundtrip format: 2008-04-10T06-30-00.000Z
templateType
sent in body
New invoice template type
optional
number 1234
contactId
sent in body
New invoice contact ID number 1234
consigneeId
sent in body
New invoice consignee ID
optional
number 1234
entityId
sent in body
New invoice entity ID
optional
number 1234
billingAddressID
sent in body
New invoice billing address ID
optional
number 1234
deliveryAddressID
sent in body
New invoice delivery address ID
optional
number 1234
dueDate
sent in body
New invoice due date Date and Time Roundtrip format: 2008-04-10T06-30-00.000Z
language
sent in body
New invoice language string some text
currency
sent in body
New invoice currency (abbreviation)
Allowed values: EUR, RUB etc. You can get the whole list of available currencies by api
string some text
exchangeRate
sent in body
New invoice exchange rate System.Decimal
purchaseOrderNumber
sent in body
New invoice purchase order number
optional
string some text
terms
sent in body
New invoice terms string some text
description
sent in body
New invoice description
optional
string some text
invoiceLines
sent in body
New list of invoice lines Collection of ASC.CRM.Core.Entities.InvoiceLines
collection
Example
            
            Data transfer in application/json format:
            
            data: {
               id: 5,
               issueDate: "2015-06-01T00:00:00",
               contactId: 10,
               dueDate: "2025-06-01T00:00:00",
               language: "es-ES",
               currency: "rub",
               exchangeRate: 54.32,
               terms: "Terms for this invoice",
               invoiceLines:
               [{
                     invoiceItemID: 1,
                     invoiceTax1ID: 1,
                     invoiceTax2ID: 2,
                     description: "description for invoice line 1",
                     quantity: 100,
                     price: 7.7,
                     discount: 25
               }]
            }
            
            where invoiceItemID, invoiceTax1ID, invoiceTax2ID - IDs of the real existing invoice item and invoice taxes, contactId - ID of the existing contact.
            
            
Returns

Updated invoice

Example Response

application/json

{
  "status": 0,
  "response": {
    "invoiceLines": [
      {
        "invoiceID": 0,
        "invoiceItemID": 0,
        "invoiceTax1ID": 0,
        "invoiceTax2ID": 0,
        "sortOrder": 0,
        "description": "",
        "quantity": 0.0,
        "price": 0.0,
        "discount": 0.0,
        "id": 0
      }
    ],
    "status": {
      "title": "Draft",
      "id": 1
    },
    "number": "",
    "issueDate": "2021-10-25T04:56:29.1516212Z",
    "templateType": 0,
    "contact": null,
    "consignee": null,
    "entity": null,
    "dueDate": "2021-10-25T04:56:29.1516212Z",
    "language": "",
    "currency": {
      "title": "Chinese Yuan",
      "symbol": "¥",
      "abbreviation": "CNY",
      "cultureName": "CN",
      "isConvertable": true,
      "isBasic": false
    },
    "exchangeRate": 1.0,
    "purchaseOrderNumber": "",
    "terms": "",
    "description": "",
    "fileID": -1,
    "createOn": "2021-10-25T04:56:29.1516212Z",
    "createBy": {
      "id": "00000000-0000-0000-0000-000000000000",
      "displayName": "Mike Zanyatski",
      "title": "Manager",
      "avatarSmall": "url to small avatar",
      "profileUrl": ""
    },
    "cost": 0.0,
    "canEdit": true,
    "canDelete": true,
    "id": 0
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <invoiceLines>
      <invoiceID>0</invoiceID>
      <invoiceItemID>0</invoiceItemID>
      <invoiceTax1ID>0</invoiceTax1ID>
      <invoiceTax2ID>0</invoiceTax2ID>
      <sortOrder>0</sortOrder>
      <description></description>
      <quantity>0</quantity>
      <price>0</price>
      <discount>0</discount>
      <id>0</id>
    </invoiceLines>
    <status>
      <title>Draft</title>
      <id>1</id>
    </status>
    <number></number>
    <issueDate>2021-10-25T04:56:29.1516212Z</issueDate>
    <templateType>0</templateType>
    <contact />
    <consignee />
    <entity />
    <dueDate>2021-10-25T04:56:29.1516212Z</dueDate>
    <language></language>
    <currency>
      <title>Chinese Yuan</title>
      <symbol>¥</symbol>
      <abbreviation>CNY</abbreviation>
      <cultureName>CN</cultureName>
      <isConvertable>true</isConvertable>
      <isBasic>false</isBasic>
    </currency>
    <exchangeRate>1</exchangeRate>
    <purchaseOrderNumber></purchaseOrderNumber>
    <terms></terms>
    <description></description>
    <fileID>-1</fileID>
    <createOn>2021-10-25T04:56:29.1516212Z</createOn>
    <createBy>
      <id>00000000-0000-0000-0000-000000000000</id>
      <displayName>Mike Zanyatski</displayName>
      <title>Manager</title>
      <avatarSmall>url to small avatar</avatarSmall>
      <profileUrl></profileUrl>
    </createBy>
    <cost>0</cost>
    <canEdit>true</canEdit>
    <canDelete>true</canDelete>
    <id>0</id>
  </response>
</result>