Reorder Customer Order
About
The reorderOrder mutation allows authenticated customers to quickly re-add items from a previous order to their cart. This enables:
- One-click reordering of frequently purchased items
- Convenient replenishment of consumables or recurring purchases
- Enhanced customer experience by reducing re-selection friction
- Support for reordering from any order status (pending, completed, shipped, canceled, etc.)
When items are reordered:
- Items are added to the customer's current/active cart
- Out-of-stock or unavailable items are silently skipped
- The mutation succeeds if at least one item is added
- Item quantities, prices, and options are preserved from the original order
- Inventory is decremented as normal for new cart items
Use this feature to:
- Enable "Quick Reorder" buttons in order history pages
- Support one-click replenishment ordering
- Improve customer retention through convenient purchasing
- Reduce cart abandonment for repeat purchases
- Implement "Frequently Reordered" sections
Authentication
This mutation requires customer authentication:
- Authenticated customers: Provide a valid customer authentication token in the
Authorizationheader. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>
X-STOREFRONT-KEY: <storefrontKey>Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
input.orderId | Int! | ✅ Yes | The numeric ID of the order to reorder items from. |
Possible Returns
| Field | Type | Description |
|---|---|---|
success | Boolean! | true if at least one item was added to cart, false if no items could be added. |
message | String! | Human-readable message with outcome (number of items added, reasons for failures, etc.). Localized. |
orderId | Int! | The numeric ID of the source order. |
itemsAddedCount | Int! | Number of items successfully added to the cart. |
Business Logic
- Authentication Check: Verifies customer is logged in
- Ownership Validation: Ensures order belongs to the authenticated customer
- Item Iteration: Loops through each item in the order
- Availability Check: For each item:
- Verifies product still exists
- Checks if item is purchasable
- Validates stock availability
- Add to Cart: Calls cart add-to-cart logic for available items
- Silent Failure: Items that can't be added are skipped without error
- Success Response: Returns count of successfully added items
- Inventory Update: Stock is decremented for each item added
Success Scenarios
| Scenario | Success? | itemsAddedCount | Notes |
|---|---|---|---|
| All 5 items available | ✅ Yes | 5 | Complete reorder |
| 3 of 5 items available | ✅ Yes | 3 | Partial reorder (2 out of stock) |
| Only 1 item available | ✅ Yes | 1 | Single item reorder |
| No items available | ❌ No | 0 | All items discontinued/out of stock |
Error Handling
Order Not Found
{
"errors": [
{
"message": "Order not found (ID: 99999)",
"extensions": {
"category": "user_error"
}
}
]
}Cause: Order ID doesn't exist or belongs to another customer
Solution: Verify the order ID and ensure it belongs to the authenticated customer
No Items Could Be Added
{
"data": {
"reorderOrder": {
"success": false,
"message": "No items were added to cart. All items are out of stock or unavailable.",
"orderId": 5,
"itemsAddedCount": 0
}
}
}Cause: All items in the order are out of stock, discontinued, or unavailable
Solution: Check product availability. Some items may have been discontinued or removed from the catalog.
Unauthenticated Request
{
"errors": [
{
"message": "Unauthenticated",
"extensions": {
"category": "authentication"
}
}
]
}Cause: Missing or invalid Bearer token
Solution: Login and provide a valid customer authentication token
Use Cases
Quick Replenishment
Customer frequently reorders the same items:
mutation {
createReorderOrder(input: { orderId: 5 }) {
reorderOrder {
success
message
itemsAddedCount
}
}
}Result: 3 items (coffee, tea, sugar) added to cart in one click
Check Availability Before Purchase
query {
order(id: 42) {
id
items {
productId
name
quantity
}
}
}
mutation {
createReorderOrder(input: { orderId: 42 }) {
reorderOrder {
itemsAddedCount
}
}
}Then proceed to checkout if itemsAddedCount > 0
Reorder with Cart Updates
Customer adds new items, then reorders previous favorites:
mutation {
addToCart(input: { productId: 10, quantity: 2 }) {
success
}
createReorderOrder(input: { orderId: 15 }) {
reorderOrder {
success
itemsAddedCount
}
}
}Result: New items + previously ordered items in single cart
Notes
- Order Status Agnostic: Items can be reordered from any order status (pending, completed, shipped, canceled, etc.)
- Partial Reorder: If some items are unavailable, operation succeeds with those available
- Pricing Update: Current prices from the catalog are used (not original order prices)
- Inventory Decremented: Reordered items follow normal inventory management rules
- No Special Pricing: Promotions/discounts from original order are not automatically applied
- Customer Isolation: Customers cannot reorder other customers' orders
- Localization: All messages are localized to the customer's language
- Bundled Products: Bundles and configurable products are handled gracefully
Implementation Details
Reorder Behavior
| Item Type | Behavior |
|---|---|
| Simple product | Added with same quantity |
| Configurable product | Added with same options/attributes |
| Bundle product | Added with same bundle configuration |
| Grouped product | Added with same selections |
| Out of stock | Silently skipped, not added |
| Discontinued | Silently skipped, not added |
| Not purchasable | Silently skipped, not added |
Inventory Management
- Reordered items consume inventory normally
- Stock is reserved for the active cart
- No special reservation or hold period
- Stock can run out between reorder and checkout
Related Resources
- Get Customer Orders — Query orders to enable reorder buttons
- Get Customer Order — Query a specific order details
- Get Cart — Check cart after reorder
- Add to Cart — Manual item addition
- Cancel Customer Order — Cancel orders
- Customer Login — Obtain authentication token
- Place Order — Checkout after reorder

