Describe your fields in JSON Schema (up to 200 properties and 100 field rules) and parserkit returns exactly those, checked where the math allows: $0.02 a page, 50 pages free on new accounts.

Custom schemas

Send your schema inline and parserkit fills exactly those fields, with the totals checked, for $0.02 a page. Below, a 9-field schema reads a 1-page print shop invoice. You can also clean values with field rules, save and version schemas, or draft one from a sample document.

Updated

Send a schema with the parse

Send schema, a JSON Schema, instead of preset on POST /v1/parse, with optional field_rules. parserkit returns only the fields your schema defines. A custom schema costs the same as a preset: $0.02 a page, with 50 pages free from the $1 credit on new accounts.

POST/v1/parseParse with your own schema
curl https://api.parserkit.com/v1/parse \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "file_url": "https://raw.githubusercontent.com/bitgate/parserkit-samples/master/invoice-fernhill-1004.pdf",
  "schema": {
    "type": "object",
    "properties": {
      "supplier": {
        "type": "string",
        "description": "Who sent the invoice"
      },
      "invoice_number": {
        "type": "string"
      },
      "invoice_date": {
        "type": "string",
        "format": "date"
      },
      "po_number": {
        "type": "string",
        "description": "Our purchase order number"
      },
      "line_items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "number"
            },
            "unit_price": {
              "type": "number"
            },
            "total": {
              "type": "number"
            },
            "category": {
              "type": "string",
              "enum": [
                "print",
                "design",
                "other"
              ]
            }
          }
        }
      },
      "subtotal": {
        "type": "number"
      },
      "tax_total": {
        "type": "number"
      },
      "grand_total": {
        "type": "number"
      },
      "currency": {
        "type": "string",
        "format": "currency"
      }
    },
    "required": [
      "supplier",
      "invoice_number",
      "grand_total"
    ]
  }
}'
200 OKLive response, Nov 7, 2026
request-id: a569226a6e4f1901
{
  "id": "job_sq8ehlv2i7tu93rz3rpm",
  "status": "succeeded",
  "mode": "parse",
  "preset": null,
  "schema_id": null,
  "pages": 1,
  "cost_usd": 0.02,
  "verification_status": "verified",
  "data": {
    "supplier": "Fernhill Print Co.",
    "invoice_number": "FP-1004",
    "invoice_date": "2026-10-30",
    "po_number": "CS-PO-2240",
    "line_items": [
      {
        "description": "Business cards, 350 gsm matte, two-sided",
        "quantity": 750,
        "unit_price": 0.16,
        "total": 120,
        "category": "print"
      },
      {
        "description": "A2 posters, satin, full color",
        "quantity": 60,
        "unit_price": 6.25,
        "total": 375,
        "category": "print"
      },
      {
        "description": "Tri-fold brochures, 100 lb gloss",
        "quantity": 2500,
        "unit_price": 0.38,
        "total": 950,
        "category": "print"
      },
      {
        "description": "Design proof and color check (hours)",
        "quantity": 3,
        "unit_price": 45,
        "total": 135,
        "category": "design"
      }
    ],
    "subtotal": 1580,
    "tax_total": 163.53,
    "grand_total": 1743.53,
    "currency": "USD"
  },
  "verification": {
    "status": "verified",
    "math_balanced": true,
    "coverage": {
      "values": 24,
      "checked": 24
    },
    "checks": [
      {
        "kind": "line_total",
        "path": "line_items[0].total",
        "fields": [
          "line_items[0].quantity",
          "line_items[0].unit_price",
          "line_items[0].total"
        ],
        "status": "pass",
        "expected": 120,
        "actual": 120,
        "difference": 0,
        "page": 1,
        "message": "quantity x unit price"
      },
      {
        "kind": "line_total",
        "path": "line_items[1].total",
        "fields": [
          "line_items[1].quantity",
          "line_items[1].unit_price",
          "line_items[1].total"
        ],
        "status": "pass",
        "expected": 375,
        "actual": 375,
        "difference": 0,
        "page": 1,
        "message": "quantity x unit price"
      }
    ],
    "repairs": [],
    "barcodes": []
  }
}

Trimmed: outputs and documents are left out, and 2 of the 6 checks are shown.

This 1-page print shop invoice used a 9-field schema with line items. The job cost $0.02 and came back verified, with 24 of 24 values checked and 6 checks passed. Arithmetic checks run automatically when your schema matches the shape of a known document: line_items with grand_total or amount_due for an invoice, items with total for a receipt, or transactions with opening_balance or closing_balance for a bank statement.

What a schema may use

parserkit accepts a fixed subset of JSON Schema keywords and formats.

JSON Schema keywords
KeywordNotes
typeThe JSON type, or a list such as ["string", "null"] for a value that may be missing.
properties, required, additionalPropertiesShape objects.
itemsShape the rows of an array.
descriptionGoes to the model with the field. Use it for names that could mean several things.
titleAllowed. Only description reaches the model.
enumUp to 500 numbers, booleans, nulls or strings of up to 200 characters.
formatdate, date-time, time, currency, country, email, uri or iban.
minimum, maximumBounds for numbers.
readOnlyThe model leaves the field empty.

Write a clear description for any field name that could mean several things, because parserkit sends description to the model along with the field. Property names cannot start with $.

Schema limits
LimitValue
Nesting depth6
Properties200
Schema size64 KB of UTF-8 JSON
enum values500, strings up to 200 characters
Field rules100
GL accounts500
Schema name1 to 100 characters
DescriptionUp to 1,000 characters

Clean values with field rules

Field rules clean a value after extraction and run in the order you list them. The exception is instruction: its text is added to the field's description, so the model reads it. regex patterns run on a linear-time engine with RE2 syntax and are capped at 512 characters; lookarounds and backreferences are rejected with INVALID_SCHEMA.

Field rules
RuleOptionsWhat it does
iso_dateday_first?Writes the date as YYYY-MM-DD. day_first: true reads 03/04/2026 as 3 April, false as March 4.
iso_currencyWrites a currency symbol or name as its ISO 4217 code.
net_of_vatvat_rate?Takes VAT out of an amount that includes it, at vat_rate or the document's tax rate.
regexpattern, replacement, flags?Replaces on the value. RE2 syntax with no lookarounds or backreferences, patterns up to 512 characters.
enum_mapmap, fallback?Maps printed values to your own labels.
instructiontextAdds up to 500 characters of guidance to the field's description.
POST/v1/parseAdd field rulescurl
curl https://api.parserkit.com/v1/parse \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "file_url": "https://raw.githubusercontent.com/bitgate/parserkit-samples/master/invoice-fernhill-1004.pdf",
  "schema": {
    "type": "object",
    "properties": {
      "supplier": {
        "type": "string",
        "description": "Who sent the invoice"
      },
      "invoice_number": {
        "type": "string"
      },
      "invoice_date": {
        "type": "string",
        "format": "date"
      },
      "po_number": {
        "type": "string",
        "description": "Our purchase order number"
      },
      "line_items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "number"
            },
            "unit_price": {
              "type": "number"
            },
            "total": {
              "type": "number"
            },
            "category": {
              "type": "string",
              "enum": [
                "print",
                "design",
                "other"
              ]
            }
          }
        }
      },
      "subtotal": {
        "type": "number"
      },
      "tax_total": {
        "type": "number"
      },
      "grand_total": {
        "type": "number"
      },
      "currency": {
        "type": "string",
        "format": "currency"
      }
    },
    "required": [
      "supplier",
      "invoice_number",
      "grand_total"
    ]
  },
  "field_rules": [
    {
      "field": "po_number",
      "transform": "regex",
      "pattern": "^CS-PO-",
      "replacement": ""
    },
    {
      "field": "line_items[].category",
      "transform": "instruction",
      "text": "design for proofs and design hours, print for printed goods"
    }
  ]
}'
200 OKLive response, Nov 7, 2026
request-id: a56922a9090bb905
{
  "id": "job_7zqombjrcj6y1jrc0jsd",
  "verification_status": "partial",
  "data": {
    "invoice_number": "FP-1004",
    "po_number": "2240",
    "grand_total": 1743.53
  },
  "verification": {
    "coverage": {
      "values": 24,
      "checked": 23
    }
  }
}

Trimmed to the fields the rules touched. The regex rule turned CS-PO-2240 into 2240, so that value counts as unchecked: 23 of 24.

A value modified by a field rule carries no checks and counts as unchecked. In this example, a regex stripped CS-PO-2240 down to 2240, so 23 of 24 values were checked and the job status dropped to partial. In output.json, the changed field carries by_rule: true. Use field rules for identifiers or dates you want to format yourself, and leave totals untouched so they stay checked.

Save and version a schema

Save a reusable schema with POST /v1/schemas. Send name (1 to 100 characters), description (up to 1,000 characters), json_schema, field_rules and gl_accounts. The endpoint answers 201 with a schema id (sch_...) and version set to 1. Pass that id as schema_id on POST /v1/parse.

POST/v1/schemasSave a schemacurl
curl https://api.parserkit.com/v1/schemas \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Print shop invoice",
  "description": "Supplier invoices from print shops",
  "json_schema": {
    "type": "object",
    "properties": {
      "supplier": {
        "type": "string",
        "description": "Who sent the invoice"
      },
      "invoice_number": {
        "type": "string"
      },
      "invoice_date": {
        "type": "string",
        "format": "date"
      },
      "po_number": {
        "type": "string",
        "description": "Our purchase order number"
      },
      "line_items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string"
            },
            "quantity": {
              "type": "number"
            },
            "unit_price": {
              "type": "number"
            },
            "total": {
              "type": "number"
            },
            "category": {
              "type": "string",
              "enum": [
                "print",
                "design",
                "other"
              ]
            }
          }
        }
      },
      "subtotal": {
        "type": "number"
      },
      "tax_total": {
        "type": "number"
      },
      "grand_total": {
        "type": "number"
      },
      "currency": {
        "type": "string",
        "format": "currency"
      }
    },
    "required": [
      "supplier",
      "invoice_number",
      "grand_total"
    ]
  },
  "field_rules": [
    {
      "field": "po_number",
      "transform": "regex",
      "pattern": "^CS-PO-",
      "replacement": ""
    },
    {
      "field": "line_items[].category",
      "transform": "instruction",
      "text": "design for proofs and design hours, print for printed goods"
    }
  ]
}'
201 CreatedLive response, Nov 7, 2026
request-id: a5691d15aef265ba
{
  "id": "sch_wtqpjqqezpy763s0",
  "name": "Print shop invoice",
  "description": "Supplier invoices from print shops",
  "preset": null,
  "json_schema": {
    "type": "object",
    "required": [
      "supplier",
      "invoice_number",
      "grand_total"
    ],
    "properties": {
      "currency": {
        "type": "string",
        "format": "currency"
      },
      "subtotal": {
        "type": "number"
      },
      "supplier": {
        "type": "string",
        "description": "Who sent the invoice"
      },
      "po_number": {
        "type": "string",
        "description": "Our purchase order number"
      },
      "tax_total": {
        "type": "number"
      },
      "line_items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "total": {
              "type": "number"
            },
            "category": {
              "enum": [
                "print",
                "design",
                "other"
              ],
              "type": "string"
            },
            "quantity": {
              "type": "number"
            },
            "unit_price": {
              "type": "number"
            },
            "description": {
              "type": "string"
            }
          }
        }
      },
      "grand_total": {
        "type": "number"
      },
      "invoice_date": {
        "type": "string",
        "format": "date"
      },
      "invoice_number": {
        "type": "string"
      }
    }
  },
  "field_rules": [
    {
      "field": "po_number",
      "pattern": "^CS-PO-",
      "transform": "regex",
      "replacement": ""
    },
    {
      "text": "design for proofs and design hours, print for printed goods",
      "field": "line_items[].category",
      "transform": "instruction"
    }
  ],
  "gl_accounts": [],
  "version": 1,
  "created_at": "2026-11-07T03:04:58.596Z",
  "updated_at": "2026-11-07T03:04:58.596Z"
}

Update any field with PATCH /v1/schemas/{id}. Include the version you last read; each update bumps version. If another write happened first, the API answers 409 CONFLICT with the current version and changes nothing.

PATCH/v1/schemas/{id}Change a schemacurl
curl -X PATCH https://api.parserkit.com/v1/schemas/sch_wtqpjqqezpy763s0 \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description": "Supplier invoices from print shops, PO prefix removed", "version": 1}'

curl -X PATCH https://api.parserkit.com/v1/schemas/sch_wtqpjqqezpy763s0 \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description": "An edit made from an old copy", "version": 1}'
200 OKFirst edit, sent with version 1Live response, Nov 7, 2026
request-id: a5691d1a78c22580
{
  "id": "sch_wtqpjqqezpy763s0",
  "name": "Print shop invoice",
  "description": "Supplier invoices from print shops, PO prefix removed",
  "version": 2,
  "updated_at": "2026-11-07T03:04:59.306Z"
}
409 ConflictSecond edit from the same old copyLive response, Nov 7, 2026
request-id: a5691d1baf90d35e
{
  "error": {
    "code": "CONFLICT",
    "message": "the schema is at version 2 now, reload it and try again",
    "version": 2,
    "request_id": "a5691d1baf90d35e"
  }
}

The first body is trimmed.

Delete a schema with DELETE /v1/schemas/{id}. Past job results stay intact. If an inbox still uses the schema, the delete fails with 409 CONFLICT and returns the blocking inbox_ids.

Draft a schema from a sample

Draft a schema from an existing document with POST /v1/schemas/from-sample. Send a document source just like on parse, plus an optional hint up to 500 characters. parserkit reads the first 3 pages of the first document and adds a SAMPLE_TRUNCATED warning if the file had more pages. Each sample costs 1 page ($0.02). Accounts can run 30 samples per UTC day before getting 429 RATE_LIMITED until midnight; failed samples cost nothing but still count toward the 30.

POST/v1/schemas/from-sampleDraft a schema from a samplecurl
curl https://api.parserkit.com/v1/schemas/from-sample \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_url": "https://raw.githubusercontent.com/bitgate/parserkit-samples/master/invoice-fernhill-1004.pdf", "hint": "supplier invoice from a print shop"}'
200 OKLive response, Nov 7, 2026
request-id: a5691d9aecd4373e
{
  "id": "job_hj6yk9u8vo300eqzy4ad",
  "status": "succeeded",
  "mode": "schema_from_sample",
  "pages": 1,
  "cost_usd": 0.02,
  "verification_status": "unverified",
  "data": {
    "schema": {
      "type": "object",
      "properties": {
        "vendor": {
          "type": "object",
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ],
              "description": "Name of the supplier or vendor issuing the invoice."
            },
            "address": {
              "type": [
                "string",
                "null"
              ],
              "description": "Street address, suite, city, state, and ZIP of the vendor."
            },
            "email": {
              "type": [
                "string",
                "null"
              ],
              "description": "Vendor billing email address.",
              "format": "email"
            },
            "phone": {
              "type": [
                "string",
                "null"
              ],
              "description": "Vendor contact phone number."
            }
          },
          "required": [
            "name",
            "address",
            "email",
            "phone"
          ],
          "additionalProperties": false
        },
        "invoice_number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier assigned to the invoice."
        },
        "invoice_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "Issue date of the invoice.",
          "format": "date"
        },
        "line_items": {
          "type": "array",
          "description": "line items, in printed order",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Description of the printed product or service provided."
              },
              "quantity": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Quantity or hours billed for the line item."
              },
              "unit_price": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Unit price or hourly rate for the line item."
              },
              "amount": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Total charge for the line item before tax."
              }
            },
            "required": [
              "description",
              "quantity",
              "unit_price",
              "amount"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "vendor",
        "invoice_number",
        "invoice_date",
        "due_date",
        "purchase_order_number",
        "payment_terms",
        "customer",
        "line_items",
        "subtotal",
        "tax_rate",
        "taxable_amount",
        "tax_amount",
        "total_amount",
        "amount_paid",
        "currency",
        "balance_due"
      ],
      "additionalProperties": false,
      "title": "Print Shop Supplier Invoice"
    },
    "sample": {
      "vendor": {
        "name": "Fernhill Print Co.",
        "address": "2210 Western Ave, Suite 300, Seattle, WA 98121",
        "email": "billing@fernhill-print.example",
        "phone": "(206) 555-0142"
      },
      "invoice_number": "FP-1004",
      "invoice_date": "2026-10-30",
      "line_items": [
        {
          "description": "Business cards, 350 gsm matte, two-sided",
          "quantity": 750,
          "unit_price": 0.16,
          "amount": 120
        },
        {
          "description": "A2 posters, satin, full color",
          "quantity": 60,
          "unit_price": 6.25,
          "amount": 375
        },
        {
          "description": "Tri-fold brochures, 100 lb gloss",
          "quantity": 2500,
          "unit_price": 0.38,
          "amount": 950
        },
        {
          "description": "Design proof and color check (hours)",
          "quantity": 3,
          "unit_price": 45,
          "amount": 135
        }
      ]
    }
  },
  "warnings": []
}

Trimmed: the proposed schema has 16 properties, 4 are shown, with the values read for them.

This sample proposed 16 properties for the invoice, came back unverified because proposals run no checks, and returned both data.schema and the extracted values in data.sample. Review the proposed schema, then save it with POST /v1/schemas. AI agents can run the same flow over MCP with the create_schema tool; see MCP server.

When a schema is rejected

When a schema breaks a limit or uses an unsupported keyword, parserkit answers 400 INVALID_SCHEMA with issues naming the exact field path, as shown in this response to a schema that used oneOf.

POST/v1/parseA keyword the schema subset doesn't takecurl
curl https://api.parserkit.com/v1/schemas \
  -H "Authorization: Bearer $PARSERKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Broken", "json_schema": {"type": "object", "properties": {"total": {"oneOf": [{"type": "number"}]}}}}'
400 Bad RequestLive response, Nov 7, 2026
request-id: a5691d98ece67da6
{
  "error": {
    "code": "INVALID_SCHEMA",
    "message": "json_schema.total: unsupported keyword \"oneOf\"",
    "issues": [
      {
        "path": "json_schema.total",
        "message": "unsupported keyword \"oneOf\""
      }
    ],
    "request_id": "a5691d98ece67da6"
  }
}

Questions

Can I use oneOf, anyOf or $ref?

No. Keywords outside the supported list are rejected with 400 INVALID_SCHEMA and an issues list that names the path of the problem.

Does a custom schema cost more than a preset?

No. Both cost $0.02 a page, and drafting a schema from a sample document costs 1 page ($0.02).

Do custom schemas get arithmetic checks?

Yes, when the schema matches an invoice, receipt or bank statement shape: line_items with grand_total or amount_due, items with total, or transactions with opening_balance or closing_balance.

Why did a field rule make my job partial?

A value changed by a field rule carries no checks, so verification counts it as unchecked.

How big can a schema be?

A schema can have up to 200 properties, a nesting depth of 6, and 64 KB of UTF-8 JSON, with up to 100 field rules.

NextExports

Your first $1 is free, 50 pages with every check and export.