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 decimal 1.1
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": "Description",
        "Quantity": 0.0,
        "Price": 0.0,
        "Discount": 0.0,
        "id": 1234
      }
    ],
    "id": 1234,
    "Status": {
      "Title": "Title",
      "id": 1234
    },
    "Number": "",
    "IssueDate": "2020-12-14T22:13:41.5378233Z",
    "TemplateType": 0,
    "Contact": {
      "SmallFotoUrl": "url to foto",
      "MediumFotoUrl": "url to foto",
      "DisplayName": "Tadjeddine Bachir",
      "IsCompany": false,
      "AccessList": [
        {
          "Id": "00000000-0000-0000-0000-000000000000",
          "DisplayName": "Mike Zanyatski",
          "Title": "Manager",
          "AvatarSmall": "url to small avatar",
          "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
        }
      ],
      "IsPrivate": true,
      "IsShared": false,
      "ShareType": 0,
      "Currency": {
        "Title": "Chinese Yuan",
        "Symbol": "¥",
        "Abbreviation": "CNY",
        "CultureName": "CN",
        "IsConvertable": true,
        "IsBasic": false
      },
      "CanEdit": true,
      "CanDelete": true,
      "id": 1234
    },
    "Consignee": {
      "SmallFotoUrl": "url to foto",
      "MediumFotoUrl": "url to foto",
      "DisplayName": "Tadjeddine Bachir",
      "IsCompany": false,
      "AccessList": [
        {
          "Id": "00000000-0000-0000-0000-000000000000",
          "DisplayName": "Mike Zanyatski",
          "Title": "Manager",
          "AvatarSmall": "url to small avatar",
          "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
        }
      ],
      "IsPrivate": true,
      "IsShared": false,
      "ShareType": 0,
      "Currency": {
        "Title": "Chinese Yuan",
        "Symbol": "¥",
        "Abbreviation": "CNY",
        "CultureName": "CN",
        "IsConvertable": true,
        "IsBasic": false
      },
      "CanEdit": true,
      "CanDelete": true,
      "id": 1234
    },
    "Entity": {
      "EntityType": "opportunity",
      "EntityId": 123445,
      "EntityTitle": "Household appliances internet shop"
    },
    "DueDate": "2020-12-14T22:13:41.5378233Z",
    "Language": "",
    "Currency": {
      "Title": "Chinese Yuan",
      "Symbol": "¥",
      "Abbreviation": "CNY",
      "CultureName": "CN",
      "IsConvertable": true,
      "IsBasic": false
    },
    "ExchangeRate": 10.0,
    "PurchaseOrderNumber": "",
    "Terms": "",
    "Description": "",
    "FileID": -1,
    "CreateOn": "2020-12-14T22:13:41.5378233Z",
    "CreateBy": {
      "Id": "00000000-0000-0000-0000-000000000000",
      "DisplayName": "Mike Zanyatski",
      "Title": "Manager",
      "AvatarSmall": "url to small avatar",
      "ProfileUrl": "\\/Products\\/People\\/Profile.aspx?user=administrator"
    },
    "Cost": 0.0,
    "CanEdit": true,
    "CanDelete": true
  }
}

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</Description>
      <Quantity>0</Quantity>
      <Price>0</Price>
      <Discount>0</Discount>
      <id>1234</id>
    </InvoiceLines>
    <id>1234</id>
    <Status>
      <Title>Title</Title>
      <id>1234</id>
    </Status>
    <Number />
    <IssueDate>2020-12-14T22:13:41.5378233Z</IssueDate>
    <TemplateType>0</TemplateType>
    <Contact>
      <SmallFotoUrl>url to foto</SmallFotoUrl>
      <MediumFotoUrl>url to foto</MediumFotoUrl>
      <DisplayName>Tadjeddine Bachir</DisplayName>
      <IsCompany>False</IsCompany>
      <AccessList>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <DisplayName>Mike Zanyatski</DisplayName>
        <Title>Manager</Title>
        <AvatarSmall>url to small avatar</AvatarSmall>
        <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
      </AccessList>
      <IsPrivate>True</IsPrivate>
      <IsShared>False</IsShared>
      <ShareType>0</ShareType>
      <Currency>
        <Title>Chinese Yuan</Title>
        <Symbol>¥</Symbol>
        <Abbreviation>CNY</Abbreviation>
        <CultureName>CN</CultureName>
        <IsConvertable>True</IsConvertable>
        <IsBasic>False</IsBasic>
      </Currency>
      <CanEdit>True</CanEdit>
      <CanDelete>True</CanDelete>
      <id>1234</id>
    </Contact>
    <Consignee>
      <SmallFotoUrl>url to foto</SmallFotoUrl>
      <MediumFotoUrl>url to foto</MediumFotoUrl>
      <DisplayName>Tadjeddine Bachir</DisplayName>
      <IsCompany>False</IsCompany>
      <AccessList>
        <Id>00000000-0000-0000-0000-000000000000</Id>
        <DisplayName>Mike Zanyatski</DisplayName>
        <Title>Manager</Title>
        <AvatarSmall>url to small avatar</AvatarSmall>
        <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
      </AccessList>
      <IsPrivate>True</IsPrivate>
      <IsShared>False</IsShared>
      <ShareType>0</ShareType>
      <Currency>
        <Title>Chinese Yuan</Title>
        <Symbol>¥</Symbol>
        <Abbreviation>CNY</Abbreviation>
        <CultureName>CN</CultureName>
        <IsConvertable>True</IsConvertable>
        <IsBasic>False</IsBasic>
      </Currency>
      <CanEdit>True</CanEdit>
      <CanDelete>True</CanDelete>
      <id>1234</id>
    </Consignee>
    <Entity>
      <EntityType>opportunity</EntityType>
      <EntityId>123445</EntityId>
      <EntityTitle>Household appliances internet shop</EntityTitle>
    </Entity>
    <DueDate>2020-12-14T22:13:41.5378233Z</DueDate>
    <Language />
    <Currency>
      <Title>Chinese Yuan</Title>
      <Symbol>¥</Symbol>
      <Abbreviation>CNY</Abbreviation>
      <CultureName>CN</CultureName>
      <IsConvertable>True</IsConvertable>
      <IsBasic>False</IsBasic>
    </Currency>
    <ExchangeRate>10</ExchangeRate>
    <PurchaseOrderNumber />
    <Terms />
    <Description />
    <FileID>-1</FileID>
    <CreateOn>2020-12-14T22:13:41.5378233Z</CreateOn>
    <CreateBy>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <DisplayName>Mike Zanyatski</DisplayName>
      <Title>Manager</Title>
      <AvatarSmall>url to small avatar</AvatarSmall>
      <ProfileUrl>\/Products\/People\/Profile.aspx?user=administrator</ProfileUrl>
    </CreateBy>
    <Cost>0</Cost>
    <CanEdit>True</CanEdit>
    <CanDelete>True</CanDelete>
  </response>
</result>