---
title: "Extract receipt data asynchronously with webhook notification"
method: POST
path: "/api/receipts/extract-async"
tags: ["Receipts"]
---

# Extract receipt data asynchronously with webhook notification

`POST /api/receipts/extract-async`

## Request

- Base URL: `https://api.dokmatiq.com`
- URL: `https://api.dokmatiq.com/api/receipts/extract-async`
- Auth: API key in header `X-API-Key`

Submits a receipt for asynchronous AI extraction. Returns a job ID immediately.

When extraction completes (or fails), a webhook POST is sent to the `callbackUrl` with the full extraction result as JSON payload.

**Webhook payload includes:**
- `event`: "receipt.extraction.completed" or "receipt.extraction.failed"
- `jobId`, `status`, `filename`, `durationMs`
- `result`: full ReceiptExtractionResult (on success)
- `error`: error message (on failure)

**Security:** If `callbackSecret` is provided, the webhook includes an `X-DocGen-Signature` header with HMAC-SHA256 of the payload for verification.

Jobs are kept in memory for 30 minutes and then auto-cleaned.

## Query parameters

- `callbackUrl` string
- `callbackSecret` string

## Response `202`

Job accepted

## Other responses

- `400`: No file uploaded or unsupported type
- `500`: Submission failed

---

[API](https://skmtc.dev/dokmatiq/apis/docgen-api.md) · [All operations](https://skmtc.dev/dokmatiq/apis/docgen-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dokmatiq/apis/docgen-api/revisions/3fa1a922764d?raw)
