josalba/amazon-mws
Composer 安装命令:
composer require josalba/amazon-mws
包简介
Biblioteca para interactuar con Amazon MWS
README 文档
README
Interacción con Amazon Api para proveedores llamados MWS. Actualización de este fork permite recuperar datos de otros marketplace, actualizar tracking, validar agencias de envio y comprar etiquetas de envio.
Instalar
$ composer require josalba/amazon-mws
Iniciar cliente
require_once 'vendor/autoload.php'; $client = new MCS\MWSClient( 'Marketplace_Id', 'Seller_Id', 'Access_Key_ID', 'Secret_Access_Key', 'MWSAuthToken' // Optional. Only use this key if you are a third party user/developer ); $client->validateCredentials();
Recuperar pedidos
$orders = $client->getOrders(); foreach ($orders as $order) { $items = $client->ListOrderItems($order['AmazonOrderId']); print_r($order); print_r($items); }
Recuperar atributos producto
$searchField = 'ASIN'; // Can be GCID, SellerSKU, UPC, EAN, ISBN, or JAN $result = $client->getMatchingProductForId([ '<ASIN1>', '<ASIN2>', '<ASIN3>' ], $searchField); print_r($result);
Crear o actualizar producto
$product = new MCS\MWSProduct(); $product->sku = 'TESTNOTFORSALE'; $product->price = '1000.00'; $product->product_id = 'B0031S9***'; $product->product_id_type = 'ASIN'; $product->condition_type = 'New'; $product->quantity = 10; if ($product->validate()) { // You can also submit an array of MWSProduct objects $result = $client->postProduct($product); } else { $errors = $product->getValidationErrors(); }
Actualizar stock del productos
$result = $client->updateStock([ 'sku1' => 20, 'sku2' => 9, ]); print_r($result); $info = $client->getFeedSubmissionResult($result['FeedSubmissionId']); print_r($info);
Actualizar stock y latencia del producto
Actualizar stock y tiempo de preparacion del producto.
$result = $client->updateStockWithFulfillmentLatency([ ['sku' => 'sku1', 'quantity' => 20, 'latency' => 1], ['sku' => 'sku2', 'quantity' => 20, 'latency' => 1], ]); print_r($result); $info = $client->getFeedSubmissionResult($result['FeedSubmissionId']); print_r($info);
Actualizar precio de productos
$result = $client->updatePrice([ 'sku1' => '20.99', 'sku2' => '100.00', ]); print_r($result); $info = $client->getFeedSubmissionResult($result['FeedSubmissionId']); print_r($info);
Reports
For all report types, visit: http://docs.developer.amazonservices.com
$reportId = $client->requestReport('_GET_MERCHANT_LISTINGS_DATA_'); // Wait a couple of minutes and get it's content $report_content = $client->GetReport($reportId); print_r($report_content);
Actualizar tracking
Actualizar el tracking de un pedido.
$return = $client->setTracking( "XXX-XXXXXXX-XXXXXXX", //Order id "MRW", //Agency "Standard", //Method "123456231231" //Tracking );
Almacenar etiqueta
Guarda la etiqueta recuperada por la compra, en un fichero
$return = $client->labelShipmentToFile( '{ReturnCreateShipment}', '{file}' );
Available methods
View source for detailed argument description. All methods starting with an uppercase character are also documented in the Amazon MWS documentation
// Returns the current competitive price of a product, based on ASIN. $client->getCompetitivePricingForASIN($asin_array = []); // Returns the feed processing report and the Content-MD5 header. $client->getFeedSubmissionResult($FeedSubmissionId); // Returns pricing information for the lowest-price active offer listings for up to 20 products, based on ASIN. $client->getLowestOfferListingsForASIN($asin_array = [], $ItemCondition = null); // Returns lowest priced offers for a single product, based on ASIN. $client->getLowestPricedOffersForASIN($asin, $ItemCondition = 'New'); // Returns a list of products and their attributes, based on a list of ASIN, GCID, SellerSKU, UPC, EAN, ISBN, and JAN values. $client->getMatchingProductForId($asin_array, $type = 'ASIN'); // Returns a list of products and their attributes, based on an open text based query $client->listMatchingProducts($query, $query_context_id = null); // Returns pricing information for your own offer listings, based on ASIN. $client->getMyPriceForASIN($asin_array = [], $ItemCondition = null); // Returns pricing information for your own offer listings, based on SKU. $client->getMyPriceForSKU($sku_array = [], $ItemCondition = null); // Returns an order based on the AmazonOrderId values that you specify. $client->getOrder($AmazonOrderId); // Returns the parent product categories that a product belongs to, based on ASIN. $client->getProductCategoriesForASIN($ASIN); // Returns the parent product categories that a product belongs to, based on SellerSKU. $client->getProductCategoriesForSKU($SellerSKU); // Get a report's content $client->getReport($ReportId); // Returns a list of reports that were created in the previous 90 days. $client->getReportList($ReportTypeList = []); // Get a report's processing status $client->getReportRequestStatus($ReportId); // Get a list's inventory for Amazon's fulfillment $client->listInventorySupply($sku_array = []); // Returns a list of marketplaces that the seller submitting the request can sell in, and a list of participations that include seller-specific information in that marketplace $client->listMarketplaceParticipations(); // Returns order items based on the AmazonOrderId that you specify. $client->listOrderItems($AmazonOrderId); // Returns orders created or updated during a time frame that you specify. $client->listOrders($from, $allMarketplaces = false, $states = ['Unshipped', 'PartiallyShipped'], $FulfillmentChannel = 'MFN'); // Returns your active recommendations for a specific category or for all categories for a specific marketplace. $client->listRecommendations($RecommendationCategory = null); // Creates a report request and submits the request to Amazon MWS. $client->requestReport($report, $StartDate = null, $EndDate = null); // Uploads a feed for processing by Amazon MWS. $client->submitFeed($FeedType, $feedContent, $debug = false); // Call this method to get the raw feed instead of sending it $client->debugNextFeed(); // Post to create or update a product (_POST_FLAT_FILE_LISTINGS_DATA_) $client->postProduct($MWSProduct); // Update a product's price $client->updatePrice($array); // Update a product's stock quantity $client->updateStock($array); // A method to quickly check if the supplied credentials are valid $client->validateCredentials();
统计信息
- 总下载量: 182
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-20