/ai/document/extract/invoice/urlExtracts invoice data from a document available at a URL and returns parsed results in a JSON object. The response includes separate top-level result objects for Azure and ApyHub parsing outputs.
Extract invoice data (URL input)
**Method:** POST
**Apiosk URL:** https://gateway.apiosk.com/apyhub-ai-document-extract-invoice/ai/document/extract/invoice/url
**Request content type:** application/json
**Response content type:** application/json
What it does
Extracts invoice data from a document available at a URL and returns parsed results in a JSON object. The response includes separate top-level result objects for Azure and ApyHub parsing outputs.
Request Body
| Parameter | Type | Mandatory | Description |
| --------- | ---- | --------- | ----------- |
| url | String | Yes | The invoice document URL to process. Must be a URI. |
| azure | Object | No | Optional custom credentials for Azure services. |
| azure.key | String | No | Azure subscription key. |
| azure.region | String | No | Azure service region. |
| azure.endpoint | String | No | Azure endpoint URL. |
| azure.account_id | String | No | Azure account ID. |
| azure.access_token | String | No | OAuth access token for Azure service. |
| requested_service | ENUM | No | Which parsing service to use. Allowed values: azure, apyhub. Default: apyhub. |
Response
Returns a JSON object with a data object field. Inside data, the response may include azure and apyhub object fields containing the corresponding parsing outputs.
| Parameter | Type | Mandatory | Description |
| --------- | ---- | ---- | ----------- |
| data | Object | No | Result wrapper object. |
| data.azure | Object | No | Raw Azure Document Intelligence parsing output. |
| data.apyhub | Object | No | Structured ApyHub Invoice Extraction parsing output. |
Quickstart
Send an invoice PDF URL to extract its data.
bash
curl -X POST "https://gateway.apiosk.com/apyhub-ai-document-extract-invoice/ai/document/extract/invoice/url" \
-H "PAYMENT-SIGNATURE: $PAYMENT_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/invoice.pdf"}'
What you'll get back
Returns a JSON object with a data object field. data.azure contains the raw Azure Document Intelligence parsing output, and data.apyhub contains the structured ApyHub invoice extraction output.
json
{
"data": {
"azure": {},
"apyhub": {}
}
}
Payment and authentication
Do not send an apy-token. Apiosk injects the APYHub credential server-side. The first unpaid request returns HTTP 402 Payment Required with a PAYMENT-REQUIRED header. Sign an accepted USDC payment and retry the same request with the proof in PAYMENT-SIGNATURE (or use an Apiosk/x402-aware agent client that performs this exchange automatically).
The $PAYMENT_SIGNATURE placeholder in the example is the signed proof obtained from that initial 402 response.
Source
Parameter definitions and limits were synchronized from [APYHub's official documentation](https://apyhub.com/apyhub/service/extract-invoice-data) on 2026-07-18.
Pay per request through Apiosk using x402. Do not send an apy-token; the gateway injects the selected APYHub key server-side.
{
"properties": {
"azure": {
"description": "Custom credentials for Azure services.",
"properties": {
"access_token": {
"description": "OAuth access token for Azure service.",
"example": "access_token_value",
"type": "string"
},
"account_id": {
"description": "Azure account ID.",
"example": "account-id-1234",
"type": "string"
},
"endpoint": {
"description": "Azure endpoint URL.",
"example": "https://westus2.api.cognitive.microsoft.com/",
"type": "string"
},
"key": {
"description": "Azure subscription key.",
"example": "your_azure_speech_or_vision_key",
"type": "string"
},
"region": {
"description": "Azure service region.",
"example": "westus2",
"type": "string"
}
},
"type": "object"
},
"requested_service": {
"default": "apyhub",
"enum": [
"azure",
"apyhub"
],
"example": "apyhub",
"type": "string"
},
"url": {
"example": "https://example.com/invoice.pdf",
"format": "uri",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}{
"properties": {
"data": {
"properties": {
"apyhub": {
"description": "Structured ApyHub Invoice Extraction parsing output.",
"type": "object"
},
"azure": {
"description": "Raw Azure Document Intelligence parsing output.",
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}{
"properties": {
"PAYMENT-SIGNATURE": {
"description": "Signed x402 v2 payment proof. Obtain the payment requirements from the initial HTTP 402 response.",
"type": "string"
}
},
"required": [],
"type": "object"
}{
"requested_service": "apyhub",
"url": "https://example.com/invoice.pdf"
}{
"data": {
"apyhub": {},
"azure": {}
}
}