DataFactory Testing
Testing and simulation utility for validating integrations in sandbox environment
DataFactory Testing API
DataFactory is MasonHub’s powerful testing and simulation utility that allows you to trigger various OMS actions and callbacks in the sandbox environment. This comprehensive tool helps you test integration workflows, simulate real-world scenarios, and validate your system behavior before production deployment.
DataFactory is only available in the sandbox environment. Use it to test integrations thoroughly before deploying to production.
Overview
DataFactory provides comprehensive testing capabilities:
Inventory Simulation
Simulate inventory changes, receipts, and adjustments with realistic scenarios
Order Fulfillment
Trigger order shipping, multi-shipments, shorts, and delivery events
Callback Testing
Generate all callback types to test webhook handling
Workflow Validation
Test complete end-to-end integration workflows
Inventory Operations
Create Available Inventory
Simulate inventory receipts and additions for testing purposes.
UUID of the SKU to add inventory for
Amount of inventory to add
Specific inventory location UUID
Lot/batch number for traceability
Expiration date for perishable items
This operation will:
- Add inventory in ‘available’ status
- Trigger skuInventoryChange callbacks
- Update total available-to-sell quantities
Simulate Inventory Loss
Simulate inventory adjustments for damaged, lost, or spoiled items.
UUID of the SKU to adjust inventory for
Amount of inventory to remove
Reason for inventory loss (damage, theft, spoilage, etc.)
Order Fulfillment Simulation
Ship Orders
Simulate order shipments to test fulfillment workflows and callbacks.
Customer order identifier to ship
Carrier for shipment (UPS, FedEx, etc.)
Service level (ground, express, overnight)
Simulate short shipments (partial fulfillment)
Custom tracking number for testing
Simple order shipment with standard carrier and service level
Callback Testing
Trigger Specific Callbacks
Parameters
Field | Type | Description |
---|---|---|
order_customer_id | string | Customer order identifier |
shorts | array | SKU identifiers to simulate shortages |
number_of_shipments | integer | Number of shipments to create (1-5) |
shipping_provider | string | Carrier simulation (UPS, FedEx, USPS) |
randomize_tracking | boolean | Generate random tracking numbers |
Delivery Events
Available Events
tendered
Package tendered to carrier - initial scan
inTransit
Package in transit with location updates
outForDelivery
Package out for delivery on delivery vehicle
delivered
Package successfully delivered
undeliverable
Package undeliverable - return to sender
Order Management Operations
Resolve Update Requests
Resolve Cancel Requests
Inbound Shipment Simulation
Receiving Events
Event Types
onDock: Shipment arrived at facility dock
receivingStarted: Warehouse team started processing
receivingCompleted: All items processed and put away
Randomized Status Distribution
When randomize_inventory_statuses
is enabled:
Available (70%)
Items received in good condition, ready for sale
Quality Control (15%)
Items requiring inspection before availability
Damaged (10%)
Items received with damage requiring disposition
Refurbishing (3%)
Items requiring repair or refurbishment
Under Investigation (2%)
Items with unclear status requiring investigation
Returns Management (RMA)
RMA Processing Events
RMA Event Types
tendered
Return package tendered to carrier by customer
inTransit
Return package in transit to facility
delivered
Return package delivered to facility
receiveFull
All expected items received and processed
receivePartial
Only some expected items received
Testing Workflows
Basic Integration Test
Setup Test Data
Create Test Orders
Simulate Fulfillment
Verify Callbacks
Monitor webhook endpoints for expected callbacks
Advanced Scenario Testing
Callback Validation
Expected Callback Events
DataFactory operations trigger production-equivalent callbacks:
Inventory Events
skuInventoryChange: After createAvailable, loseInventory
snapshotReady: Not triggered by DataFactory
Order Events
orderEvent: After shipOrder, delivery events
orderUpdateResolution: After resolveOrderUpdate
orderCancelResolution: After resolveOrderCancel
Fulfillment Events
inboundShipmentEvent: After inbound simulations
shipmentEvent: After shipping operations
Returns Events
rmaEvent: After RMA simulations
qualityEvent: During randomized processing
Callback Testing Strategy
Performance Testing
Load Testing with DataFactory
Best Practices
Test Data Management
Consistent Identifiers
Use predictable, test-specific IDs to avoid conflicts with other tests
Data Isolation
Separate test scenarios to prevent interference between test runs
State Management
Reset test state between runs for consistent results
Documentation
Document test scenarios and expected outcomes
Integration Testing Strategy
- Start Simple: Begin with basic CRUD operations
- Add Complexity: Gradually introduce complex scenarios
- Test Edge Cases: Validate error conditions and edge cases
- Performance Testing: Test with realistic data volumes
- End-to-End Validation: Test complete business workflows
Limitations & Considerations
Sandbox Only: DataFactory is not available in production environments
Test Data: Creates simulated data that doesn’t reflect real inventory or order states
- Rate Limits: Standard API rate limits apply to DataFactory operations
- State Consistency: Maintains sandbox state consistency but may not match production patterns
- Timing: Events are triggered immediately, not following real-world timing patterns
Next Steps
After using DataFactory for testing, explore:
- Callback Configuration for webhook setup
- Authentication for security testing
- Order Management for production order handling