How can I export and import ID property as json? (to make preset file)
This code get some data from Blender scene, save them as Python dict and write a JSON file. Then read that file and uses the inner data:

import bpy
import json
import os

# 1 - Export data as JSON file

# dict with all your data
dict = {
    "name": "Cube 1",
    "material": "Cube MAT"
}

# encode dict as JSON 
data = json.dumps(dict, indent=1, ensure_ascii=True)

# set output path and file name (set your own)
save_path = 'E:\\'
file_name = os.path.join(save_path, "export_data.json")

# write JSON file
with open(file_name, 'w') as outfile:
    outfile.write(data + '\n')


# 2 - Import data from JSON file

# read JSON file
with open(file_name, 'r') as fp:
    data_file = json.load(fp)

# get data
cube_name = data_file['name']
cube_material = data_file['material']

print(cube_name + ', ' + cube_material)