ImportTransactionalData

Adds multiple pieces of transactional data to contacts asynchronously

This method adds multiple pieces of transactional data to contacts asynchronously, which returns an identifier that can be used to check for import progress via the GetTransactionalDataImportProgress operation.

🚧

Ensure contacts already exist to successfully bulk add transactional data to them

You'll need to ensure that the contacts you're bulk adding transactional data to already exist in the account. Contacts aren't created via this method.

Please be aware that this method won't fail when transactional data doesn't get imported for non-existent contacts. To get a report on import success and faults, you'll need to use the GetTransactionalDataImportReport method.

This method can be used to add multiple pieces of AccountInsight data, in which case the contact identifier used should be "account".

A maximum of 10MB of transactional data can be uploaded in a request.

Please note that valid transactional data collection names must be unique, even if the collections are differently scoped (e.g. one collection is contact-scoped and another collection is account-scoped (AccountInsight)).

Collection names can only contain alphanumeric characters (A-Z, a-z, 0-9), dashes ( - ) and underscores ( _ ), they can't start with a number and they can't exceed 255 characters in length.

The possible status types are:

  • 'NotStarted' - The import has been accepted, but has not yet started to process
  • 'NotFinished' - The import has been accepted, and has started but is yet to finish
  • 'Finished' - The import has successfully finished processing
  • 'Failed' - The import failed processing
  • 'NotAvailableInThisVersion' - This feature is not available in the version of the API you're using

SOAP action: http://apiconnector.com/v2/ApiService/ImportTransactionalData

πŸ“˜

Input and output parameters

The input and output parameters for this method are:

Input parameters

  • DataCollection - required; string
  • TransactionalData - array of TransactionalData
    • TransactionalData
      • Key - required; string
      • ContactIdentifier - required; string
      • Json - required; string

Output parameters

  • ImportTransactionalDataResult
    • TransactionalDataImport
      • ID - GUID
      • Status - string (NotStarted', 'NotFinished', 'Finished', 'Failed')

Example

using (var client = new ApiServiceClient())
{
	client.ClientCredentials.UserName.UserName = "username";
	client.ClientCredentials.UserName.Password = "password";

	var collectionName = "TestCollectionName";
	
	
	var transactionalData1 = new ApiTransactionalData {
	                                ContactIdentifier = "[email protected]",
	                                Key = "P00000001",
	                                Json = @"{
	                                    ""PurchaseDate"": ""2020-01-01T09:40:18.527Z"",
	                                    ""TotalExTax"": 111.2000000000,
	                                    ""TotalIncTax"": 133.4400000000,
	                                    ""Product"": [
	                                        {
	                                            ""Name"": ""Long unlined leather gloves"",
	                                            ""Brand"": ""Dents"",
	                                            ""Department"": ""Womenswear"",
	                                            ""Category"": ""Gloves"",
	                                            ""PriceExTax"": 111.2000000000,
	                                            ""ProductID"": ""24920""
	                                        }
	                                    ],
	                                    ""SalesChannel"": ""In store"",
	                                    ""SalesSubChannel"": ""London - One New Change""
	                                    }"
	};
	
	var transactionalData2 = new ApiTransactionalData {
	                                ContactIdentifier = "[email protected]",
	                                Key = "P00000002",
	                                Json = @"{
	                                    ""PurchaseDate"": ""2020-01-02T09:40:18.527Z"",
	                                    ""TotalExTax"": 111.2000000000,
	                                    ""TotalIncTax"": 133.4400000000,
	                                    ""Product"": [
	                                        {
	                                            ""Name"": ""A different pair of long unlined leather gloves"",
	                                            ""Brand"": ""Dents"",
	                                            ""Department"": ""Womenswear"",
	                                            ""Category"": ""Gloves"",
	                                            ""PriceExTax"": 111.2000000000,
	                                            ""ProductID"": ""24920""
	                                        }
	                                    ],
	                                    ""SalesChannel"": ""In store"",
	                                    ""SalesSubChannel"": ""London - One New Change""
	                                    }"
	};
	
	var transactionalData = new[] { transactionalData1, transactionalData2 };
	
	var createdTransactionalData = client.ImportTransactionalData(collectionName, transactionalData);
}