Skip to main content

Quickstart Guide

Get up and running with the HeyPeppy API in minutes.

1. Authentication & Multi-Tenancy​

Enterprise partners test their integrations against the sandbox environment:

  • Sandbox: hp_test_... (Base URL: https://staging-api.heypeppy.ai/v1)

Include your API key as a Bearer token, and specify your tenant identifier via the X-Tenant-ID header (or pass "tenantId": "..." in the JSON body):

Authorization: Bearer hp_test_your_api_key_here
X-Tenant-ID: your_tenant_id

2. Submit a Receipt for Extraction (cURL)​

Send a POST request with the URL of the receipt PDF or image using receiptUrl (or pass fileBase64):

curl -X POST "https://staging-api.heypeppy.ai/v1/receipts/extract" \
-H "Authorization: Bearer hp_test_your_api_key_here" \
-H "X-Tenant-ID: your_tenant_id" \
-H "Content-Type: application/json" \
-d '{
"receiptUrl": "https://storage.partner.org/receipts/kumon_receipt_1029.pdf",
"fileName": "kumon_receipt_1029.pdf",
"mimeType": "application/pdf",
"categorizeItems": false,
"studentCandidates": [
{
"id": "stu_1002",
"name": "Emma Davis",
"officialName": "Emma Grace Davis",
"scholarshipProgram": "PEP"
}
]
}'
Receipt Extraction vs. Line Item Processing
  • Fast Extraction Only (categorizeItems: false, default): Rapidly extracts vendor name, transaction date, total amount, subtotal, sales tax, payment proof, student matching, and raw line item descriptions/prices without running scholarship policy categorization.
  • Guideline Categorization (categorizeItems: true): Additionally evaluates each line item against the specified programKey (e.g., PEP, UA) to categorize items and detect potential compliance warnings.

Response (202 Accepted)​

{
"jobId": "job_your_tenant_id_1726590000000_abc123",
"tenantId": "your_tenant_id",
"status": "queued",
"pollUrl": "/v1/jobs/job_your_tenant_id_1726590000000_abc123",
"message": "Receipt extraction task queued successfully for processing"
}

3. Poll for Job Results​

If you are not using webhooks, poll the job endpoint until status becomes completed:

curl -X GET "https://staging-api.heypeppy.ai/v1/jobs/job_your_tenant_id_1726590000000_abc123" \
-H "Authorization: Bearer hp_test_your_api_key_here" \
-H "X-Tenant-ID: your_tenant_id"

Response (200 OK)​

{
"jobId": "job_your_tenant_id_1726590000000_abc123",
"tenantId": "your_tenant_id",
"type": "receipt_extraction",
"status": "completed",
"createdAt": "2026-09-11T19:50:00.000Z",
"queuedAt": "2026-09-11T19:50:00.000Z",
"processingStartedAt": "2026-09-11T19:50:01.000Z",
"completedAt": "2026-09-11T19:50:05.000Z",
"failedAt": null,
"latencyMs": 4120,
"webhookStatus": "delivered",
"metadata": {},
"result": {
"extractedData": {
"vendor": "Kumon Math & Reading Center",
"amount": 180.00,
"transactionDate": "2026-09-02",
"invoiceType": "service",
"items": [
{
"description": "Monthly Math Tutoring - September 2026",
"price": 180.00,
"quantity": 1
}
],
"paymentDetails": {
"isPaid": true,
"paymentMethod": "card",
"cardLast4": "4128",
"proofOfPaymentType": "card"
},
"studentDetails": {
"detectedStudentName": "Emma Davis",
"matchedChildId": "stu_1002",
"matchedChildName": "Emma Grace Davis",
"matchConfidence": 0.95
},
"auditResult": {
"summary": "Document contains valid proof of payment.",
"isServiceBased": true,
"isUnpaidInvoice": false,
"hasLineItems": true,
"hasTransactionDate": true,
"hasProviderName": true,
"hasTotalPrice": true,
"hasPaidIndication": true
}
},
"fileInfo": {
"isPdf": true,
"convertedToImage": true,
"fileSize": 184500
}
},
"error": null
}

4. Run an Audit on a Submission Package​

Pass the submission context (merchant, line items, justifications, and program key) to receive an immediate compliance evaluation:

curl -X POST "https://staging-api.heypeppy.ai/v1/submissions/audit" \
-H "Authorization: Bearer hp_test_your_api_key_here" \
-H "X-Tenant-ID: your_tenant_id" \
-H "Content-Type: application/json" \
-d '{
"vendor": "Florida Virtual School",
"amount": 325.00,
"programKey": "FL_PEP",
"lineItems": [
{
"description": "Algebra 1 Honors Full Curriculum Course",
"price": 325.00,
"category": "Curriculum/Course",
"type": "Online",
"detail": "High School",
"justification": "Full year 9th grade high school math curriculum for Emma to satisfy academic course requirements."
}
],
"supportingFiles": [
{ "name": "flvs_algebra1_syllabus.pdf" }
],
"async": false
}'

Result (200 OK)​

{
"success": true,
"tenantId": "your_tenant_id",
"latencyMs": 1850,
"data": {
"confidenceScore": 92,
"overallStatus": "pass",
"summary": "This submission meets all core program requirements and is ready to submit.",
"receiptFormat": {
"isValid": true,
"summary": "All required receipt format elements are present.",
"missingFields": []
},
"purchaseLimitations": {
"hasLimitations": false,
"summary": "No purchase frequency or dollar limits apply to these items.",
"limitations": []
},
"supportingDocumentation": {
"hasRequirements": true,
"summary": "All required supporting documentation is attached/linked.",
"requiredDocuments": [
{
"documentType": "Course Syllabus",
"isAttached": true,
"status": "attached"
}
]
},
"flags": [],
"justificationAnalysis": [
{
"lineItemIndex": 0,
"strength": "strong",
"reason": "Justification clearly articulates the educational purpose and benefit for the student.",
"improvementHints": []
}
],
"disclaimer": "This audit is an AI-powered advisory review. Final reimbursement authority rests with the program scholarship granting organization."
}
}