ForSURE.orders_data.fulfilment
Fulfilment Module
Overview
The fulfilment module manages packaging and fulfilment data for orders. It tracks packaging dimensions, weights, box IDs, and other fulfilment-related information that is essential for compliance reporting and logistics management.
Features
Fulfilment Management Capabilities
Retrieve Fulfilment Data
- Paginated fulfilment retrieval with configurable page sizes
- Advanced filtering by date range, search terms, and data source
- Results grouped by order ID for easy navigation
- Free-text search across all string columns
Bulk Upload from Files
- Upload fulfilment data from CSV or Excel files
- Background processing for large file uploads
- Profile-based column mapping for flexible file formats
- Support for multiple file uploads in a single operation
Fulfilment Algorithm
- Apply custom fulfilment algorithms to determine optimal packaging
- Automatically calculate packaging based on order contents and weights
- Integration with categorylist for available box types
- Requires special access attribute for custom algorithm execution
File Validation
- Pre-upload validation to catch errors early
- Column mapping verification against configured profiles
- Data format checking and validation
- Detailed error reporting for troubleshooting
Data Model
Fulfilment Fields
Key Fields:
orderid(str): Order identifier (primary key)dimension(str): Package dimensions in format "HxWxD"fulfilmentday(datetime): Fulfilment datetotal_weight(float): Total weight of the packagemain_type(str): Main packaging typemain_type_weight(float): Weight of main packaging typebox_id(str): Box identifier (maps to categorylist SKU)source(str): Source/file nameprofile(int): Profile ID for column mappingerror(str): Error message if processing failed
Fulfilment Algorithm
The fulfilment algorithm can automatically determine optimal packaging for orders based on:
- Order contents and weights
- Available box types from categorylist
- Custom fulfilment rules (if user has access)
Access Control
To run custom fulfilment algorithms, users need the access-fulfilment-algorithm attribute.
Usage Examples
Retrieving Fulfilment Data
Fulfilment data can be retrieved with pagination and filtering options including date ranges, search terms, and source filtering. Results are grouped by order ID.
Uploading Fulfilment from Files
Bulk uploads support CSV and Excel formats with profile-based column mapping. Multiple files can be uploaded simultaneously, each with its own profile and source identifier.
Running Fulfilment Algorithm
The fulfilment algorithm can be executed for specific orders to automatically determine optimal packaging based on order contents, weights, and available box types from the categorylist.
Permissions
- ORDERS_VIEW: Required to retrieve fulfilment data
- ORDERS_ADD: Required to upload fulfilment or run algorithms
Best Practices
- Validate files using the validation endpoint before uploading
- Ensure box_id mapping to categorylist for proper categorization
- Use consistent dimension format (HxWxD)
- Track sources using fileId for data lineage
- Run algorithms after uploading fulfilment data for optimal packaging
Integration
The fulfilment module integrates with:
- Orders: Links fulfilment to order data
- Categorylist: Maps box_id to product catalog
- Manual Changes: Supports manual corrections
- Reports: Provides packaging data for compliance reporting
File Upload Process
- Validation: Files are validated synchronously
- Processing: Valid files are processed in the background
- Algorithm Application: Custom algorithms can be applied if enabled
- Error Handling: Errors are reported per file
Response Format
Paginated Fulfilment Response
{
"items": [...],
"source_names": ["source1", "source2"],
"total": 150,
"limit": 50,
"offset": 0,
"next_offset": 50,
"prev_offset": null
}
Algorithm Run Response
{
"status_code": 200
}
Dimension Format
Dimensions should be provided in the format: "HxWxD" where:
- H = Height
- W = Width
- D = Depth
Example: "10x20x15" represents 10cm height, 20cm width, 15cm depth.