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
Expand Up @@ -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.
*
* <p>When adapting these for your own application, replace the placeholder values
* marked with angle brackets (e.g., &lt;recipient-name&gt;) with real data.</p>
Expand All @@ -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.
*/
Expand All @@ -39,23 +42,30 @@ public static GetFulfillmentPreviewRequest samplePreviewRequest() {
.name("<recipient-name>")
.addressLine1("<address-line-1>")
.city("<city>")
.stateOrRegion("<state>")
.postalCode("<postal-code>")
.stateOrRegion("<state>") // e.g., "WA", "CA", "NY"
.postalCode("<postal-code>") // 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);

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.
*/
Expand All @@ -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()
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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": "<recipient-name>",
Expand All @@ -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"
# }
# ]

}

Expand Down Expand Up @@ -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": "<recipient-name>",
Expand All @@ -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,
}
],
Expand Down
Loading