# LegiPro Partner API Quickstart - 2026-06-27

Status: partner-review quickstart.

Roadmap task: `SAAS-0034`.

This quickstart shows how a buyer or partner product backend can call LegiPro as a bounded research and evidence layer. It is not a public browser/mobile SDK and it must not expose bearer tokens client-side.

## Inputs

Set these values in a server-side environment:

```bash
export LEGIPRO_BASE_URL="https://legipro.fr"
export LEGIPRO_API_KEY="<partner-or-demo-bearer-token>"
export LEGIPRO_TENANT="cab_demo_01"
export LEGIPRO_WORKSPACE="cabinet-production"
```

Required headers:

```text
Authorization: Bearer $LEGIPRO_API_KEY
X-LegiPro-Tenant: $LEGIPRO_TENANT
X-LegiPro-Workspace: $LEGIPRO_WORKSPACE
X-LegiPro-Cost-Units: 1
```

## 1. Health Check

```bash
curl -sS "$LEGIPRO_BASE_URL/v0/search/health" \
  -H "Authorization: Bearer $LEGIPRO_API_KEY"
```

## 2. Search

```bash
curl -sS "$LEGIPRO_BASE_URL/v1/search" \
  -H "Authorization: Bearer $LEGIPRO_API_KEY" \
  -H "X-LegiPro-Tenant: $LEGIPRO_TENANT" \
  -H "X-LegiPro-Workspace: $LEGIPRO_WORKSPACE" \
  -H "X-LegiPro-Cost-Units: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "facturation electronique PDP PPF obligation reception",
    "mode": "balanced",
    "limit": 5,
    "strictReferences": true
  }'
```

## 3. Retrieve

```bash
curl -sS "$LEGIPRO_BASE_URL/v1/retrieve" \
  -H "Authorization: Bearer $LEGIPRO_API_KEY" \
  -H "X-LegiPro-Tenant: $LEGIPRO_TENANT" \
  -H "X-LegiPro-Workspace: $LEGIPRO_WORKSPACE" \
  -H "X-LegiPro-Cost-Units: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "artifact_id": "artifact-or-source-id-from-search"
  }'
```

## 4. GraphQL

```bash
curl -sS "$LEGIPRO_BASE_URL/graphql" \
  -H "Authorization: Bearer $LEGIPRO_API_KEY" \
  -H "X-LegiPro-Tenant: $LEGIPRO_TENANT" \
  -H "X-LegiPro-Workspace: $LEGIPRO_WORKSPACE" \
  -H "X-LegiPro-Cost-Units: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query($q: String!) { search(query: $q, limit: 3) { title source score } }",
    "variables": { "q": "TVA facturation electronique" }
  }'
```

## 5. MCP Tool Call

```bash
curl -sS "$LEGIPRO_BASE_URL/mcp" \
  -H "Authorization: Bearer $LEGIPRO_API_KEY" \
  -H "X-LegiPro-Tenant: $LEGIPRO_TENANT" \
  -H "X-LegiPro-Workspace: $LEGIPRO_WORKSPACE" \
  -H "X-LegiPro-Cost-Units: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "quickstart-search",
    "method": "tools/call",
    "params": {
      "name": "search_sources",
      "arguments": {
        "query": "facturation electronique",
        "limit": 3
      }
    }
  }'
```

## 6. No-Credential E-Invoicing/VAT Proof Fixture

For first product/partner screening, LegiPro ships a credential-free proof fixture for an e-invoicing/VAT workflow. It uses public/test data only and demonstrates how a partner product could send invoice/workflow context and receive a source-backed draft review packet, missing facts, caution points, a draft dossier/export id, an audit id and a partner-shaped handoff payload.

Public fixture:

```text
https://legipro.fr/assets/legipro-einvoicing-vat-proof-fixture-2026-06-29.json
```

Local reproduction:

```bash
python3 scripts/build_legipro_einvoicing_partner_proof_fixture.py --json
```

The fixture is deliberately not a live third-party integration. It does not require partner credentials, does not call a live partner API and keeps all professional-readiness flags false.

## Contracts

- Static OpenAPI snapshot: `https://legipro.fr/assets/legipro-openapi-2026-06-27.json`
- Partner contract: `https://legipro.fr/assets/legipro-api-contract-2026-06-27.json`
- No-credential e-invoicing/VAT fixture: `https://legipro.fr/assets/legipro-einvoicing-vat-proof-fixture-2026-06-29.json`
- Roadmap: `https://legipro.fr/assets/legipro-saas-roadmap.json`

## Boundaries

- Server-side bearer-token use only.
- Product/demo tokens must not call `/v0/rotor/*`.
- `scenario_ready=false`
- `answer_ready=false`
- `promotion_allowed=false`
- `human_review_complete=false`
- `client_reliance=false`
- `semantic_search_active=false`
- `professional_certification=false`

Scenario remains locked. Semantic/vector search remains planned. A repo-only TypeScript/Node beta SDK now exists for server-side diligence and local integration testing; Python remains planned and no public registry release is claimed.
