GetCustomersByFieldsForLinking
CRM service 1.4: Find customers to link by customer number, VAT number, organisation number or name
| Service | CRM 1.4 |
| Endpoint | POST https://app{server-number}.timelog.com/{account}/WebServices/CRM/V1_4/CRMServiceSecure.svc |
| SOAPAction | http://api.timelog.com/services/crm/1_4/ICRMService/GetCustomersByFieldsForLinking |
| Content-Type | text/xml; charset=utf-8 |
| Authentication | A token from GetToken |
| Changes data | No |
| Safe to retry | Yes |
| Paging | Yes, up to 500 per page |
How it works
Inputs are normalised by removing spaces and - +.: before comparison; empty inputs are not used. 1. customerNumber: customers whose customer number equals it. If NO customer has that number: customers whose VAT number matches VATNumber. If additionally no customer has exactly that VAT number: customers whose organisation number matches organisationNumber. If none of number, VAT number or organisation number matched exactly: customers whose name equals customerName - exact, no prefix match.
Parameters
Each parameter has one label: Required, Conditional (required depending on other values) or Optional. Send them in the order shown.
Conditional. Customer number, exact. At least one of customerNumber, VATNumber, organisationNumber, customerName should be non-empty; all empty = empty result.
Conditional. VAT number; used when no customer has customerNumber. LIKE pattern. At least one of customerNumber, VATNumber, organisationNumber, customerName should be non-empty; all empty = empty result.
Conditional. Organisation number; used when neither number nor VAT number matched exactly. LIKE pattern. At least one of customerNumber, VATNumber, organisationNumber, customerName should be non-empty; all empty = empty result.
Conditional. Company name, exact after normalisation; used only when no identifier matched exactly. At least one of customerNumber, VATNumber, organisationNumber, customerName should be non-empty; all empty = empty result.
Optional. Default false. Ignored.
Optional. Default false. Ignored.
1-based page number. Values <= 0 behave like 1.
Customers per page, capped at 500; must be > 0.
The token from GetToken: Initials, Expires and Hash, sent back unchanged.
Request
POST /{account}/WebServices/CRM/V1_4/CRMServiceSecure.svc HTTP/1.1
Host: app{server-number}.timelog.com
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://api.timelog.com/services/crm/1_4/ICRMService/GetCustomersByFieldsForLinking"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:crm="http://api.timelog.com/services/crm/1_4"
xmlns:tok="http://www.timelog.com/api/tlp/v1_3">
<soapenv:Body>
<crm:GetCustomersByFieldsForLinking>
<crm:customerNumber>{customerNumber}</crm:customerNumber>
<crm:VATNumber>{VATNumber}</crm:VATNumber>
<crm:organisationNumber>{organisationNumber}</crm:organisationNumber>
<crm:customerName>{customerName}</crm:customerName>
<crm:loadCustomFields>false</crm:loadCustomFields>
<crm:loadExternalKeys>false</crm:loadExternalKeys>
<crm:page>1</crm:page>
<crm:pageSize>100</crm:pageSize>
<crm:token>
<tok:Initials>{Initials from GetToken}</tok:Initials>
<tok:Expires>{Expires from GetToken, unchanged}</tok:Expires>
<tok:Hash>{Hash from GetToken}</tok:Hash>
</crm:token>
</crm:GetCustomersByFieldsForLinking>
</soapenv:Body>
</soapenv:Envelope>
curl -X POST "https://app{server-number}.timelog.com/{account}/WebServices/CRM/V1_4/CRMServiceSecure.svc" \
-H "Content-Type: text/xml; charset=utf-8" \
-H 'SOAPAction: "http://api.timelog.com/services/crm/1_4/ICRMService/GetCustomersByFieldsForLinking"' \
--data-binary @request.xml
import requests
URL = "https://app{server-number}.timelog.com/{account}/WebServices/CRM/V1_4/CRMServiceSecure.svc"
SOAP_ACTION = '"http://api.timelog.com/services/crm/1_4/ICRMService/GetCustomersByFieldsForLinking"'
envelope = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:crm="http://api.timelog.com/services/crm/1_4"
xmlns:tok="http://www.timelog.com/api/tlp/v1_3">
<soapenv:Body>
<crm:GetCustomersByFieldsForLinking>
<crm:customerNumber>{customerNumber}</crm:customerNumber>
<crm:VATNumber>{VATNumber}</crm:VATNumber>
<crm:organisationNumber>{organisationNumber}</crm:organisationNumber>
<crm:customerName>{customerName}</crm:customerName>
<crm:loadCustomFields>false</crm:loadCustomFields>
<crm:loadExternalKeys>false</crm:loadExternalKeys>
<crm:page>1</crm:page>
<crm:pageSize>100</crm:pageSize>
<crm:token>
<tok:Initials>{Initials from GetToken}</tok:Initials>
<tok:Expires>{Expires from GetToken, unchanged}</tok:Expires>
<tok:Hash>{Hash from GetToken}</tok:Hash>
</crm:token>
</crm:GetCustomersByFieldsForLinking>
</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.
Number of pages for the whole result with your pageSize. Keep calling with page + 1 until you have read them all.
Response<Customer>: Return = one page of candidate customers; IsReturnPaged = true; TotalPageCount = pages. No 'Successfully called' message. ResponseState Success with an empty Return and TotalPageCount 0.
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>
<GetCustomersByFieldsForLinkingResponse xmlns="http://api.timelog.com/services/crm/1_4">
<GetCustomersByFieldsForLinkingResult xmlns:a="http://api.timelog.com"
xmlns:b="http://api.timelog.com/services/crm/1_4"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Return>
<b:Customer>
<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:GUID>3f2504e0-4f89-41d3-9a0c-305000000001</b:GUID>
<b:Name>Example </b:Name>
<b:No>1001</b:No>
<b:TimeStamp>AAAAAAAAAAA=</b:TimeStamp>
<b:VAT>0</b:VAT>
<b:CalculateVAT>false</b:CalculateVAT>
<b:DefaultDiscountPercent>0</b:DefaultDiscountPercent>
<b:Address>
<a:Address1>Example</a:Address1>
<a:Address2>Example</a:Address2>
<a:Address3>Example</a:Address3>
<a:ZipCode>1000</a:ZipCode>
<a:City>Copenhagen</a:City>
<a:State>Example</a:State>
<a:Country>DK</a:Country>
</b:Address>
<b:Fax>+45 00 00 00 00</b:Fax>
<b:WebSite>https://www.example.com</b:WebSite>
<b:Phone>+45 00 00 00 00</b:Phone>
<b:Email>info@example.com</b:Email>
<b:KAM>Example</b:KAM>
<b:EAN>Example</b:EAN>
<b:IsOIOCustomer>false</b:IsOIOCustomer>
<b:CreditorID>Example</b:CreditorID>
<b:AccountNo>1001</b:AccountNo>
<b:Contacts>
<b:ContactHeader>
<b:GUID>3f2504e0-4f89-41d3-9a0c-305000000002</b:GUID>
<b:FirstName>Example first</b:FirstName>
<b:LastName>Example last</b:LastName>
</b:ContactHeader>
</b:Contacts>
<b:Industry>Example</b:Industry>
<b:Status>Example</b:Status>
<b:VATNo>1001</b:VATNo>
<b:Currency>DKK</b:Currency>
<b:PaymentTermId>1001</b:PaymentTermId>
<b:InvoicingAddress>
<a:Address1>Example</a:Address1>
<a:Address2>Example</a:Address2>
<a:Address3>Example</a:Address3>
<a:ZipCode>1000</a:ZipCode>
<a:City>Copenhagen</a:City>
<a:State>Example</a:State>
<a:Country>DK</a:Country>
</b:InvoicingAddress>
<b:InvoicingName>Example invoicing</b:InvoicingName>
<b:UseInvoicingAddress>false</b:UseInvoicingAddress>
<b:CustomerSinceDate>2026-10-01T00:00:00</b:CustomerSinceDate>
<b:NickName>Example nick</b:NickName>
<b:OrganizationNumber>1001</b:OrganizationNumber>
<b:KAM2>Example</b:KAM2>
<b:Details>
<b:Status>
<b:ID>1001</b:ID>
<b:Name>Example </b:Name>
<b:Type>IsShownInCustomers</b:Type>
</b:Status>
<b:Industry>
<b:ID>1001</b:ID>
<b:Branche>Example</b:Branche>
</b:Industry>
<b:Currency>
<a:ID>1001</a:ID>
<a:Abbreviation>DKK</a:Abbreviation>
<a:Rate>0</a:Rate>
<a:RateDate>2026-10-01T00:00:00</a:RateDate>
<a:DescriptiveName>Example descriptive</a:DescriptiveName>
</b:Currency>
<b:KAM>
<a:ID>1001</a:ID>
<a:Initials>ABC</a:Initials>
<a:FullName>Example full</a:FullName>
</b:KAM>
<b:KAM2>
<a:ID>1001</a:ID>
<a:Initials>ABC</a:Initials>
<a:FullName>Example full</a:FullName>
</b:KAM2>
</b:Details>
</b:Customer>
</a:Return>
<a:ReturnTypeDescription>Customer</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>true</a:IsReturnPaged>
<a:TotalPageCount>1</a:TotalPageCount>
</GetCustomersByFieldsForLinkingResult>
</GetCustomersByFieldsForLinkingResponse>
</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.
This operation has no errors of its own beyond the shared ones.