CustomersInsertCustomer

InsertCustomer

CRM service 1.4: Creates a customer and returns it.

ServiceCRM 1.4
EndpointPOST https://app{server-number}.timelog.com/{account}/WebServices/CRM/V1_4/CRMServiceSecure.svc
SOAPActionhttp://api.timelog.com/services/crm/1_4/ICRMService/InsertCustomer
Content-Typetext/xml; charset=utf-8
AuthenticationA token from GetToken
PermissionsCustomer privilege 'all customers': may create any customer.
Changes dataYes
Safe to retryDepends on the call

How it works

Creates a customer from the Customer object. Name, Address.Country, Status and Currency are required; Industry and KAM must exist when sent. Customer.ID is ignored. Leave No empty to get the next number of the account's customer number series. On success Return[0] is the customer as built from the request plus its new ID and ResponseState is Success. Validation and privilege failures come back as ResponseState Invalid with the reason in Messages and the customer you sent in Return[0] - check ResponseState, not Return. Retry safety: supply your own GUID.

Parameters

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

customerCustomer
Required

The Customer to send. Its fields are listed below.

sourceinteger

Optional. Default 0.

tokenSecurityToken
Required

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/InsertCustomer"

<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"
                  xmlns:api="http://api.timelog.com">
  <soapenv:Body>
    <crm:InsertCustomer>
      <crm:customer>
        <crm:Name>{Name}</crm:Name>
        <crm:Address>
          <api:Country>{Country}</api:Country>
          <!-- more fields: see Parameters -->
        </crm:Address>
        <crm:Status>{Status}</crm:Status>
        <crm:Currency>{Currency}</crm:Currency>
        <!-- more fields: see Parameters -->
      </crm:customer>
      <crm:source>0</crm:source>
      <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:InsertCustomer>
  </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.

ReturnCustomer[]

Response<Customer>: Return[0] = the created customer; 'Successfully called' message.

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>
    <InsertCustomerResponse xmlns="http://api.timelog.com/services/crm/1_4">
      <InsertCustomerResult 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>false</a:IsReturnPaged>
        <a:TotalPageCount>0</a:TotalPageCount>
      </InsertCustomerResult>
    </InsertCustomerResponse>
  </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
Invalid10002{field}, was null or empty'FirstName, was null or empty', 'Country, was null or empty').Send the named value.
Invalid30017Unknown Country ISO Code: {code}Address.Country unknown.—
Invalid30018Unknown Customer Status ID: {status}Customer.Status is not the name of an existing customer status of the account.Send the exact Name of a status from GetCustomerStatuses.
Invalid30015Unknown employee Initials: '{initials}'.KAM initials unknown.—
Invalid30019Unknown Industry: {industry}Customer.Industry is not the name of an existing industry.Send an existing industry name or leave Industry empty.
Invalid30020Unknown Currency Abbreviation: {abbreviation}Customer.Currency is not the abbreviation of a currency of the account.Send an existing currency abbreviation.
Invalid30169Customer number is already in use—Send a different number, or leave No empty to use the customer number series.
Invalid20012User: {initials}, has Insufficient Access. Missing privilege was: {role}——
Invalid10001Create of Customer failed!—For updates, read the customer first and send its ID; otherwise retry later or report.