Create an Account

As an agency or embedded partner, you may want to create another account for a new client. You can specify the attributes of the account when you create the account, including the following elements:

  • Account Name
  • Account Type (specified by the AccountTypeEnum values)
  • Default Display Name
  • Default From Email Address
  • Physical Mailing Address

How to Create an Account 

Use the sample code below as a model for your own API call.

Sample .NET Code 

1private void CreateAccount()
2        {
3            SoapClient framework = new SoapClient();
4            framework.ClientCredentials.UserName.UserName = "XXXXX";
5            framework.ClientCredentials.UserName.Password = "XXXXX";
6            String requestID;
7            String status;
8            Account acct = new Account();
9            acct.CustomerKey = "Example Client";
10            acct.AccountType = AccountTypeEnum.PRO_CONNECT_CLIENT;
11            acct.Name = "Account Name";
12            acct.Email = "testAccount@example.com";
13            acct.FromName = "AGENCY CLIENT";
14            acct.BusinessName = "AGENCY CLIENT";
15            acct.Address = "123 ABC Street";
16            acct.City = "Indianapolis";
17            acct.State = "IN";
18            acct.Zip = "46202";
19            acct.IsTestAccount = true;
20            acct.IsTestAccountSpecified = true;
21            acct.EditionID = 3;
22            acct.EditionIDSpecified = true;
23            acct.IsActive = 1;
24            acct.IsActiveSpecified = true;
25            CreateOptions co = new CreateOptions();
26            CreateResult[] cresults = framework.Create(co, new APIObject[] { acct }, out requestID, out status);
27            foreach (CreateResult result in cresults)
28            {
29                Console.WriteLine(result.StatusMessage);
30            }
31            Console.WriteLine(requestID + ": " + status);
32            //Readline pauses the output so you can see the results
33            Console.ReadLine();
34        }

Sample SOAP Envelope 

1<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
2   <s:Header>
3      <a:Action s:mustUnderstand="1">Create</a:Action>
4      <a:MessageID>urn:uuid:5dfca442-f1a0-4f7c-9419-8ace5658d2a3</a:MessageID>
5      <a:ReplyTo>
6         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
7      </a:ReplyTo>
8      <a:To s:mustUnderstand="1">https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx</a:To>
9      <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
10         <o:UsernameToken u:Id="uuid-88b91f91-bac2-489b-90fb-37e7b256e20c-1">
11            <o:Username>XXXXX</o:Username>
12            <o:Password>XXXXX</o:Password>
13         </o:UsernameToken>
14      </o:Security>
15   </s:Header>
16   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
17      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
18         <Options>
19            <SaveOptions>
20               <SaveOption>
21                  <PropertyName>*</PropertyName>
22                  <SaveAction>UpdateAdd</SaveAction>
23               </SaveOption>
24            </SaveOptions>
25         </Options>
26         <Objects xsi:type="Account">
27            <PartnerKey xsi:nil="true"/>
28            <ObjectID xsi:nil="true"/>
29            <AccountType>PRO_CONNECT_CLIENT</AccountType>
30            <Name>SampleAccount</Name>
31            <Email>help@example.com</Email>
32            <FromName>My Sample Account</FromName>
33            <BusinessName>Northern Trail Outfitters</BusinessName>
34            <Address>123 Main St.</Address>
35            <City>Indianapolis</City>
36            <State>IN</State>
37            <Zip>46202</Zip>
38            <IsActive>1</IsActive>
39            <IsTestAccount>false</IsTestAccount>
40            <EditionID>3</EditionID>
41            <Subscription xsi:nil="true"/>
42         </Objects>
43      </CreateRequest>
44   </s:Body>
45</s:Envelope>

Once you create the account, you can modify the name, mailing address, or other account properties:

1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
2   <soap:Header>
3      <wsa:Action>Update</wsa:Action>
4      <wsa:MessageID>urn:uuid:5c2b51ff-c1c3-4d5a-a76e-bc9c3438611b</wsa:MessageID>
5      <wsa:ReplyTo>
6         <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
7      </wsa:ReplyTo>
8      <wsa:To>https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx</wsa:To>
9      <wsse:Security soap:mustUnderstand="1">
10         <wsse:UsernameToken wsu:Id="SecurityToken-35c067d1-5207-43f5-8172-bd0e60bf7e82">
11            <wsse:Username>XXXXX</wsse:Username>
12            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
13         </wsse:UsernameToken>
14      </wsse:Security>
15   </soap:Header>
16   <soap:Body>
17      <UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
18         <Objects xsi:type="Account">
19            <PartnerKey/>
20            <ID>12345</ID>
21            <ObjectID xsi:nil="true"/>
22            <Name>New Subaccount Name</Name>
23         </Objects>
24      </UpdateRequest>
25   </soap:Body>
26</soap:Envelope>