diff --git a/code-recipes/java/src/main/java/multichannel_fulfillment/fulfillment_outbound_v1/McfConstants.java b/code-recipes/java/src/main/java/multichannel_fulfillment/fulfillment_outbound_v1/McfConstants.java index 6318ca1f..29ac1e07 100644 --- a/code-recipes/java/src/main/java/multichannel_fulfillment/fulfillment_outbound_v1/McfConstants.java +++ b/code-recipes/java/src/main/java/multichannel_fulfillment/fulfillment_outbound_v1/McfConstants.java @@ -13,7 +13,7 @@ import org.threeten.bp.OffsetDateTime; /** - * Sample constants for the MCF (Multichannel Fulfillment) order processing recipes. + * Sample Payloads for the MCF (Multichannel Fulfillment) order processing recipes. * *

When adapting these for your own application, replace the placeholder values * marked with angle brackets (e.g., <recipient-name>) with real data.

@@ -31,6 +31,9 @@ public class McfConstants { public static final String SAMPLE_SELLER_FULFILLMENT_ORDER_ID = "MCF-TEST-ORDER-001"; + // -- Step 1: getFulfillmentPreview request body -------------------------------- + // Use this to check shipping speeds, estimated delivery dates, and fees before committing to an order. + /** * Build a sample getFulfillmentPreview request body. */ @@ -39,14 +42,14 @@ public static GetFulfillmentPreviewRequest samplePreviewRequest() { .name("") .addressLine1("") .city("") - .stateOrRegion("") - .postalCode("") + .stateOrRegion("") // e.g., "WA", "CA", "NY" + .postalCode("") // e.g., "98101" .countryCode("US"); GetFulfillmentPreviewItem item = new GetFulfillmentPreviewItem() - .sellerSku("MY-SKU-001") + .sellerSku("MY-SKU-001") // Your FBA-enrolled SKU .quantity(1) - .sellerFulfillmentOrderItemId("item-001"); + .sellerFulfillmentOrderItemId("item-001"); // Your unique line-item ID GetFulfillmentPreviewItemList itemList = new GetFulfillmentPreviewItemList(); itemList.add(item); @@ -54,8 +57,15 @@ public static GetFulfillmentPreviewRequest samplePreviewRequest() { return new GetFulfillmentPreviewRequest() .address(address) .items(itemList); + // Optional fields you may add: + // .shippingSpeedCategories(Arrays.asList(ShippingSpeedCategory.STANDARD, ShippingSpeedCategory.EXPEDITED, ShippingSpeedCategory.PRIORITY)) + // + // .featureConstraints(...) — Features can be BLANK_BOX or BLOCK_AMZL } + // -- Step 2: createFulfillmentOrder request body ------------------------------- + // Use this to actually submit the MCF order for fulfillment. + /** * Build a sample createFulfillmentOrder request body. */ @@ -69,27 +79,36 @@ public static CreateFulfillmentOrderRequest sampleCreateOrderRequest() { .countryCode("US"); CreateFulfillmentOrderItem item = new CreateFulfillmentOrderItem() - .sellerSku("MY-SKU-001") - .sellerFulfillmentOrderItemId("item-001") + .sellerSku("MY-SKU-001") // Must match an FBA-enrolled SKU + .sellerFulfillmentOrderItemId("item-001") // Your unique line-item ID .quantity(1); CreateFulfillmentOrderItemList itemList = new CreateFulfillmentOrderItemList(); itemList.add(item); return new CreateFulfillmentOrderRequest() - .sellerFulfillmentOrderId(SAMPLE_SELLER_FULFILLMENT_ORDER_ID) - .displayableOrderId("TEST-DISPLAY-001") - .displayableOrderDate(OffsetDateTime.parse("2026-03-27T00:00:00Z")) - .displayableOrderComment("MCF code recipe test order") - .shippingSpeedCategory(ShippingSpeedCategory.STANDARD) + .sellerFulfillmentOrderId(SAMPLE_SELLER_FULFILLMENT_ORDER_ID) // Your unique order ID (max 40 chars) + .displayableOrderId("TEST-DISPLAY-001") // Shown to the customer on packing slip + .displayableOrderDate(OffsetDateTime.parse("2026-03-27T00:00:00Z")) // Order date shown to customer + .displayableOrderComment("MCF code recipe test order") // Comment on packing slip + .shippingSpeedCategory(ShippingSpeedCategory.STANDARD) // STANDARD | EXPEDITED | PRIORITY .destinationAddress(address) .items(itemList); + // Optional fields you may add: + // .notificationEmails(Arrays.asList("customer@example.com")) + // .featureConstraints(...) — Features can be BLANK_BOX or BLOCK_AMZL + // .fulfillmentPolicy(FulfillmentPolicy.FILL_OR_KILL) + // FillOrKill - it's all-or-nothing, ideal when partial fulfillment isn't acceptable. + // FillAll - All fulfillable items are shipped. Any unfulfillable items remain open for the seller to decide. + // FillAllAvailable - All fulfillable items are shipped immediately. All unfulfillable items are automatically cancelled. } + // -- Step 2 (alternate): createFulfillmentOrder with Hold action --------------- + // Use this payload to create an order that is NOT shipped immediately. + // The order stays on hold until you call updateFulfillmentOrder with fulfillmentAction=Ship to release it. + /** * Build a sample createFulfillmentOrder request body with Hold action. - * The order is created but NOT shipped until you call updateFulfillmentOrder - * with fulfillmentAction=Ship to release it. */ public static CreateFulfillmentOrderRequest sampleCreateOrderRequestOnHold() { Address address = new Address() @@ -101,20 +120,20 @@ public static CreateFulfillmentOrderRequest sampleCreateOrderRequestOnHold() { .countryCode("US"); CreateFulfillmentOrderItem item = new CreateFulfillmentOrderItem() - .sellerSku("MY-SKU-001") - .sellerFulfillmentOrderItemId("item-001") + .sellerSku("MY-SKU-001") // Must match an FBA-enrolled SKU + .sellerFulfillmentOrderItemId("item-001") // Your unique line-item ID .quantity(1); CreateFulfillmentOrderItemList itemList = new CreateFulfillmentOrderItemList(); itemList.add(item); return new CreateFulfillmentOrderRequest() - .sellerFulfillmentOrderId(SAMPLE_SELLER_FULFILLMENT_ORDER_ID) - .displayableOrderId("TEST-DISPLAY-001") - .displayableOrderDate(OffsetDateTime.parse("2026-03-27T00:00:00Z")) - .displayableOrderComment("MCF code recipe test order - On Hold") - .shippingSpeedCategory(ShippingSpeedCategory.STANDARD) - .fulfillmentAction(FulfillmentAction.HOLD) + .sellerFulfillmentOrderId(SAMPLE_SELLER_FULFILLMENT_ORDER_ID) // Your unique order ID (max 40 chars) + .displayableOrderId("TEST-DISPLAY-001") // Shown to the customer on packing slip + .displayableOrderDate(OffsetDateTime.parse("2026-03-27T00:00:00Z")) // Order date shown to customer + .displayableOrderComment("MCF code recipe test order") // Comment on packing slip + .shippingSpeedCategory(ShippingSpeedCategory.STANDARD) // STANDARD | EXPEDITED | PRIORITY + .fulfillmentAction(FulfillmentAction.HOLD) // Hold = do not ship yet .destinationAddress(address) .items(itemList); } diff --git a/code-recipes/python/src/recipes/multichannel_fulfillment/fulfillment_outbound_v1/constants.py b/code-recipes/python/src/recipes/multichannel_fulfillment/fulfillment_outbound_v1/constants.py index ce275639..fdc2191a 100644 --- a/code-recipes/python/src/recipes/multichannel_fulfillment/fulfillment_outbound_v1/constants.py +++ b/code-recipes/python/src/recipes/multichannel_fulfillment/fulfillment_outbound_v1/constants.py @@ -1,5 +1,5 @@ """ -Sample constants for the MCF (Multichannel Fulfillment) order processing recipes. +Sample Payloads for the MCF (Multichannel Fulfillment) order processing recipes. These provide realistic sample payloads for the MCF workflows. When adapting these for your own application, replace the placeholder values marked with @@ -9,8 +9,8 @@ """ # -- Step 1: getFulfillmentPreview request body -------------------------------- -# Use this to check shipping speeds, estimated delivery dates, and fees -# BEFORE committing to an order. +# Use this to check shipping speeds, estimated delivery dates, and fees before committing to an order. + sample_preview_request = { "address": { "name": "", @@ -29,6 +29,13 @@ ], # Optional fields you may add: # "shippingSpeedCategories": ["Standard", "Expedited", "Priority"], + # + # "featureConstraints": [ + # { + # "featureName": "BLOCK_AMZL", # Features can be BLANK_BOX or BLOCK_AMZL + # "featureFulfillmentPolicy": "Required" + # } + # ] } @@ -57,19 +64,22 @@ ], # Optional fields you may add: # "notificationEmails": ["customer@example.com"], - # "featureConstraints": [{"featureName": "BLANK_BOX", "featureFulfillmentPolicy": "Required"}], + # "featureConstraints": [{"featureName": "BLANK_BOX", "featureFulfillmentPolicy": "Required"}], # Features can be BLANK_BOX or BLOCK_AMZL + # "fulfillmentPolicy": "FillOrKill" # FillorKill | FillAll | FillAllAvailable + # FillorKill - it's all-or-nothing, ideal when partial fulfillment isn't acceptable. + # FillAll - All fulfillable items are shipped. Any unfulfillable items remain open for the seller to decide. + # FillAllAvailable - All fulfillable items are shipped immediately. All unfulfillable items are automatically cancelled. } # -- Step 2 (alternate version for Hold orders): createFulfillmentOrder with Hold action --------------- # Use this payload to create an order that is NOT shipped immediately. -# The order stays on hold until you call updateFulfillmentOrder with -# fulfillmentAction=Ship to release it. +# The order stays on hold until you call updateFulfillmentOrder with "fulfillmentAction"="Ship" to release it. sample_create_order_request_on_hold = { - "sellerFulfillmentOrderId": "MCF-TEST-ORDER-001", - "displayableOrderId": "TEST-DISPLAY-001", - "displayableOrderDate": "2026-03-27T00:00:00Z", - "displayableOrderComment": "MCF code recipe test order - On Hold", - "shippingSpeedCategory": "Standard", + "sellerFulfillmentOrderId": "MCF-TEST-ORDER-001", # Your unique order ID (max 40 chars) + "displayableOrderId": "TEST-DISPLAY-001", # Shown to the customer on packing slip + "displayableOrderDate": "2026-03-27T00:00:00Z", # Order date shown to customer + "displayableOrderComment": "MCF code recipe test order", # Comment on packing slip + "shippingSpeedCategory": "Standard", # Standard | Expedited | Priority "fulfillmentAction": "Hold", # Hold = do not ship yet "destinationAddress": { "name": "", @@ -81,8 +91,8 @@ }, "items": [ { - "sellerSku": "MY-SKU-001", - "sellerFulfillmentOrderItemId": "item-001", + "sellerSku": "MY-SKU-001", # Must match an FBA-enrolled SKU + "sellerFulfillmentOrderItemId": "item-001", # Your unique line-item ID "quantity": 1, } ],