I am able to create a data extension using PHP, but only in the parent account. I know how to target different folders, but I need to create the data extension in a specific Business Unit. How can that be accomplished? I have looked in the Docs and combed through the exacttarget_soap_client.php file and for the life of me, I cannot figure it out.

Thank you.

1 Answer 1


I can't help you specifically with PHP, but I can give you the raw SOAP wrapper, which hopefully you can use to translate to PHP.

Before we get in to the SOAP wrappers, here are some documentation links for working with accounts with multiple Business Units: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/managing_enterprise_20_accounts_with_the_web_services_api.htm

Oh! If you're using the SDK, this page might have exactly what you need: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/using_clientid_in_your_soap_api_code.htm

And, here's my explanation of how to specify a BU in the raw SOAP calls...

You need to set the Client ID (the Business unit MID) in your API call. In Create, Delete, Perform, and Update SOAP calls you do that like this:


Retrieve calls use a different format:


Here is the Client ID (MID) inside a Create DataExtension API call, in situ:

<soapenv:Envelope xmlns:soapenv="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">
      <wsse:Security soapenv:mustUnderstand="1">
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="DataExtension">
            <Description>A place to keep track of what triggers are purposefully in an inactive state</Description>
  • 2
    OMG! that did it! thanks for posting this, really helped me out! From your soap envelope i was able to determine how to set it, like this $de->Client->ID = XXX; I was just doing$de->Client = XXX; and it wasn't working, but this did! Aug 4, 2018 at 0:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .