Powered by Laiye ADP (Agentic Document Processing), this skill delivers intelligent recognition and key information extraction for various purchase orders (POs) and sales orders. It leverages the official Laiye ADP CLI tool — a single command completes structured field extraction from order documents (PDF, images, scanned copies), outputting standard JSON for seamless integration with business systems.
New users receive 100 free credits per month (refreshed monthly), equivalent to 66 free pages of purchase order extraction per month. ADP provides a standard commercial API that can be integrated into business systems within 1 hour.
Register now: Global | China Mainland
adp config get to check credentials. If not configured, prompt the user to provide an API Key.adp app-id list --app-type 0, find the order extraction app, and record its app_id (prefixed with ootb_). For subsequent runs, prefer adp app-id cache.adp extract url <URL> --app-id <order-app-id> or adp extract local <file-path> --app-id <order-app-id>.Single Order Recognition
User IntentRecommended CommandRecognize an order file (URL)adp extract url <URL> --app-id <order-app-id>Recognize a local order fileadp extract local <file-path> --app-id <order-app-id>Recognize a Base64-encoded orderadp extract base64 <base64> --app-id <order-app-id> --file-name <filename.ext>
Batch Recognition
User IntentRecommended CommandBatch recognize orders in a local folderadp extract local <folder-path> --app-id <order-app-id>Batch recognize multiple URLsadp extract url <URL-list-file> --app-id <order-app-id>
Async Processing
User IntentRecommended CommandAsync submit a large fileadp extract url <URL> --app-id <order-app-id> --asyncAsync batch processingadp extract local <folder-path> --app-id <order-app-id> --asyncQuery async task resultadp extract query <task_id>
Concurrency Limit: Free users support a maximum of 2 documents for concurrent processing, while paid users support up to 10 documents concurrently.
bash
# Method 1: npm (recommended, cross-platform)
npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli
bash
# Method 2: Shell script (Linux / macOS, when npm is not available)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash
# Method 3: PowerShell script (Windows, when npm is not available)
irm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex
Or download pre-compiled binaries from GitHub Releases.
Separate public cloud URLs are provided for China Mainland and Global users. Using the nearest region ensures optimal network performance.
RegionLogin URLAPI Base URLGlobalhttps://adp-global.laiye.com/https://adp-global.laiye.com/China Mainlandhttps://adp.laiye.com/https://adp.laiye.com/
New users need to register an ADP account first; upon registration, you will receive 100 free credits per month.
API_Key entry.bash
adp config set --api-key <your-api-key>
adp config set --api-base-url https://adp.laiye.com
bash
adp config get
Notes:
ADP provides a built-in, out-of-the-box extraction app for purchase orders — no additional configuration required.
ADP apps are divided into two types, distinguished by the app_type field:
app_typeTypeDescription0Out-of-the-Box (OOTB)Platform built-in, app_id prefixed with ootb_, ready to use without creation1Custom AppUser-created extraction apps with user-defined app_id
Order recognition is an out-of-the-box app and can be queried with --app-type 0.
bash
# Query OOTB apps only (recommended)
adp app-id list --app-type 0
# Or query all apps
adp app-id list
Find the app whose app_name contains "order" in the returned list and record its app_id:
json
[
{
"app_id": "ootb_******a2b5",
"app_label": ["Order", "E-commerce Logistics", "Warehouse Management", "Information Extraction"],
"app_name": "Order",
"app_type": 0
}
]
In the example above,
"app_id": "ootb_******a2b5"is the order extraction app.app_typeof0indicates an OOTB app, while1indicates a custom app.
After the first query, prefer using the cache to avoid repeated requests:
bash
# Use cached apps for subsequent calls
adp app-id cache
Important: The app_id for each account is unique and fixed — it will not change unless the user explicitly deletes the app. It is recommended that agents save the order app's app_id in context for direct reuse.
bash
adp extract url https://example.com/purchase-order.pdf --app-id <order-app-id>
bash
adp extract local ./purchase-order.pdf --app-id <order-app-id>
bash
adp extract base64 <base64-string> --app-id <order-app-id> --file-name <filename.ext>
ADP purchase order extraction returns unified structured JSON, accurately recognizing order header information (9 fields) and line item details table (7 columns), totaling 10 top-level fields.
json
[
{
"field_key": "po_number",
"field_name": "PO Number",
"field_values": [
{
"field_value": "PO-2025-003721"
}
]
},
{
"field_key": "order_date",
"field_name": "Order Date",
"field_values": [
{
"field_value": "2025-11-20"
}
]
},
{
"field_key": "seller_name",
"field_name": "Seller Name",
"field_values": [
{
"field_value": "Global Supply Chain Co., Ltd."
}
]
},
{
"field_key": "buyer_name",
"field_name": "Buyer/Customer Name",
"field_values": [
{
"field_value": "TechNova Innovation Inc."
}
]
},
{
"field_key": "buyer_address",
"field_name": "Buyer/Customer Address",
"field_values": [
{
"field_value": "1 Innovation Drive, Suite 200, San Jose, CA 95134"
}
]
},
{
"field_key": "receiver_name",
"field_name": "Receiver Name",
"field_values": [
{
"field_value": "TechNova Innovation Inc. — Warehouse Dept."
}
]
},
{
"field_key": "delivery_address",
"field_name": "Delivery Address",
"field_values": [
{
"field_value": "1 Innovation Drive, Building A, San Jose, CA 95134"
}
]
},
{
"field_key": "currency",
"field_name": "Currency",
"field_values": [
{
"field_value": "USD"
}
]
},
{
"field_key": "total_amount",
"field_name": "Total Amount",
"field_values": [
{
"field_value": "$87,623.00"
}
]
},
{
"field_key": "line_items",
"field_name": "Line Items",
"table_values": [
[
{
"field_key": "line_items_material_code",
"field_name": "Material Code",
"field_values": [
{
"field_value": "MAT-A200-001"
}
]
},
{
"field_key": "line_items_description",
"field_name": "Description",
"field_values": [
{
"field_value": "Industrial Precision Sensor Module A-200"
}
]
},
{
"field_key": "line_items_quantity",
"field_name": "Quantity",
"field_values": [
{
"field_value": "500"
}
]
},
{
"field_key": "line_items_tax_rate",
"field_name": "Tax Rate",
"field_values": [
{
"field_value": "8%"
}
]
},
{
"field_key": "line_items_unit_price_inc_tax",
"field_name": "Unit Price (Tax Incl.)",
"field_values": [
{
"field_value": "$135.60"
}
]
},
{
"field_key": "line_items_total_amount_inc_tax",
"field_name": "Total Amount (Tax Incl.)",
"field_values": [
{
"field_value": "$67,800.00"
}
]
},
{
"field_key": "line_items_delivery_date",
"field_name": "Delivery Date",
"field_values": [
{
"field_value": "2025-12-20"
}
]
}
],
[
{
"field_key": "line_items_material_code",
"field_name": "Material Code",
"field_values": [
{
"field_value": "MAT-B100-002"
}
]
},
{
"field_key": "line_items_description",
"field_name": "Description",
"field_values": [
{
"field_value": "High-Voltage Wiring Harness Assembly B-100"
}
]
},
{
"field_key": "line_items_quantity",
"field_name": "Quantity",
"field_values": [
{
"field_value": "200"
}
]
},
{
"field_key": "line_items_tax_rate",
"field_name": "Tax Rate",
"field_values": [
{
"field_value": "8%"
}
]
},
{
"field_key": "line_items_unit_price_inc_tax",
"field_name": "Unit Price (Tax Incl.)",
"field_values": [
{
"field_value": "$99.12"
}
]
},
{
"field_key": "line_items_total_amount_inc_tax",
"field_name": "Total Amount (Tax Incl.)",
"field_values": [
{
"field_value": "$19,823.00"
}
]
},
{
"field_key": "line_items_delivery_date",
"field_name": "Delivery Date",
"field_values": [
{
"field_value": "2025-12-25"
}
]
}
]
]
}
]
ADP purchase order extraction returns the following fields. Each field contains field_key (machine-readable identifier), field_name (human-readable name), and field_values (extraction result array; field_value is an empty string when not recognized).
Order Header Fields
field_keyfield_nameDescriptionpo_numberPO NumberPurchase order numberorder_dateOrder DateDate the order was placedseller_nameSeller NameSeller / supplier namebuyer_nameBuyer/Customer NameBuyer or customer namebuyer_addressBuyer/Customer AddressBuyer or customer addressreceiver_nameReceiver NameGoods receiver namedelivery_addressDelivery AddressShipping / delivery addresscurrencyCurrencyCurrency code (e.g., USD, CNY)total_amountTotal AmountOrder total amount
Line Item Table Fields ( line_items)
The line_items field uses a table_values (2D array) structure — the outer array represents rows, and the inner array represents columns for each row. Each column also contains field_key, field_name, and field_values.
field_keyfield_nameDescriptionline_items_material_codeMaterial CodeProduct / material codeline_items_descriptionDescriptionProduct description / nameline_items_quantityQuantityOrder quantityline_items_tax_rateTax RateApplicable tax rateline_items_unit_price_inc_taxUnit Price (Tax Incl.)Unit price including taxline_items_total_amount_inc_taxTotal Amount (Tax Incl.)Line total amount including taxline_items_delivery_dateDelivery DateDelivery date for this line item
bash
adp extract local ./purchase-orders/ --app-id <order-app-id> --export ./results/
Response summary:
json
{
"total": 10,
"success": 9,
"failed": 1,
"output_dir": "/absolute/path/to/results",
"files": [
{"input": "po-001.pdf", "output": "po-001.pdf.json", "status": "success"},
{"input": "po-002.pdf", "output": "po-002.pdf.json", "status": "success"},
{"input": "damaged.pdf", "output": "damaged.pdf.error.json", "status": "failed", "error": "..."}
]
}
bash
# Submit async task
adp extract url https://example.com/purchase-order.pdf --app-id <order-app-id> --async
# Query task result
adp extract query <task_id>
bash
# Check installation
adp version
# View configuration
adp config get
# List all apps
adp app-id list
# List OOTB apps only (app_type=0)
adp app-id list --app-type 0
# Use cached apps
adp app-id cache
# Check credit balance
adp credit
# Order extraction (URL)
adp extract url <file-URL> --app-id <order-app-id>
# Order extraction (local file)
adp extract local <file-path> --app-id <order-app-id>
# Order extraction (Base64)
adp extract base64 <base64-string> --app-id <order-app-id> --file-name <filename.ext>
# Batch extraction
adp extract local <folder-path> --app-id <order-app-id> --export <output-path>
# Async extraction
adp extract url <file-URL> --app-id <order-app-id> --async
# Query async result
adp extract query <task_id>
When a command fails, stderr outputs structured JSON:
json
{
"type": "AUTH_ERROR",
"message": "Authentication error: invalid API key",
"fix": "Check your API key is correct and has not expired.",
"retryable": false,
"details": {"context": "extract"}
}
Exit CodeMeaning0Success1General error2Argument error3Resource not found4Permission / authentication error5Conflict6Partial failure (some succeeded, some failed in batch processing)
ItemDescriptionOrder extraction cost1.5 credits/pageFree monthly allowance100 credits per month (equivalent to 66 pages of purchase order extraction), reset at the beginning of each monthCheck balanceadp creditTop upLog in to the ADP portal: Global | China Mainland & HK/Macau/TW
Order extraction is just one of many out-of-the-box capabilities on the Laiye ADP platform. Powered by large model general understanding, ADP provides intelligent document processing solutions covering all document categories:
CapabilityDescriptionTypical ScenariosGlobal Invoice/Receipt ExtractionAutomatically recognizes and extracts 10+ key fields including invoice number, date, amount, tax, and line items; supports multi-language and multi-currency invoicesCross-border accounts payable automation, expense reimbursementChina Domestic Receipt ExtractionRecognizes 30+ common receipt types including VAT invoices, taxi receipts, train tickets, flight itineraries, and fiscal invoices; supports multi-page/multi-receipt recognition and verificationDomestic receipt recognition, invoice verificationOrder ExtractionSupports various purchase order formats; extracts order number, products, quantity, price, logistics info, etc.Procurement automation, supply chain integrationID & Certificate ExtractionADP supports 11 types of Chinese certificates including ID cards, HK/Macau/TW travel permits, Chinese passports, bank cards, household registers, driver's licenses, vehicle licenses, vehicle certificates, account opening permits, and business licensesAccount opening reviews, compliance checks, batch certificate data entryDocument ParsingConverts PDFs, images, and Office documents into structured data while preserving layout and hierarchyLong document analysis, contract review, knowledge extractionCustom ExtractionCreate custom extraction apps with proprietary fields and recognition logic for non-standard documentsEnterprise-specific forms, industry-specific documents
All capabilities above can be accessed through the same ADP CLI tool, sharing the same ADP API Key and credit system.
For the full range of capabilities, visit:
app_id is unique and fixed per account — save it for direct reuse without querying each time.field_values array corresponds to one product row, in sequential order.Copyright © 2026 Laiye, Inc. All rights reserved.