Credit notesGetCreditNoteByID

GetCreditNoteByID

Invoicing service 1.1: Returns one credit note by its integer ID.

ServiceInvoicing 1.1
EndpointPOST https://app{server-number}.timelog.com/{account}/WebServices/Invoicing/V1_1/InvoicingServiceSecure.svc
SOAPActionGetCreditNoteByIDRequest
Content-Typetext/xml; charset=utf-8
AuthenticationA token from GetToken
Changes dataNo
Safe to retryYes

How it works

Reads the credit note with this integer ID. Return holds exactly one CreditNote on success. An unknown ID is an Error envelope, not an empty Return. Amounts are in the credit note's own currency and negative when it credits an invoice. For a DRAFT, NetAmount / AmountDue / Rounding are recalculated from the lines on this read.

Parameters

Each parameter has one label: Required, Conditional (required depending on other values) or Optional. Send them in the order shown.

idinteger
Required

Integer ID of the credit note. An unknown ID is an error.

tokenSecurityToken
Required

The token from GetToken: Initials, Expires and Hash, sent back unchanged.

Request

POST /{account}/WebServices/Invoicing/V1_1/InvoicingServiceSecure.svc HTTP/1.1
Host: app{server-number}.timelog.com
Content-Type: text/xml; charset=utf-8
SOAPAction: "GetCreditNoteByIDRequest"

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:invoicing="http://www.timelog.com/api/tlp/v1"
                  xmlns:tok="http://www.timelog.com/api/tlp/v1_3">
  <soapenv:Body>
    <invoicing:GetCreditNoteByID>
      <invoicing:id>{id}</invoicing:id>
      <invoicing:token>
        <tok:Initials>{Initials from GetToken}</tok:Initials>
        <tok:Expires>{Expires from GetToken, unchanged}</tok:Expires>
        <tok:Hash>{Hash from GetToken}</tok:Hash>
      </invoicing:token>
    </invoicing:GetCreditNoteByID>
  </soapenv:Body>
</soapenv:Envelope>
Replace every {…} placeholder with your own value.

Response

The call returns the standard response envelope. Check ResponseState first: a failed call still returns HTTP 200.

ResponseStatestring
Required

Success, Invalid or Error.

ErrorCodeinteger

0 on success, otherwise the error code. See Errors.

ReturnCreditNote[]

Response<CreditNote>: Return[0] = the credit note. No 'Successfully called' message. Never empty on success - an unknown ID is an error.

