- Inventory
- Request Full Snapshot
Inventory
Request Full Snapshot
Initiate an asynchronous full inventory snapshot for large datasets
curl --request POST \
--url https://sandbox.masonhub.co/dragonfly-cosmetics-demo/api/v1/snapshot_request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"snapshot_type": "<string>",
"snapshot_as_of_date": "<string>"
}'Initiate an asynchronous full inventory snapshot job for large datasets. This is ideal for initial synchronization, bulk operations, or historical point-in-time inventory analysis.
Full snapshots are processed asynchronously. The system will send a SnapshotReady callback when the snapshot is complete with download links.
Request Body
Type of snapshot to generate. Currently only "full" is supported.
Point-in-time for the snapshot in RFC3339 format. If omitted, the current time is used.
curl -X POST "https://app.masonhub.co/{account}/api/v1/snapshot_request" \
-H "Authorization: Bearer your_jwt_token" \
-H "Content-Type: application/json" \
-d '{
"snapshot_type": "full",
"snapshot_as_of_date": "2019-08-05T08:15:30-07:00"
}'
{
"snapshot_request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"estimated_completion": "2019-08-05T08:20:30-07:00"
}
Asynchronous Processing
Submit Request
Send POST request to initiate the snapshot job
Receive Confirmation
API returns snapshot_request_id and estimated completion time
Process Snapshot
MasonHub processes the snapshot asynchronously in the background
Receive Callback
SnapshotReady callback is sent when the snapshot is complete
Download Data
Use the download URL from the callback to retrieve the snapshot data
SnapshotReady Callback
When the snapshot is ready, you’ll receive a callback:
{
"callback_url": "https://client.com/api/snapshot_ready",
"message_type": "SnapshotReady",
"message_id": "f68870ed-d5dc-48g0-c81b-489b0c96bfbf",
"data": {
"snapshot_request_id": "550e8400-e29b-41d4-a716-446655440000",
"snapshot_type": "full",
"snapshot_as_of_date": "2019-08-05T08:15:30-07:00",
"status": "complete",
"download_url": "https://storage.masonhub.co/snapshots/550e8400.json",
"download_url_expires_at": "2019-08-06T08:15:30-07:00",
"record_count": 15420,
"file_size_bytes": 2548000
}
}
Download URLs are temporary and will expire. Download the snapshot data promptly after receiving the callback.
Use Cases
Initial Sync
Use full snapshots when first integrating with MasonHub to get complete inventory state.
Bulk Reconciliation
Periodically reconcile your inventory records with a full snapshot.
Historical Analysis
Request point-in-time snapshots for historical inventory analysis using snapshot_as_of_date.
Disaster Recovery
Use snapshots as part of your backup and recovery strategy.
Best Practices
curl -X POST "https://app.masonhub.co/{account}/api/v1/snapshot_request" \
-H "Authorization: Bearer your_jwt_token" \
-H "Content-Type: application/json" \
-d '{
"snapshot_type": "full",
"snapshot_as_of_date": "2019-08-05T08:15:30-07:00"
}'
curl --request POST \
--url https://sandbox.masonhub.co/dragonfly-cosmetics-demo/api/v1/snapshot_request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"snapshot_type": "<string>",
"snapshot_as_of_date": "<string>"
}'{
"snapshot_request_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"estimated_completion": "2019-08-05T08:20:30-07:00"
}