Skip to content

Commit a1fdb8c

Browse files
authored
Enhance Amazon Selling Partner Component: Implement dynamic API endpoint selection based on seller central URL. Update version numbers for multiple actions and sources to reflect recent changes. (#19149)
1 parent 76d24db commit a1fdb8c

File tree

11 files changed

+43
-12
lines changed

11 files changed

+43
-12
lines changed

components/amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "amazon_selling_partner-check-fba-inventory-levels",
55
name: "Check FBA Inventory Levels",
66
description: "Retrieves inventory summaries from Amazon fulfillment centers to monitor stock availability. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getinventorysummaries)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/amazon_selling_partner/actions/fetch-orders-by-date-range/fetch-orders-by-date-range.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "amazon_selling_partner-fetch-orders-by-date-range",
55
name: "Fetch Orders by Date Range",
66
description: "Retrieves a list of orders based on a specified date range, buyer email, or order ID. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getorders)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/amazon_selling_partner/actions/generate-sales-inventory-reports/generate-sales-inventory-reports.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "amazon_selling_partner-generate-sales-inventory-reports",
55
name: "Generate Sales & Inventory Reports",
66
description: "Requests reports on sales, inventory, and fulfillment performance. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getreports)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/amazon_selling_partner/actions/get-order-details/get-order-details.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "amazon_selling_partner-get-order-details",
55
name: "Get Order Details",
66
description: "Fetches detailed information about a specific order using its order ID. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getorder)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/amazon_selling_partner/actions/list-inbound-shipments/list-inbound-shipments.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "amazon_selling_partner-list-inbound-shipments",
55
name: "List Inbound Shipments",
66
description: "Fetches inbound shipment details to track stock movement and replenishment. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getshipments)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/amazon_selling_partner/actions/optimize-product-pricing/optimize-product-pricing.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "amazon_selling_partner-optimize-product-pricing",
55
name: "Optimize Product Pricing",
66
description: "Retrieves pricing data to adjust product prices dynamically based on market trends. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getcompetitivepricing)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/amazon_selling_partner/actions/retrieve-sales-performance-reports/retrieve-sales-performance-reports.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";
21
import { ConfigurationError } from "@pipedream/platform";
2+
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";
33

44
export default {
55
key: "amazon_selling_partner-retrieve-sales-performance-reports",
66
name: "Retrieve Sales Performance Reports",
77
description: "Fetches sales reports for visualization in third-party dashboarding tools. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getordermetrics)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/amazon_selling_partner/amazon_selling_partner.app.mjs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,39 @@ export default {
6464
},
6565
},
6666
methods: {
67+
_getApiEndpoint(sellerCentralUrl) {
68+
const na = "https://sellingpartnerapi-na.amazon.com";
69+
const eu = "https://sellingpartnerapi-eu.amazon.com";
70+
const fe = "https://sellingpartnerapi-fe.amazon.com";
71+
72+
const map = {
73+
// North America
74+
"https://sellercentral.amazon.com": na,
75+
"https://sellercentral.amazon.ca": na,
76+
"https://sellercentral.amazon.com.mx": na,
77+
"https://sellercentral.amazon.com.br": na,
78+
79+
// Europe (The Big 5 often share one URL, but newer ones have specific URLs)
80+
"https://sellercentral-europe.amazon.com": eu,
81+
"https://sellercentral.amazon.com.be": eu,
82+
"https://sellercentral.amazon.nl": eu,
83+
"https://sellercentral.amazon.pl": eu,
84+
"https://sellercentral.amazon.se": eu,
85+
"https://sellercentral.amazon.com.tr": eu,
86+
87+
// India (Uses EU endpoint)
88+
"https://sellercentral.amazon.in": eu,
89+
90+
// Far East
91+
"https://sellercentral.amazon.sg": fe,
92+
"https://sellercentral.amazon.com.au": fe,
93+
"https://sellercentral.amazon.co.jp": fe,
94+
};
95+
96+
return map[sellerCentralUrl];
97+
},
6798
_baseUrl() {
68-
return "https://sellingpartnerapi-na.amazon.com";
99+
return this._getApiEndpoint(this.$auth.marketplace);
69100
},
70101
_makeRequest({
71102
$ = this, path, ...opts

components/amazon_selling_partner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/amazon_selling_partner",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Pipedream Amazon Selling Partner Components",
55
"main": "amazon_selling_partner.app.mjs",
66
"keywords": [

components/amazon_selling_partner/sources/new-inbound-shipment-to-fba-created/new-inbound-shipment-to-fba-created.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "amazon_selling_partner-new-inbound-shipment-to-fba-created",
66
name: "New Inbound Shipment to FBA Created",
77
description: "Emit new event when a new inbound shipment to FBA is created. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getshipments)",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "source",
1010
dedupe: "unique",
1111
props: {

0 commit comments

Comments
 (0)