GetCreditNoteByGUID
Invoicing service 1.1: Returns one credit note by its GUID.
| Service | Invoicing 1.1 |
| Endpoint | POST https://app{server-number}.timelog.com/{account}/WebServices/Invoicing/V1_1/InvoicingServiceSecure.svc |
| SOAPAction | GetCreditNoteByGUIDRequest |
| Content-Type | text/xml; charset=utf-8 |
| Authentication | A token from GetToken |
| Changes data | No |
| Safe to retry | Yes |
How it works
Reads the credit note with this GUID. Return holds exactly one CreditNote on success. An unknown GUID 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.
GUID of the credit note. An all-zero or unknown GUID is an error.
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: "GetCreditNoteByGUIDRequest"
<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:GetCreditNoteByGUID>
<invoicing:guid>{guid}</invoicing:guid>
<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:GetCreditNoteByGUID>
</soapenv:Body>
</soapenv:Envelope>
curl -X POST "https://app{server-number}.timelog.com/{account}/WebServices/Invoicing/V1_1/InvoicingServiceSecure.svc" \
-H "Content-Type: text/xml; charset=utf-8" \
-H 'SOAPAction: "GetCreditNoteByGUIDRequest"' \
--data-binary @request.xml
import requests
URL = "https://app{server-number}.timelog.com/{account}/WebServices/Invoicing/V1_1/InvoicingServiceSecure.svc"
SOAP_ACTION = '"GetCreditNoteByGUIDRequest"'
envelope = """<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:GetCreditNoteByGUID>
<invoicing:guid>{guid}</invoicing:guid>
<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:GetCreditNoteByGUID>
</soapenv:Body>
</soapenv:Envelope>"""
response = requests.post(
URL,
data=envelope.encode("utf-8"),
headers={"Content-Type": "text/xml; charset=utf-8", "SOAPAction": SOAP_ACTION},
timeout=60,
)
result = parse_result(response) # see "Responses and errors"
{…} placeholder with your own value.Response
The call returns the standard response envelope. Check ResponseState first: a failed call still returns HTTP 200.
Success, Invalid or Error.
0 on success, otherwise the error code. See Errors.
Response<CreditNote>: Return[0] = the credit note. No 'Successfully called' message. Never empty on success - an unknown GUID 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>
<GetCreditNoteByGUIDResponse xmlns="http://www.timelog.com/api/tlp/v1">
<GetCreditNoteByGUIDResult 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>
</GetCreditNoteByGUIDResult>
</GetCreditNoteByGUIDResponse>
</s:Body>
</s:Envelope>
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:
| ResponseState | ErrorCode | Message | What it means | What to do |
|---|---|---|---|---|
| Error | 40001 | Error during call on TimeLog.API, Message 'Unable to retrieve invoiceDTO with GUID:{guid} | ||
| In Stored Procedure: …' | No invoicing document has this GUID. | Check the GUID. | ||
| Error | 40001 | Error during call on TimeLog.API, Message 'Invoice was requested has the wrong type (Expected: CreditNote, Was: {Invoice|Reminder|Voucher})' | The GUID belongs to an invoice, reminder or voucher. | Use the invoice operations for invoices; use the credit note's own ID / GUID here. |