Adds a single piece of transactional data to a contact
This method adds a single piece of transactional data to a contact.
This method can be used to add a single piece of AccountInsight data, in which case the contact identifier used should be "account".
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.
SOAP action: http://apiconnector.com/v2/ApiService/AddTransactionalData
Input and output parameters
The input and output parameters for this method are:
Input parameters
- DataCollection - required; string
- TransactionalData
- Key - required; string
- ContactIdentifier - required; string
- Json - required; string
Output parameters
- AddTransactionalDataResult
- Key - string
- ContactIdentifier - string
- Json - string
Example
using (var client = new ApiServiceClient())
{
client.ClientCredentials.UserName.UserName = "username";
client.ClientCredentials.UserName.Password = "password";
var collectionName = "TestCollectionName";
var transactionalData = 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 createdTransactionalData = client.AddTransactionalData(collectionName, transactionalData);
}