Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";

export default {
key: "amazon_selling_partner-check-fba-inventory-levels",
name: "Check FBA Inventory Levels",
description: "Retrieves inventory summaries from Amazon fulfillment centers to monitor stock availability. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getinventorysummaries)",
version: "0.0.1",
type: "action",
props: {
amazonSellingPartner,
marketplaceId: {
propDefinition: [
amazonSellingPartner,
"marketplaceId",
],
},
details: {
type: "boolean",
label: "Details",
description: "Set to `true` to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).",
optional: true,
},
startDateTime: {
type: "string",
label: "Start Date Time",
description: "A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected.",
optional: true,
},
sellerSkus: {
type: "string[]",
label: "Seller SKUs",
description: "A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.",
optional: true,
},
},
async run({ $ }) {
const { payload } = await this.amazonSellingPartner.getInventorySummaries({
$,
params: {
marketplaceIds: this.marketplaceId,
granularityType: "Marketplace",
granularityId: this.marketplaceId,
details: this.details,
startDateTime: this.startDateTime,
sellerSkus: this.sellerSkus?.length
? this.sellerSkus.join(",")
: undefined,
},
});
$.export("$summary", `Fetched ${payload.inventorySummaries.length} inventory summar${payload.inventorySummaries.length === 1
? "y"
: "ies"}`);
return payload.inventorySummaries || [];
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";

export default {
key: "amazon_selling_partner-fetch-orders-by-date-range",
name: "Fetch Orders by Date Range",
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)",
version: "0.0.1",
type: "action",
props: {
amazonSellingPartner,
marketplaceId: {
propDefinition: [
amazonSellingPartner,
"marketplaceId",
],
},
createdAfter: {
type: "string",
label: "Created After",
description: "Fetch orders created after this ISO date.",
},
createdBefore: {
type: "string",
label: "Created Before",
description: "Fetch orders created before this ISO date.",
optional: true,
},
buyerEmail: {
type: "string",
label: "Buyer Email",
description: "The email address of a buyer",
optional: true,
},
amazonOrderId: {
propDefinition: [
amazonSellingPartner,
"orderId",
(c) => ({
marketplaceId: c.marketplaceId,
}),
],
label: "Seller Order ID",
description: "An order identifier that is specified by the seller. Used to select only the orders that match the order identifier. If SellerOrderId is specified, then FulfillmentChannels, OrderStatuses, PaymentMethod, LastUpdatedAfter, LastUpdatedBefore, and BuyerEmail cannot be specified.",
optional: true,
},
},
async run({ $ }) {
const { payload } = await this.amazonSellingPartner.listOrders({
$,
params: {
MarketplaceIds: this.marketplaceId,
CreatedAfter: this.createdAfter,
CreatedBefore: this.createdBefore,
BuyerEmail: this.buyerEmail,
SellerOrderId: this.amazonOrderId,
},
});
$.export("$summary", `Fetched ${payload.Orders.length} order${payload.Orders.length === 1
? ""
: "s"}`);
return payload.Orders || [];
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";

export default {
key: "amazon_selling_partner-generate-sales-inventory-reports",
name: "Generate Sales & Inventory Reports",
description: "Requests reports on sales, inventory, and fulfillment performance. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getreports)",
version: "0.0.1",
type: "action",
props: {
amazonSellingPartner,
reportTypes: {
type: "string[]",
label: "Report Types",
description: "A list of report types used to filter reports. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information.",
},
marketplaceId: {
propDefinition: [
amazonSellingPartner,
"marketplaceId",
],
optional: true,
},
processingStatuses: {
type: "string[]",
label: "Processing Statuses",
description: "A list of processing statuses used to filter reports",
options: [
"CANCELLED",
"DONE",
"FATAL",
"IN_PROGRESS",
"IN_QUEUE",
],
optional: true,
},
createdSince: {
type: "string",
label: "Created Since",
description: "The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.",
optional: true,
},
createdUntil: {
type: "string",
label: "Created Until",
description: "The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now.",
optional: true,
},
},
async run({ $ }) {
const reports = await this.amazonSellingPartner.getPaginatedResources({
fn: this.amazonSellingPartner.listReports,
params: {
reportTypes: this.reportTypes
? this.reportTypes.join(",")
: undefined,
marketplaceIds: this.marketplaceId,
processingStatuses: this.processingStatuses
? this.processingStatuses.join(",")
: undefined,
createdSince: this.createdSince,
createdUntil: this.createdUntil,
},
resourceKey: "reports",
hasPayload: false,
});
$.export("$summary", `Fetched ${reports.length} report${reports.length === 1
? ""
: "s"}`);
return reports;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";

export default {
key: "amazon_selling_partner-get-order-details",
name: "Get Order Details",
description: "Fetches detailed information about a specific order using its order ID. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getorder)",
version: "0.0.1",
type: "action",
props: {
amazonSellingPartner,
marketplaceId: {
propDefinition: [
amazonSellingPartner,
"marketplaceId",
],
},
amazonOrderId: {
propDefinition: [
amazonSellingPartner,
"orderId",
(c) => ({
marketplaceId: c.marketplaceId,
}),
],
},
},
async run({ $ }) {
const response = await this.amazonSellingPartner.getOrder({
$,
orderId: this.amazonOrderId,
});
$.export("$summary", `Fetched order details for ${this.amazonOrderId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";

export default {
key: "amazon_selling_partner-list-inbound-shipments",
name: "List Inbound Shipments",
description: "Fetches inbound shipment details to track stock movement and replenishment. [See the documentation](https://developer-docs.amazon.com/sp-api/reference/getshipments)",
version: "0.0.1",
type: "action",
props: {
amazonSellingPartner,
marketplaceId: {
propDefinition: [
amazonSellingPartner,
"marketplaceId",
],
},
status: {
propDefinition: [
amazonSellingPartner,
"status",
],
},
lastUpdatedAfter: {
type: "string",
label: "Last Updated After",
description: "A date used for selecting inbound shipments that were last updated after (or at) a specified time. The selection includes updates made by Amazon and by the seller.",
optional: true,
},
lastUpdatedBefore: {
type: "string",
label: "Last Updated Before",
description: "A date used for selecting inbound shipments that were last updated before (or at) a specified time. The selection includes updates made by Amazon and by the seller.",
optional: true,
},
},
async run({ $ }) {
const shipments = await this.amazonSellingPartner.getPaginatedResources({
fn: this.amazonSellingPartner.listInboundShipments,
params: {
MarketplaceId: this.marketplaceId,
ShipmentStatusList: this.status?.length
? this.status.join(",")
: undefined,
LastUpdatedAfter: this.lastUpdatedAfter,
LastUpdatedBefore: this.lastUpdatedBefore,
},
resourceKey: "ShipmentData",
});
$.export("$summary", `Fetched ${shipments.length} shipment${shipments.length === 1
? ""
: "s"}`);
return shipments;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import amazonSellingPartner from "../../amazon_selling_partner.app.mjs";

export default {
key: "amazon_selling_partner-optimize-product-pricing",
name: "Optimize Product Pricing",
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)",
version: "0.0.1",
type: "action",
props: {
amazonSellingPartner,
marketplaceId: {
propDefinition: [
amazonSellingPartner,
"marketplaceId",
],
},
itemType: {
type: "string",
label: "Item Type",
description: "Indicates whether ASIN values or seller SKU values are used to identify items. If you specify Asin, the information in the response will be dependent on the list of Asins you provide in the Asins parameter. If you specify Sku, the information in the response will be dependent on the list of Skus you provide in the Skus parameter.",
options: [
"Asin",
"Sku",
],
},
values: {
type: "string[]",
label: "Values",
description: "A list of ASINs or seller SKUs. You may specify up to 20 identifiers.",
},
customerType: {
type: "string",
label: "Customer Type",
description: "Filters the offer listings based on customer type",
options: [
"Consumer",
"Business",
],
},
},
async run({ $ }) {
const { payload } = await this.amazonSellingPartner.listProductPricing({
$,
params: {
MarketplaceId: this.marketplaceId,
ItemType: this.itemType,
[this.itemType === "Asin"
? "Asins"
: "Skus"]: this.values.join(","),
CustomerType: this.customerType,
},
});
if (payload[0]?.Product) {
$.export("$summary", "Fetched pricing information");
}
return payload;
},
};
Loading
Loading