示例#1
0
文件: orders.go 项目: svvu/gomws
// GetOrder Returns orders based on the AmazonOrderId values that you specify.
// Maximum 50 ids.
// http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_GetOrder.html
func (o Orders) GetOrder(amazonOrderIds []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetOrder",
		"AmazonOrderId": amazonOrderIds,
	}
	structuredParams := params.StructureKeys("AmazonOrderId", "Id")

	return o.SendRequest(structuredParams)
}
示例#2
0
文件: products.go 项目: svvu/gomws
// GetCompetitivePricingForSKU Returns the current competitive price of a product, based on SellerSKU.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForSKU.html
func (p Products) GetCompetitivePricingForSKU(sellerSKUList []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetCompetitivePricingForSKU",
		"SellerSKUList": sellerSKUList,
		"MarketplaceId": p.MarketPlaceId,
	}
	structuredParams := params.StructureKeys("SellerSKUList", "SellerSKU")

	return p.SendRequest(structuredParams)
}
示例#3
0
文件: products.go 项目: svvu/gomws
// GetMatchingProduct Returns a list of products and their attributes, based on a list of ASIN values.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProduct.html
func (p Products) GetMatchingProduct(asinList []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetMatchingProduct",
		"ASINList":      asinList,
		"MarketplaceId": p.MarketPlaceId,
	}
	structuredParams := params.StructureKeys("ASINList", "ASIN")

	return p.SendRequest(structuredParams)
}
示例#4
0
文件: products.go 项目: svvu/gomws
// GetMatchingProductForId Returns a list of products and their attributes, based on a list of ASIN, GCID, SellerSKU, UPC, EAN, ISBN, and JAN values.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
func (p Products) GetMatchingProductForId(idType string, idList []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetMatchingProductForId",
		"IdType":        idType,
		"IdList":        idList,
		"MarketplaceId": p.MarketPlaceId,
	}
	structuredParams := params.StructureKeys("IdList", "Id")

	return p.SendRequest(structuredParams)
}
示例#5
0
文件: products.go 项目: svvu/gomws
// GetMyPriceForASIN Returns pricing information for your own offer listings, based on ASIN.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html
func (p Products) GetMyPriceForASIN(asinList []string, optional ...gmws.Parameters) *mwsHttps.Response {
	op := gmws.OptionalParams([]string{"ItemCondition"}, optional)
	params := gmws.Parameters{
		"Action":        "GetMyPriceForASIN",
		"ASINList":      asinList,
		"MarketplaceId": p.MarketPlaceId,
	}.Merge(op)
	structuredParams := params.StructureKeys("ASINList", "ASIN")

	return p.SendRequest(structuredParams)
}
示例#6
0
文件: products.go 项目: svvu/gomws
// GetLowestOfferListingsForSKU Returns pricing information for the lowest-price active offer listings for up to 20 products, based on SellerSKU.
// Optional Parameters:
// 	ItemCondition - string
// 	ExcludeMe - bool
// http://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForSKU.html
func (p Products) GetLowestOfferListingsForSKU(sellerSKUList []string, optional ...gmws.Parameters) *mwsHttps.Response {
	op := gmws.OptionalParams([]string{"ItemCondition", "ExcludeMe"}, optional)
	params := gmws.Parameters{
		"Action":        "GetLowestOfferListingsForSKU",
		"SellerSKUList": sellerSKUList,
		"MarketplaceId": p.MarketPlaceId,
	}.Merge(op)
	structuredParams := params.StructureKeys("SellerSKUList", "SellerSKU")

	return p.SendRequest(structuredParams)
}
示例#7
0
文件: orders.go 项目: svvu/gomws
// ListOrders Returns orders created or updated during a time frame that you specify.
//
// Note: When calling this operation, either CreatedAfter or LastUpdatedAfter must be specify.
// Specify both will return an error.
//
// other params:
// 	CreatedAfter - string, ISO-8601 date format.
// 		Required, if LastUpdatedAfter is not specified.
// 	CreatedBefore - string, ISO-8601 date format.
// 		Can only be specified if CreatedAfter is specified.
//	LastUpdatedAfter - string, ISO-8601 date format.
// 		Required, if CreatedAfter is not specified.
// 		If LastUpdatedAfter is specified, then BuyerEmail and SellerOrderId cannot be specified.
// 	LastUpdatedBefore - string, ISO-8601 date format.
// 		Can only be specified if LastUpdatedAfter is specified.
// 	OrderStatus - []string.
// 		Values: PendingAvailability, Pending, Unshipped, PartiallyShipped, Shipped,
// 		InvoiceUnconfirmed, Canceled, Unfulfillable. Default: All.
//	FulfillmentChannel - []string.
// 		Values: AFN, MFN. Default: All.
// 	PaymentMethod - []string.
// 		Values: COD, CVS, Other. Default: All.
// 	BuyerEmail - string.
// 		If BuyerEmail is specified, then FulfillmentChannel, OrderStatus, PaymentMethod,
// 		LastUpdatedAfter, LastUpdatedBefore, and SellerOrderId cannot be specified.
// 	SellerOrderId - string.
// 		If SellerOrderId is specified, then FulfillmentChannel, OrderStatus,
// 		PaymentMethod, LastUpdatedAfter, LastUpdatedBefore, and BuyerEmail cannot be specified.
// 	MaxResultsPerPage - int.
// 		Value 1 - 100. Default 100.
// 	TFMShipmentStatus - []string.
// 		Values: PendingPickUp, LabelCanceled, PickedUp, AtDestinationFC,
// 		Delivered, RejectedByBuyer, Undeliverable, ReturnedToSeller, Lost.
func (o Orders) ListOrders(others ...gmws.Parameters) *mwsHttps.Response {
	op := gmws.OptionalParams([]string{
		"CreatedAfter", "CreatedBefore",
		"LastUpdatedAfter", "LastUpdatedBefore",
		"OrderStatus", "FulfillmentChannel", "PaymentMethod",
		"SellerOrderId", "BuyerEmail",
		"TFMShipmentStatus", "MaxResultsPerPage",
	}, others)
	params := gmws.Parameters{
		"Action":        "ListOrders",
		"MarketplaceId": []string{o.MarketPlaceId},
	}.Merge(op)

	structuredParams := params.StructureKeys("MarketplaceId", "Id")
	if _, ok := structuredParams["OrderStatus"]; ok {
		structuredParams = params.StructureKeys("OrderStatus", "Status")
	}
	if _, ok := structuredParams["FulfillmentChannel"]; ok {
		structuredParams = params.StructureKeys("FulfillmentChannel", "Channel")
	}
	if _, ok := structuredParams["OrderStatus"]; ok {
		structuredParams = params.StructureKeys("PaymentMethod", "Method")
	}
	if _, ok := structuredParams["OrderStatus"]; ok {
		structuredParams = params.StructureKeys("TFMShipmentStatus", "Status")
	}

	return o.SendRequest(structuredParams)
}