-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - amazon_selling_partner #17562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
.../amazon_selling_partner/actions/check-fba-inventory-levels/check-fba-inventory-levels.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 || []; | ||
| }, | ||
| }; |
63 changes: 63 additions & 0 deletions
63
.../amazon_selling_partner/actions/fetch-orders-by-date-range/fetch-orders-by-date-range.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 || []; | ||
| }, | ||
| }; | ||
71 changes: 71 additions & 0 deletions
71
...ing_partner/actions/generate-sales-inventory-reports/generate-sales-inventory-reports.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
35 changes: 35 additions & 0 deletions
35
components/amazon_selling_partner/actions/get-order-details/get-order-details.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
54 changes: 54 additions & 0 deletions
54
components/amazon_selling_partner/actions/list-inbound-shipments/list-inbound-shipments.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
58 changes: 58 additions & 0 deletions
58
...ents/amazon_selling_partner/actions/optimize-product-pricing/optimize-product-pricing.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.