Skip to main content

Invoice Processing

1 API call in this section.

APIs for extracting invoice data using AI document processing

Extract Invoice Data​

Express Shipping / Order / Invoice Processing
POST/express-shipping/order/extract

API: Extract Invoice Data

Endpoint

POST /express-shipping/order/extract

  • Use X-EXPRESS-KEY: {{express_access_token}} from OTP verification response.

  • Do not send customer_id; it is read from token claims.

Form Fields

  • invoice_file (file, required)

Business Logic

  1. Validate tenant has active express shipping service

  2. Validate file format and size

  3. Process document using AI extraction service

  4. Extract order details, items, and pricing information

  5. Return structured data for customer review

Error Responses

400 - Missing Required Fields

400 - Invalid File Format

400 - File Too Large

404 - Customer Not Found

500 - Extraction Failed

Query parameters

ParameterTypeDescription
languagestring

Preferred language for response messages (en, ar, ku)

Example: en

Headers

ParameterTypeDescription
X-EXPRESS-KEYRequiredstring

Short-lived JWT from OTP verification (required)

Example: {{express_access_token}}

Body parameters

ParameterTypeDescription
invoice_filefile

Invoice file (PDF, JPEG, PNG)

Example: /path/to/file

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/express-shipping/order/extract?language=en" \2  --header "X-EXPRESS-KEY: ${EXPRESS_ACCESS_TOKEN}" \3  --form 'invoice_file=@/path/to/file'

Response examples

200OK
Response body
json
1{2  "success": true,3  "data": {4    "order_number": "TREND-ORD-98765",5    "store_name": "Trendyol",6    "total_amount": 125.5,7    "currency": "USD",8    "order_date": "2024-01-15",9    "items": [10      {11        "name": "Wireless Bluetooth Headphones",12        "quantity": 1,13        "unit_price": 75,14        "total_price": 7515      },16      {17        "name": "Phone Case",18        "quantity": 2,19        "unit_price": 25.25,20        "total_price": 50.521      }22    ],23    "tax_amount": 22.59,24    "customer_name": "John Doe",25    "customer_email": "[email protected]",26    "customer_address": "123 Main St, City",27    "invoice_number": "INV-2024-001",28    "invoice_file_url": "express/invoice/GAL1704067200000/1704067300000-invoice.pdf"29  },30  "message": "Invoice data extracted successfully. Please review and confirm."31}