- Ordering
Order returns
OrderCloud provides comprehensive features for managing the complete order return process. This functionality enables businesses to handle returns, refunds, and related workflows while maintaining flexibility for different business requirements.
Key features
Return structure
- Each
OrderReturnlinks to an existingOrder ItemsToReturnconnects to existingLineItems- No minimum requirements for items or quantities
- Supports physical and non-physical returns
Flexible refund options
- Process returns without physical items
- Handle partial refunds for:
- Expedited shipping charges
- Processing delays
- Damaged items
- Service adjustments
Access control
-
Shopperrole users:- Create returns for their orders (
Order.FromUserID) - Limited to their own transactions
- Cannot process anonymous returns
- Create returns for their orders (
-
OrderAdminrole users:- Create returns for visible orders based on scope:
- Marketplace Owners: All marketplace orders
- Suppliers: Orders placed to them (
Order.ToCompanyID) - Buyer users: Company orders (
Order.FromCompanyID)
- Create returns for visible orders based on scope:
Order requirements
- Status must be
OpenorCompleted - For
Openorders:- Only shipped items eligible
- Quantity restrictions based on shipment status
Policy management
- Implement date-based return policies through:
- User interface controls
SellerApprovalRulesconfiguration- Custom validation rules

OrderReturn resource
Core model for managing returns:
Item return details:
API endpoints
Return management:
GET v1/orderreturns(supportsapprovablefilter for pending approvals)GET v1/orderreturns/{returnID}POST v1/orderreturnsPUT v1/orderreturns/{returnid}PATCH v1/orderreturns/{returnid}DELETE v1/orderreturns/{returnid}
Item management:
DELETE v1/orderreturns/{returnid}/items/{lineitemid}- Create/update items via OrderReturn endpoints
Status management:
POST v1/orderreturns/{returnid}/submitPOST v1/orderreturns/{returnid}/approvePOST v1/orderreturns/{returnid}/declinePOST v1/orderreturns/{returnid}/cancelPOST v1/orderreturns/{returnid}/complete
Approval management:
GET v1/orderreturns/{returnID}/approvalsGET v1/orderreturns/{returnID}/eliglbleapprovers
Important notes
Required fields:
OrderIDon OrderReturnLineItemIDon ItemsToReturn
Refund handling:
OrderReturn.RefundAmount: Automatically calculated as sum of ItemsToReturn RefundAmountsOrderAdminusers can set RefundAmount directly when no items are returned- Supports partial and full refunds
SellerApprovalRule resource
Configuration model for return approval rules:
API endpoints
Rule management:
GET v1/approvalrulesGET v1/approvalrules/{ruleID}POST v1/approvalrulesPUT v1/approvalrules/{ruleID}PATCH v1/approvalrules/{ruleID}DELETE v1/approvalrules/{ruleID}
Important notes
Access control:
- Not available to buyer users
OwnerIDidentifies rule owner organization- Only Marketplace Owner can set other organization IDs
- Used for ApprovingGroupID lookup and admin eligibility
Date-based rules:
-
Uses
now()function for time-based policies -
Example: 30-day return window
-
Can combine with UI validation
Current support:
OrderReturntype only- Future expansion planned for Order Approvals
OrderReturn integration event
OrderCloud provides integration flexibility for refund calculations, recognizing that businesses may have complex requirements involving:
- Tax adjustments
- External system synchronization
- Custom calculation rules
- Business-specific policies
OrderCloud payload
Expected response
Integration notes
Implementation:
- Endpoint:
/calculateorderreturnatCustomImplementationUrl - Internal OrderCloud call on return creation/update
- Middleware updates must wait for response completion
Execution rules:
- Skipped if
OrderAdminprovides valid refund amounts - Sets null refunds if no integration event for
Shopperrole - Supports custom calculation logic
Message sender types
Notification events:
OrderReturnSubmittedOrderReturnApprovedOrderReturnDeclinedOrderReturnCompletedOrderReturnSubmittedForApprovalOrderReturnSubmittedForYourApprovalOrderReturnSubmittedForYourApprovalHasBeenApprovedOrderReturnSubmittedForYourApprovalHasBeenDeclined
Note: For marketplace owner assignment, leave both BuyerID and SupplierID null
Additional properties
Payment.OrderReturnID
- Links payments to OrderReturn.PaymentIDs
- Enforces refund limits:
- Cannot exceed Order.Total
- Cannot exceed OrderReturn refund amount
- Requires negative Payment.Amount for refunds
- Automatically completes OrderReturn when refund amounts match
Product.Returnable
- Controls product return eligibility
- Restricts non-OrderAdmin users based on setting
- Supports product-level return policies
ApiClient.OrderReturnIntegrationEventID
- Enables integration event for return processing
- Triggers on return creation and updates
- Supports custom calculation logic
System maintenance
Cleanup process:
- Targets unsubmitted returns
- Deletes after 14 days without updates
- Maintains system efficiency
Order returns - Handling calculations
OrderCloud provides flexibility in calculating refund amounts for product returns. This guide explains key considerations and implementation approaches.
Integration event
The OrderReturn Integration Event triggers when an OrderReturn is created or updated without a specified RefundAmount. The event includes the order worksheet.
Order worksheet importance
The OrderWorksheet provides essential data for refund calculations. Store tax, shipping, and promotion data during order calculation for accurate refund processing.
Storing calculation data
Store calculation values in OrderWorksheet.OrderCalculateResponse.xp during checkout (POST v1/orders/{direction}/{orderID}/calculate). Example calculation object:
Calculation considerations
Order totals
- Track line items, shipping, promotions, and tax effects
- Handle tax-exempt items
- Apply line item and order-level promotions
- Calculate taxable subtotals
Taxes and promotions
- Handle order-level promotion distribution
- Apply line item promotions before tax calculation
- Consider tax service capabilities for promotion handling
Shipping
- Track multiple shipment costs
- Calculate shipping tax per shipment
- Handle partial shipping refunds
Return calculation types
Use OrderReturn.xp.ReturnType to route returns to appropriate calculation methods.
Standard return invoicing
Recommended approach using tax services:
- Creates return invoices
- Handles complex tax calculations
- Manages partial returns
- Ensures accurate tax distribution
Example return response:
Custom returns
Handle special cases with extended properties:
Return types:
- Shipping refunds
- Tax adjustments
- Discretionary refunds
Amount types:
- Fixed amounts
- Percentage-based refunds
Using order returns for product returns, refunds, and credits
OrderCloud's order returns feature enables digital return experiences for both customers and administrators. This guide demonstrates various return and refund scenarios using OrderReturns.
Example order
Consider this sample order:
- LineItem 1: 1 qty - Athletic Shoes, size 8.5
- LineItem 2: 4 qty - Socks
- LineItem 3: 1 qty - Customized sports jersey (Customer's name printed)
- LineItem 4: 2 qty - Joggers, size 10
Order breakdown:
| Line | Product | Qty | Price | Total | Tax |
|---|---|---|---|---|---|
| 1 | Athletic Shoes, Size 8.5 | 1 | $75 | $75 | $5.54 |
| 2 | Socks | 4 | $10 | $40 | $3.01 |
| 3 | Customized Sports Jersey | 1 | $100 | $100 | $7.53 |
| 4 | Joggers, Size 10 | 2 | $50 | $100 | $7.53 |
| Shipping | $10 | $10 | $0.68 | ||
| Subtotal | $315.00 | ||||
| Shipping | $10.00 | ||||
| Tax | $24.29 | ||||
| Total | $349.29 |
Return scenarios
Standard item return
Customer received items 1, 2, and 3, and requests returns for:
- Shoes (too small)
- One pair of socks (excess quantity)
Notes:
- Item 4 unavailable for return (not shipped)
- Item 3 unavailable for return (
Product.Returnable = False)
Return calculation:
| Line | Product | Qty Ordered | Qty Delivered | Return Qty | Price | Refund (Product + Tax) |
|---|---|---|---|---|---|---|
| 1 | Athletic Shoes | 1 | 1 | 1 | $75 | $80.54 |
| 2 | Socks | 4 | 4 | 1 | $10 | $10.75 |
| 3 | Jersey | 1 | 1 | N/A | $100 | - |
| 4 | Joggers | 2 | 0 | N/A | $50 | - |
| Shipping | - | $10 | - | |||
| Subtotal | $85.00 | |||||
| Tax | $6.29 | |||||
| Total | $91.29 |
Example return request:
Shipping refund
For late deliveries, process shipping refunds:
| Line | Product | Qty Ordered | Qty Delivered | Return Qty | Price | Refund |
|---|---|---|---|---|---|---|
| 4 | Joggers | 2 | 2 | Late delivery | $50 | - |
| Shipping | Full refund | $10 | $10.68 | |||
| Subtotal | $10.00 | |||||
| Tax | $0.68 | |||||
| Total | $10.68 |
Example shipping refund request:
Price match refund
For price matching within 2 weeks of purchase:
| Line | Product | Qty | Price | Competitor Price | Refund |
|---|---|---|---|---|---|
| 4 | Joggers | 2 | $50 | $45.99 | $8.02 (2 @ $4.01) |
Customer service refund
For general customer satisfaction:
Implementation flexibility
OrderCloud provides flexibility in:
- Return policies
- Refund calculations
- Process workflows
- Resource customization