# Import: JSON

> Create a data contract by inferring a schema from a JSON data file.

#  Import: JSON

Creates a data contract by inferring the schema from a JSON data file.

{/* AUTOGENERATED EXAMPLE: do not edit by hand; regenerate with the update script. */}

Given this [`orders.json`](https://github.com/datacontract/datacontract-cli/blob/main/examples/imports/json/orders.json):

```json
{
  "order_id": "ORD-1001",
  "order_timestamp": "2024-01-01T10:00:00Z",
  "customer_id": "CUST-1",
  "order_total": 4999,
  "status": "delivered"
}
```

Run:

```bash
datacontract import json --source orders.json
```

to produce the data contract:

```yaml
version: 1.0.0
kind: DataContract
apiVersion: v3.1.0
id: my-data-contract
name: My Data Contract
status: draft
servers:
- server: production
  type: local
  format: json
  path: examples/imports/json/orders.json
schema:
- name: orders
  physicalType: object
  description: Generated from JSON object in examples/imports/json/orders.json
  logicalType: object
  physicalName: orders
  properties:
  - name: order_id
    physicalType: string
    logicalType: string
    examples:
    - ORD-1001
  - name: order_timestamp
    physicalType: string
    logicalType: string
    logicalTypeOptions:
      format: date-time
    examples:
    - '2024-01-01T10:00:00Z'
  - name: customer_id
    physicalType: string
    logicalType: string
    examples:
# …
```

{/* END AUTOGENERATED EXAMPLE */}

All options: **[`datacontract import json`](../commands/import/json.md)**.
