Skip to main content

POST /receipts/extract

POST

Submit Receipt for Asynchronous Extraction

/receipts/extract

Submits a receipt PDF or image for asynchronous processing. The API immediately enqueues the job into Google Cloud Tasks with tenant isolation and returns a `202 Accepted` response containing a `jobId` and `pollUrl`. Once extraction completes, Peppy sends an HMAC-signed webhook to your configured `webhookUrl` or makes the result available via `GET /jobs/{jobId}`.

Headers

HTTP Headers
ParameterTypeDescription
Authorizationrequiredstring
Bearer token format: Bearer <API_KEY>
Example: Bearer pep_live_99281a8b
X-Tenant-IDoptionalstring
B2B Tenant identifier (e.g., stepup, odyssey, classwallet). If omitted, inferred from API key context.
Example: stepup
Content-Typerequiredstring
application/json
Example: application/json

Query Parameters

URL Query String
ParameterTypeDescription
priorityoptionalstring
default: standard
Queue priority level for enterprise SLAs (standard or high).
Allowed values: standardhigh
Example: standard
validateOnlyoptionalboolean
default: false
If true, validates request payload and pre-signed file accessibility without enqueueing an extraction task.
Example: false

Request Body

application/json
FieldTypeDescription
fileUrlrequiredstring (URI)
Public or pre-signed storage URL to the receipt image (JPEG, PNG, HEIC, WebP) or PDF file.
Example: https://storage.googleapis.com/partner-uploads/receipt_1029.pdf
fileNameoptionalstring
Original name of the uploaded file for logging and reporting reference.
Example: receipt_1029.pdf
fileTypeoptionalstring
MIME type of the uploaded file.
Example: application/pdf
webhookUrloptionalstring (URI)
HTTPS endpoint to receive a POST webhook notification upon job completion or failure.
Example: https://portal.partner.org/api/webhooks/peppy
tenantIdoptionalstring
Optional B2B tenant identifier (can also be passed via X-Tenant-ID header).
Example: stepup
categorizeItemsoptionalboolean
Whether to execute purchasing policy audit & guideline categorization on extracted line items. Defaults to false.
Example: true
programKeyoptionalstring
Target scholarship program guideline rules (PEP, UA, FTC-FES-EO) for item categorization.
Example: PEP
studentCandidatesoptionalarray<StudentCandidate>
List of registered students in the family/account to automatically match receipt beneficiary.
idrequiredstring
Unique student identifier in partner portal.
namerequiredstring
Student display name.
officialNameoptionalstring
Full legal name on scholarship account.
gradeLeveloptionalstring
Grade level for eligibility checks.
scholarshipProgramoptionalstring
Program code (e.g. PEP).

Responses

4 status codes
202 AcceptedReceipt extraction job successfully enqueued in the Cloud Tasks queue.
{
  "jobId": "job_01HXYZ1234",
  "tenantId": "stepup",
  "status": "queued",
  "pollUrl": "https://api.heypeppy.ai/v1/jobs/job_01HXYZ1234",
  "estimatedWaitMs": 5000
}

Interactive Test Console

Bearer
priority
validateOnly