Skip to main content
A
Docs

API Reference

Complete API reference for the Anar Procure procurement intelligence platform.

Base URL

http://localhost:8014/api/v1

All endpoints require Bearer token authentication in the Authorization header.

Tenders

Create Tender

POST
/api/v1/tenders

Request Body:

{
  "title": "AI Infrastructure Upgrade",
  "description": "Procurement of GPU compute infrastructure",
  "category": "it_services",
  "budget_min": 5000000,
  "budget_max": 15000000,
  "currency": "AED",
  "deadline": "2024-03-15",
  "requirements": [
    "Minimum 100 TFLOPS aggregate compute",
    "Data center within GCC region"
  ],
  "evaluation_criteria": {
    "technical_capability": 0.35,
    "price": 0.25,
    "experience": 0.20,
    "delivery_timeline": 0.10,
    "local_content": 0.10
  }
}
FieldTypeRequiredDescription
titlestringYesTender title (1-500 characters)
descriptionstringNoDetailed description (up to 10,000 characters)
categorystringNoCategory (default: other)
budget_minnumberNoMinimum budget (default: 0)
budget_maxnumberNoMaximum budget (default: 0)
currencystringNoAED, SAR, QAR, OMR, USD (default: AED)
deadlinestringNoSubmission deadline
requirementsstring[]NoMandatory requirements
evaluation_criteriaobjectNoCriteria names mapped to weights (0-1, should sum to 1)

List Tenders

GET
/api/v1/tenders

Query Parameters:

ParameterTypeDefaultDescription
pageinteger1Page number
page_sizeinteger20Results per page (max 100)
categorystring-Filter by category
statusstring-Filter by status
searchstring-Search in title and description

Get Tender

GET
/api/v1/tenders/{tender_id}

Update Tender

PUT
/api/v1/tenders/{tender_id}

Delete Tender

DELETE
/api/v1/tenders/{tender_id}

Tender Statistics

GET
/api/v1/tenders/stats

Returns aggregate statistics: total tenders, breakdown by category and status, and average budget ranges.

Analyze Tender

POST
/api/v1/tenders/{tender_id}/analyze

Run AI analysis producing risk assessment, market comparison, suggested weights, and recommendations.

Response:

{
  "tender_id": "tnd-a1b2c3",
  "risk_assessment": [
    "Budget range may be below market rate",
    "SOC 2 requirement limits supplier pool"
  ],
  "market_comparison": "Similar tenders averaged AED 6-12M...",
  "suggested_weights": {
    "technical_approach": 0.35,
    "price": 0.15,
    "timeline": 0.15
  },
  "recommendation": "Consider increasing budget maximum..."
}

Bids

Submit Bid

POST
/api/v1/tenders/{tender_id}/bids

Request Body:

{
  "supplier_id": "sup-001",
  "amount": 6500000,
  "proposal": "Our team brings 15 years of experience...",
  "delivery_days": 120,
  "qualifications": ["ISO 27001:2022", "SOC 2 Type II"]
}

List Bids

GET
/api/v1/tenders/{tender_id}/bids

Returns all bids for a tender with scores and rankings.

Get Bid

GET
/api/v1/tenders/{tender_id}/bids/{bid_id}

Evaluate Single Bid

POST
/api/v1/tenders/{tender_id}/bids/{bid_id}/evaluate

Run AI evaluation on a single bid. Returns per-criterion scores, strengths, weaknesses, compliance check, and value assessment.

Evaluate All Bids

POST
/api/v1/tenders/{tender_id}/evaluate-all

Evaluate all bids for a tender and produce a ranked comparison with overall recommendation.

Response:

{
  "tender_id": "tnd-a1b2c3",
  "evaluations": [...],
  "ranking": [
    {"bid_id": "bid-001", "rank": 1, "total_score": 86.2},
    {"bid_id": "bid-002", "rank": 2, "total_score": 79.8}
  ],
  "recommendation": "Recommend awarding to Supplier A..."
}

Reports

Generate Report

POST
/api/v1/reports/tender/{tender_id}

Generate a comprehensive evaluation report for a tender.

Response:

{
  "id": "rpt-a1b2c3",
  "tender_id": "tnd-a1b2c3",
  "report_type": "evaluation",
  "content": {...},
  "filename": "evaluation_report_tnd-a1b2c3.pdf",
  "created_by": "user-123",
  "created_at": "2024-01-15T10:30:00Z"
}

List Reports

GET
/api/v1/reports

Returns all generated procurement reports.

Suppliers

Create Supplier

POST
/api/v1/suppliers

Request Body:

{
  "name": "Gulf Technology Solutions",
  "registration_number": "CR-2024-001234",
  "category": "it_services",
  "contact_email": "procurement@gulftech.example",
  "contact_phone": "+971-2-555-0100",
  "capabilities": ["Cloud infrastructure", "Government migrations"],
  "certifications": ["ISO 27001:2022", "SOC 2 Type II"]
}

List Suppliers

GET
/api/v1/suppliers

Query Parameters:

ParameterTypeDescription
categorystringFilter by category
searchstringSearch in supplier names
min_scorenumberMinimum overall score (0-100)
pageintegerPage number (default: 1)
page_sizeintegerResults per page (default: 20, max: 100)

Get Supplier

GET
/api/v1/suppliers/{supplier_id}

Update Supplier

PUT
/api/v1/suppliers/{supplier_id}

Score Supplier

POST
/api/v1/suppliers/{supplier_id}/score

Generate an AI performance score based on bid history.

Response:

{
  "supplier_id": "sup-001",
  "overall_score": 82.5,
  "breakdown": {
    "bid_quality": 85.0,
    "price_competitiveness": 78.0,
    "delivery_reliability": 88.0,
    "compliance_record": 90.0
  },
  "total_bids": 12,
  "won_bids": 5,
  "win_rate": 0.42
}

Health

Health Check

GET
/api/v1/health

Returns service health status and version information.