1. Inventory
  2. Request Full Snapshot
POST
/snapshot_request
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

snapshot_type
required
string

Type of snapshot to generate. Currently only "full" is supported.

snapshot_as_of_date
string

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

1

Submit Request

Send POST request to initiate the snapshot job

2

Receive Confirmation

API returns snapshot_request_id and estimated completion time

3

Process Snapshot

MasonHub processes the snapshot asynchronously in the background

4

Receive Callback

SnapshotReady callback is sent when the snapshot is complete

5

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

​
Best Practices