Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What data as string passed to setFeedContent? Is it xml as string? #56

Open
ameer8f26 opened this issue Jul 6, 2021 · 1 comment
Open

Comments

@ameer8f26
Copy link

I need to know what data as string is passed to following function
amazon-mws-laravel/src/AmazonFeed.php/setFeedContent($s)

What will be inside $s in setFeedContent($s)??
Will it be xml as string?

Give simple example please.
Thanks.

@ameer8f26 ameer8f26 changed the title Feed Submit _POST_ORDER_FULFILLMENT_DATA_ What data as string passed to setFeedContent? Is it xml as string? Jul 7, 2021
@gaurav2262
Copy link

Which feed type you want to submit?

if your feed type contains XML,

Then just create an XML and store it to the variable and then set that variable to the setFeedCotent().

$xmlString = '<?xml version="1.0" encoding="UTF-8"?>
           <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
               <Header>
                   <DocumentVersion>1.01</DocumentVersion>
                   <MerchantIdentifier>XXXX</MerchantIdentifier>
               </Header>
               <MessageType>CartonContentsRequest</MessageType>
               <Message>
                   <MessageID>MSG !</MessageID>
                   <CartonContentsRequest>
                       <ShipmentId>FBAXXX</ShipmentId>
                       <NumCartons>XX</NumCartons>
                       <Carton>
                           <CartonId>SSS</CartonId>
                           <Item>
                               <SKU>SKU</SKU>
                               <QuantityShipped>XXX</QuantityShipped>
                               <QuantityInCase>XX</QuantityInCase>
                           </Item>
                       </Carton>
                       <Carton>
                           <CartonId>SSS</CartonId>
                           <Item>
                               <SKU>SKU</SKU>
                               <QuantityShipped>XXX</QuantityShipped>
                               <QuantityInCase>XX</QuantityInCase>
                           </Item>
                       </Carton>
                   </CartonContentsRequest>
               </Message>
           </AmazonEnvelope>';

Once your XML is ready just set it to the setFeedContent() function.

Here is my example, I have created XML in $xmlString variable and then I set that variable to the setFeedContent() function

        $amzRequestFeed = new AmazonFeed($store);
        $setFeedResult = $amzRequestFeed->setFeedContent($xmlString);

Hope this is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants