Extract schemas
Built-in schemas, and defining your own fields.
A schema decides which fields come back. Built-ins cover common documents; custom schemas let you describe your own and are versioned as you refine them.
Built-in schemas
schemaId | Document | Primary fields |
|---|---|---|
invoice | Invoice — Accounts-payable invoices with vendor, dates, totals, and line items. | vendorName, invoiceNumber, invoiceDate, dueDate, totalAmount, lineItems[] |
receipt | Receipt — Retail and expense receipts with merchant, payment, and itemized totals. | merchantName, receiptNumber, receiptDate, paymentMethod, totalAmount, lineItems[] |
purchase_order | Purchase order — Procurement POs with buyer, vendor, delivery dates, and ordered lines. | poNumber, buyerName, vendorName, orderDate, totalAmount, lineItems[] |
credit_note | Credit note — Credit memos linked to original invoices with reason and credited lines. | creditNoteNumber, originalInvoiceNumber, creditDate, reason, totalAmount, lineItems[] |
delivery_note | Delivery note — Packing slips and delivery notes with carrier, tracking, and shipped items. | deliveryNoteNumber, shipperName, recipientName, carrier, trackingNumber, lineItems[] |
bank_statement | Bank statement — Account statements with period, balances, and transaction rows. | bankName, accountNumber, statementPeriodStart, statementPeriodEnd, closingBalance, transactions[] |
payslip | Payslip — Payroll slips with employer, pay period, gross/net pay, and deductions. | employerName, employeeName, payPeriodStart, payPeriodEnd, grossPay, netPay, deductions[] |
utility_bill | Utility bill — Electric, gas, water, and telecom bills with account, period, and itemized charges. | providerName, accountNumber, billingPeriodStart, billingPeriodEnd, totalAmountDue, lineItems[] |
ticket | Ticket — Event tickets and boarding passes with issuer, event, seat, and fare. | issuerName, ticketNumber, eventName, venue, eventDate, passengerName, price |
tax_form | Tax form — Tax certificates and compliance forms (W-9, 1099, VAT) with taxpayer ID and signature date. | formType, taxpayerName, taxId, address, signatureDate, exemptPayeeCode |
contract | Contract — Commercial agreements with parties, effective dates, and key terms. | contractTitle, contractNumber, effectiveDate, expiryDate, governingLaw, parties[], keyTerms[] |
gst_invoice | GST invoice — Indian GST tax invoices with seller/buyer GSTIN, CGST/SGST/IGST breakdown, and HSN/SAC lines. | sellerGstin, buyerGstin, invoiceNumber, invoiceDate, placeOfSupply, totalAmount, lineItems[] |
id_document | ID document — Passports, driver licenses, and national IDs — identity fields only. | documentType, fullName, documentNumber, dateOfBirth, expiryDate, issuingAuthority |
remittance_advice | Remittance advice — Payment remittance documents with payee, payment reference, and linked invoice rows. | remittanceNumber, payeeName, paymentDate, paymentReference, totalAmountPaid, lineItems[] |
packing_slip | Packing slip — Packing lists and shipping manifests with SKUs, quantities, and carrier details (no pricing). | packingSlipNumber, poNumber, recipientName, carrier, trackingNumber, lineItems[] |
quote | Quote — Sales quotes and estimates with line items, tax, and expiry dates. | quoteNumber, sellerName, quoteDate, expiryDate, totalAmount, lineItems[] |
business_card | Business card — Contact details from business card images — name, title, company, phone, email. | fullName, jobTitle, companyName, email, phone, website |
bank_check | Bank check — Bank checks and cheques with payee, amount, MICR line, and routing details. | checkNumber, payeeName, amount, checkDate, bankName, micrLine |
w2 | W-2 — US IRS Form W-2 wage and tax statements with employer/employee IDs and withholding boxes. | taxYear, employerName, employeeName, wagesTipsOther, federalIncomeTaxWithheld, socialSecurityWages |
e_way_bill | E-way bill — India GST e-way bills with EWB number, GSTINs, validity window, and CGST/SGST/IGST breakdown. | ewayBillNumber, validUntil, generatorGstin, taxableValue, cgstAmount, sgstAmount, igstAmount |
Listing what is available
curl 'https://api.dev.oprag.ai/v1/extract/schemas' -H 'X-Oprag-Key: sk_live_...'
# Custom schemas only
curl 'https://api.dev.oprag.ai/v1/extract/schemas?includeBuiltin=false' -H 'X-Oprag-Key: sk_live_...' | Query parameter | Default | Meaning |
|---|---|---|
includeBuiltin | true | Set false to list only this workspace's own schemas. |
status | active | active, archived, or all. |
Defining one
curl -X POST 'https://api.dev.oprag.ai/v1/extract/schemas' \
-H 'X-Oprag-Key: sk_live_...' \
-H 'Content-Type: application/json' \
-d '{
"schemaId": "custom_purchase_order",
"displayName": "Purchase order",
"documentDescription": "A supplier purchase order with line items and totals.",
"extractionHints": "Totals are on the last page.",
"fields": [
{ "key": "poNumber", "type": "string", "description": "Purchase order number" },
{ "key": "total", "type": "number", "description": "Order total including tax" }
]
}' schemaIdmust becustom_-prefixed; built-in ids are rejected with 409.displayNameup to 128 characters;documentDescriptionandextractionHintsup to 512.extractionHintsis where document quirks belong — it is prompt context, not validation.- Fields compile into a prompt with a size ceiling, so a very large schema is refused with 400.
Changing one
PATCH updates a custom schema and bumps its version. An archived schema cannot be edited — create a new schemaId instead.
Archiving
Full request and response shapes are on the Extract reference.
Ready to ship?
Get started free