This guide walks you through a typical workflow for a document processing order. With this workflow, document processing begins running after you upload documents to the KarmaCheck system and create the order. By the end of this guide, you’ll know how to:Documentation Index
Fetch the complete documentation index at: https://developer.karmacheck.com/llms.txt
Use this file to discover all available pages before exploring further.
- Authenticate with KarmaCheck.
- Upload documents and create a secure document record for each one.
- Order document processing by providing the candidate’s PII and order data with the secure document record IDs.
- Retrieve document processing results and receive status updates.
Before you begin
Ensure that you have the following sandbox credentials:- An API key
- A client access token
Step 1: Authenticate with KarmaCheck
CallPOST /auth/api to retrieve an authentication token. Replace API_KEY and CLIENT_ACCESS_TOKEN with your credentials:
token field. Use this as Bearer AUTHENTICATION_TOKEN in all subsequent requests.
Step 2: Order document processing
Step 2a: Upload your documents to KarmaCheck
This step references the full Upload documents guide. The key flow is:- Request upload URLs — Call
POST /document/secure/uploadto generate a secure, time-limited upload URL andfileKeyfor each document. - Upload documents — Upload each file directly to the returned URL using an HTTP
PUTrequest with the correctContent-Type. - Create secure document records — Call
POST /document/secure/createwith thefileKey,documentTypeId, andoriginalFileName.
At this point you will not yet have a
caseId. When no order exists yet, omit the accessGrants object from the request.- Note the
secureDocumentIdreturned for each document — you’ll pass these when creating the order.
Step 2b: Get available packages
CallGET /package/min/list to get a list of available packages:
id.
Step 2c: Get services in the package
CallGET /package/id/{packageId}/services to retrieve the services included in the package:
serviceId of the Document Processing service (service-intelligent-document-process). You’ll need this when providing order data.
Step 2d: Create a document processing order
CallPOST /case/create to order document processing. The orderData array must include the minimally required candidate PII types plus one codt-idp entry per document:
orderData fields:
| Field | Description |
|---|---|
codt-govt-id / govtId | Candidate’s SSN in xxx-xx-xxxx format. Use 111-22-3333 for sandbox testing. |
codt-dob / dob | Candidate’s date of birth in yyyy-mm-dd format. |
codt-current-candidate-address | Candidate’s current address (address1, city, state, postalCode, country). |
codt-idp / documentTypeId | Document type. Always use unclassified for Document Processing. |
codt-idp / fileName | The file name as provided when uploading the document. |
codt-idp / secureDocumentId | The ID returned after creating the secure document record. |
postbackUrl is for testing purposes only and supports only case.statuschange events. To configure webhooks for production, contact KarmaCheck to subscribe to webhook events.caseId of the order. Note this value — you’ll use it to retrieve results.
Step 3: Retrieve document processing results
CallGET /case/id/{caseId}/data/{serviceTypeId} using service-type-document-processing as the serviceTypeId:
| Field | Description |
|---|---|
status / statusDisplayName | Current processing status (e.g. complete). |
detailsObject.classificationData | Document classification results including type and confidence score. |
detailsObject.value | Extracted data keyed by field name (e.g. issueDate, dateOfBirth). |
detailsObject.metadata | OCR confidence scores and citation polygons for each extracted field. |
Step 4: Receive status updates (optional)
If you provided apostbackUrl when creating the order, KarmaCheck sends a POST request to that URL whenever the order status changes. Example webhook payload:
2xx status to confirm receipt. If KarmaCheck does not receive a 2xx response, it will retry the delivery after a delay. See the webhooks overview for more details.
If you don’t have a webhook set up, poll GET /case/id/{caseId} to retrieve the current status of the order.