Example response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetCreditNoteByIDResponse xmlns="http://www.timelog.com/api/tlp/v1">
      <GetCreditNoteByIDResult xmlns:a="http://api.timelog.com"
                               xmlns:b="http://www.timelog.com/api/tlp/v1"
                               xmlns:c="http://www.timelog.com/api/tlp/v1_1"
                               xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:Return>
          <b:CreditNote>
            <a:Action>Original</a:Action>
            <a:IsCustomFieldsLoaded>false</a:IsCustomFieldsLoaded>
            <a:CustomFields i:nil="true"/>
            <a:IsExternalKeysLoaded>false</a:IsExternalKeysLoaded>
            <a:ExternalKeys i:nil="true"/>
            <b:ID>1001</b:ID>
            <b:CreditNoteNO>Example</b:CreditNoteNO>
            <b:Header>Example</b:Header>
            <b:Message>Example</b:Message>
            <b:CreditNoteDate>2026-10-01T00:00:00</b:CreditNoteDate>
            <b:Status>Example</b:Status>
            <b:Type>Example</b:Type>
            <b:RequisitionNo>1001</b:RequisitionNo>
            <b:InvoicingAddress>
              <c:Address1>Example</c:Address1>
              <c:Address2>Example</c:Address2>
              <c:Address3>Example</c:Address3>
              <c:ZipCode>1000</c:ZipCode>
              <c:City>Copenhagen</c:City>
              <c:State>Example</c:State>
              <c:Country>DK</c:Country>
            </b:InvoicingAddress>
            <b:CustomerID>1001</b:CustomerID>
            <b:ContactID>1001</b:ContactID>
            <b:CustomerReference>Example</b:CustomerReference>
            <b:InternalReference>Example</b:InternalReference>
            <b:CalculateVAT>false</b:CalculateVAT>
            <b:NetAmount>0</b:NetAmount>
            <b:VATIncluded>0</b:VATIncluded>
            <b:Rounding>0</b:Rounding>
            <b:AmountDue>0</b:AmountDue>
            <b:InvoiceLines>
              <b:InvoiceLine>
                <a:Action>Original</a:Action>
                <a:IsCustomFieldsLoaded>false</a:IsCustomFieldsLoaded>
                <a:CustomFields i:nil="true"/>
                <a:IsExternalKeysLoaded>false</a:IsExternalKeysLoaded>
                <a:ExternalKeys i:nil="true"/>
                <b:ID>1001</b:ID>
                <b:InvoiceID>1001</b:InvoiceID>
                <b:Date>2026-10-01T00:00:00</b:Date>
                <b:ProductNo>1001</b:ProductNo>
                <b:Text>Example</b:Text>
                <b:Quantity>0</b:Quantity>
                <b:Rate>0</b:Rate>
                <b:Amount>0</b:Amount>
                <b:Discount>0</b:Discount>
                <b:InvoiceLineType>0</b:InvoiceLineType>
                <b:VAT>0</b:VAT>
                <b:Details>
                  <b:ProjectHeader i:nil="true"/>
                  <b:Comment>Example</b:Comment>
                </b:Details>
              </b:InvoiceLine>
            </b:InvoiceLines>
            <b:Currency>DKK</b:Currency>
            <b:CurrencyRate>0</b:CurrencyRate>
            <b:GUID>3f2504e0-4f89-41d3-9a0c-305000000001</b:GUID>
            <b:EAN>Example</b:EAN>
            <b:InvoicingCustomerName>Example invoicing customer</b:InvoicingCustomerName>
            <b:CustomerReferenceID>1001</b:CustomerReferenceID>
            <b:CreditedInvoiceID>1001</b:CreditedInvoiceID>
            <b:RelatesToInvoiceNo>1001</b:RelatesToInvoiceNo>
            <b:Details>
              <b:Status>
                <a:Action>Original</a:Action>
                <a:IsCustomFieldsLoaded>false</a:IsCustomFieldsLoaded>
                <a:CustomFields i:nil="true"/>
                <a:IsExternalKeysLoaded>false</a:IsExternalKeysLoaded>
                <a:ExternalKeys i:nil="true"/>
                <b:ID>1001</b:ID>
                <b:Name>Example </b:Name>
              </b:Status>
              <b:Type>
                <a:Action>Original</a:Action>
                <a:IsCustomFieldsLoaded>false</a:IsCustomFieldsLoaded>
                <a:CustomFields i:nil="true"/>
                <a:IsExternalKeysLoaded>false</a:IsExternalKeysLoaded>
                <a:ExternalKeys i:nil="true"/>
                <b:ID>1001</b:ID>
                <b:Name>Example </b:Name>
              </b:Type>
              <b:InternalReference>
                <c:ID>1001</c:ID>
                <c:Initials>ABC</c:Initials>
                <c:FullName>Example full</c:FullName>
              </b:InternalReference>
              <b:Currency>
                <c:ID>1001</c:ID>
                <c:Abbreviation>DKK</c:Abbreviation>
                <c:Rate>0</c:Rate>
                <c:RateDate>2026-10-01T00:00:00</c:RateDate>
                <c:DescriptiveName>Example descriptive</c:DescriptiveName>
              </b:Currency>
              <b:CustomerHeader>
                <c:ID>1001</c:ID>
                <c:Name>Example </c:Name>
                <c:No>1001</c:No>
                <c:GUID>3f2504e0-4f89-41d3-9a0c-305000000002</c:GUID>
              </b:CustomerHeader>
              <b:ContactHeader>
                <c:GUID>3f2504e0-4f89-41d3-9a0c-305000000003</c:GUID>
                <c:FirstName>Example first</c:FirstName>
                <c:LastName>Example last</c:LastName>
              </b:ContactHeader>
              <b:ProjectHeader>
                <c:ID>1001</c:ID>
                <c:Name>Example </c:Name>
                <c:No>1001</c:No>
                <c:IsActive>true</c:IsActive>
                <c:IsGeneralProject>false</c:IsGeneralProject>
                <c:StartDate>2026-10-01T00:00:00</c:StartDate>
                <c:EndDate>2026-10-01T00:00:00</c:EndDate>
              </b:ProjectHeader>
            </b:Details>
          </b:CreditNote>
        </a:Return>
        <a:ReturnTypeDescription>CreditNote</a:ReturnTypeDescription>
        <a:Request>…</a:Request>
        <a:ResponseState>Success</a:ResponseState>
        <a:Messages>
          <a:APIMessage>
            <a:Message>Duration of call was 0,0421337 sec.</a:Message>
            <a:Severity>Message</a:Severity>
            <a:ErrorCode>0</a:ErrorCode>
          </a:APIMessage>
        </a:Messages>
        <a:ErrorCode>0</a:ErrorCode>
        <a:IsReturnPaged>false</a:IsReturnPaged>
        <a:TotalPageCount>0</a:TotalPageCount>
      </GetCreditNoteByIDResult>
    </GetCreditNoteByIDResponse>
  </s:Body>
</s:Envelope>
Illustrative example: built from the service description (WSDL) in the same format as a real response, with made-up values. The Request block is shortened.

Errors

All errors come back with HTTP 200: check ResponseState, ErrorCode and Messages. The errors every operation can return (expired or invalid token, API not enabled, HTTPS required, general errors) are listed once in Responses and errors.

Errors specific to this operation:

ResponseStateErrorCodeMessageWhat it meansWhat to do
Error40001Error during call on TimeLog.API, Message 'Unable to retrieve get Invoice with ID:{id} or an invoice with a line with invoiceLineID:
In Stored Procedure: …'No invoicing document has this ID.—
Error40001Error during call on TimeLog.API, Message 'Invoice was requested has the wrong type (Expected: CreditNote, Was: {Invoice|Reminder|Voucher})'The ID belongs to an invoice, reminder or voucher.Use the invoice operations for invoices; use the credit note's own ID / GUID here.