Retrieving Account Object Using The CustomerKey Attribute

Use the Retrieve() method on the CustomerKey attribute to retrieve information about the account, such as its name and account type.

Sample SOAP Envelope 

1<?xml version="1.0" encoding="UTF-8"?>
2<s:Envelope
3  xmlns:s="http://www.w3.org/2003/05/soap-envelope"
4  xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
5  xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
6  <s:Header>
7    <a:Action s:mustUnderstand="1">Retrieve</a:Action>
8    <a:To s:mustUnderstand="1">https://YOUR_DOMAIN.soap.marketingcloudapis.com/Service.asmx</a:To>
9    <fueloauth xmlns="http://exacttarget.com">YOUR_ACCESS_TOKEN</fueloauth>
10  </s:Header>
11  <s:Body
12    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
14    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
15      <RetrieveRequest>
16        <ObjectType>Account</ObjectType>
17        <Properties>AccountType</Properties>
18        <Properties>CustomerKey</Properties>
19        <Properties>EditionID</Properties>
20        <Properties>ID</Properties>
21        <Properties>Name</Properties>
22        <Properties>ObjectState</Properties>
23        <Properties>ParentID</Properties>
24        <Properties>PartnerKey</Properties>
25        <QueryAllAccounts>true</QueryAllAccounts>
26        <Filter
27          xsi:type="ns1:SimpleFilterPart"
28          xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
29          <Property>CustomerKey</Property>
30          <SimpleOperator>equals</SimpleOperator>
31          <Value>676f68a3-741d-4964-b2ef-d90c405b4ba2</Value>
32        </Filter>
33      </RetrieveRequest>
34    </RetrieveRequestMsg>
35  </s:Body>
36</s:Envelope>

Sample SOAP Response 

The response contains the specified fields from the request.

1<?xml version="1.0" encoding="utf-8"?>
2<soap:Envelope
3  xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
4  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
6  xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
7  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
8  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
9  <env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope">
10    <wsa:Action>RetrieveResponse</wsa:Action>
11    <wsa:MessageID>urn:uuid:ae71ff4e-9f23-4978-b683-cd18a17dc8ec</wsa:MessageID>
12    <wsa:RelatesTo>urn:uuid:0556486a-10f6-421f-8702-c0ca1dd1878e</wsa:RelatesTo>
13    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
14    <wsse:Security>
15      <wsu:Timestamp wsu:Id="Timestamp-9ff03292-3917-43fb-9eb9-a5a279de1309">
16        <wsu:Created>2025-01-27T22:55:21Z</wsu:Created>
17        <wsu:Expires>2025-01-27T23:00:21Z</wsu:Expires>
18      </wsu:Timestamp>
19    </wsse:Security>
20  </env:Header>
21  <soap:Body>
22    <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
23      <OverallStatus>OK</OverallStatus>
24      <RequestID>c455bc27-38f5-41e8-b04c-9a8793255104</RequestID>
25      <Results xsi:type="Account">
26        <PartnerKey />
27        <ID>987654</ID>
28        <ObjectID xsi:nil="true" />
29        <CustomerKey>676f68a3-741d-4964-b2ef-d90c405b4ba2</CustomerKey>
30        <ObjectState />
31        <AccountType>CONNECT</AccountType>
32        <ParentID>0</ParentID>
33        <Name>Northern Trail Outfitters</Name>
34        <EditionID>2</EditionID>
35        <Subscription xsi:nil="true" />
36      </Results>
37    </RetrieveResponseMsg>
38  </soap:Body>
39</soap:Envelope>