Hi,
Thank you for contacting the Ad Manager API support team.
I have reviewed your query and understand that while creating a Line item, you are getting the error i.e, ‘Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element’. In SOAP XML, the order of the fields matters. I recommend using the documentation to ensure the correct order followed while creating the Line item. Also, please refer to the provided logs, which follow the correct insertion order of fields or parameters. You may refer to this link for the all available client libraries for the Ad Manager API.
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:RequestHeader xmlns:ns1="https://www.google.com/apis/ads/publisher/v202311" soapenv:mustUnderstand="0">
<ns1:networkCode></ns1:networkCode>
<ns1:applicationName></ns1:applicationName>
</ns1:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<createLineItems xmlns="https://www.google.com/apis/ads/publisher/v202311">
<lineItems>
<orderId></orderId>
<name>test line item</name>
<externalId>123456789</externalId>
<startDateTime>
<date>
<year>2024</year>
<month>6</month>
<day>1</day>
</date>
<hour>10</hour>
<minute>0</minute>
<second>0</second>
<timeZoneId>Asia/Jerusalem</timeZoneId>
</startDateTime>
<startDateTimeType>USE_START_DATE_TIME</startDateTimeType>
<unlimitedEndDateTime>true</unlimitedEndDateTime>
<creativeRotationType>EVEN</creativeRotationType>
<deliveryRateType>EVENLY</deliveryRateType>
<deliveryForecastSource>HISTORICAL</deliveryForecastSource>
<roadblockingType>ONE_OR_MORE</roadblockingType>
<skippableAdType>DISABLED</skippableAdType>
<lineItemType>SPONSORSHIP</lineItemType>
<priority>7</priority>
<costPerUnit>
<currencyCode></currencyCode>
<microAmount>0</microAmount>
</costPerUnit>
<valueCostPerUnit>
<currencyCode></currencyCode>
<microAmount>0</microAmount>
</valueCostPerUnit>
<costType>CPD</costType>
<discountType>PERCENTAGE</discountType>
<creativePlaceholders>
<size>
<width>120</width>
<height>600</height>
<isAspectRatio>false</isAspectRatio>
</size>
<creativeSizeType>PIXEL</creativeSizeType>
<isAmpOnly>false</isAmpOnly>
</creativePlaceholders>
<environmentType>BROWSER</environmentType>
<companionDeliveryOption>UNKNOWN</companionDeliveryOption>
<notes>testing</notes>
<competitiveConstraintScope>POD</competitiveConstraintScope>
<isMissingCreatives>true</isMissingCreatives>
<primaryGoal>
<goalType>DAILY</goalType>
<unitType>IMPRESSIONS</unitType>
<units>100</units>
</primaryGoal>
<childContentEligibility>DISALLOWED</childContentEligibility>
<targeting>
<inventoryTargeting>
<targetedAdUnits>
<adUnitId></adUnitId>
<includeDescendants>true</includeDescendants>
</targetedAdUnits>
</inventoryTargeting>
</targeting>
</lineItems>
</createLineItems>
</soapenv:Body>
</soapenv:Envelope>
Ad Manager API Team |