Player Saves API
Store and sync player progress data across all devices with automatic conflict resolution
Overview
Player Save System Features
Store any JSON data for players with automatic synchronization across all devices
📦 Core Features
- • Store any JSON data structure (game progress, settings, achievements)
- • Automatic versioning with optimistic concurrency control
- • Cross-platform device synchronization
- • Offline support with automatic sync when online
- • Built-in conflict resolution for concurrent saves
- • JSON data with UTF-8 text encoding
- • Automatically compressed for transfer
Load Player Save Data
GET /v1/player/save
Retrieve the current player save data with version information
HTTP Request Example
Response Format
Save Player Data
PUT /v1/player/save
Update player save data with automatic conflict resolution
HTTP Request Example
Successful Response
Conflict Resolution
Handling Concurrent Saves
What happens when multiple devices try to save simultaneously
Conflict Response (HTTP 409)
🔄 Automatic SDK Resolution
The StatPotion SDK automatically handles most conflicts by:
- • Fetching the latest server version
- • Merging non-conflicting changes
- • Retrying the save operation
- • Notifying your game of any issues
🎮 Manual Resolution Strategy
For complex data conflicts, implement custom logic:
- • Show player a merge interface
- • Prioritize local vs server data
- • Implement last-write-wins policy
- • Create conflict resolution UI
SDK Integration Examples
Save & Load with StatPotion SDKs
Simple integration examples for Unity and Godot
Complete Save & Load Examples
Troubleshooting Common Issues
Problem: Save data not syncing between devices
Solution: Ensure players are using the same authentication method (device ID or account) on both devices.
// Verify same player ID on both devices
console.log("Player ID:", await StatPotion.getPlayerId());Problem: Frequent conflict errors
Solution: Player is saving from multiple devices simultaneously. Implement proper conflict resolution or save less frequently.