Skip to content

Commit

Permalink
Update README document upload example
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevers committed Jul 7, 2021
1 parent 775040e commit 3e4e4a0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,18 @@ use SellingPartnerApi\Model\Feeds;

$feedType = FeedType::POST_PRODUCT_PRICING_DATA;
$feedsApi = new FeedsApi($config);

// Create feed document
$createFeedDocSpec = new Feeds\CreateFeedDocumentSpecification(['content_type' => $feedType['contentType']]);
$feedDocumentInfo = $feedsApi->createFeedDocument($createFeedDocSpec);
$feedDocumentId = $feedDocumentInfo->getPayload()->getFeedDocumentId();

$documentContents = file_get_contents('<your/feed/file.xml>');
// Upload feed contents to document
$feedContents = file_get_contents('<your/feed/file.xml>');
$docToUpload = new SellingPartnerApi\Document($feedDocumentInfo->getPayload(), $feedType);
$docToUpload->upload($feedContents);

$docToUpload = new SellingPartnerApi\Document($feedDocumentInfo->getPayload());
$docToUpload->upload($documentContents);
// ... call FeedsApi::createFeed() with $feedDocumentId
```


Expand Down

0 comments on commit 3e4e4a0

Please sign in to comment.