MENU navbar-image
logo

Introduction

Complete RESTful API for LegalCity debt recovery and legal services management

Welcome to the LegalCity API

The LegalCity API is a powerful RESTful interface that enables seamless integration with LegalCity’s legal and debt collection platform. This documentation provides everything you need to connect, authenticate, and interact with our system programmatically.

Overview

The LegalCity API gives you direct access to the LegalCity database, allowing you to:

Key Features

Documentation Guide

Code examples are available in the dark panel on the right. You can switch between supported languages (JavaScript, Bash, etc.) using the tabs above.

This documentation describes the development (sandbox) environment. Be sure to use the appropriate endpoint URLs when deploying to production.

By default, your account is activated in our Sandbox environment. Once your integration tests are complete, you can request production access by contacting your LegalCity account manager or emailing "contact@legalcity.fr"

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_ACCESS_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

API System & Health

System status and API information endpoints.

Health Check

Returns the current status of the API service and server timestamp. Use this endpoint to verify that the API is running and accessible.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/health" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/health"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/health';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/health'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "status": "ok",
    "timestamp": "2025-10-31T14:30:00.000000Z",
    "version": "2.0"
}
 

Request      

GET api/health

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

API Information

Provides comprehensive information about the LegalCity API including available endpoints, authentication details, and documentation links. This endpoint is useful for API discovery and integration setup.

Features:

Use Cases:

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/info" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/info"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/info';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/info'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
  "api_name": "LegalCity Recovery API",
  "version": "2.0",
  "description": "Comprehensive API for legal debt recovery management",
  "documentation": "https://apiv2-sandbox.legalcity.fr/docs",
  "postman_collection": "https://apiv2-sandbox.legalcity.fr/docs/collection.json",
  "openapi_spec": "https://apiv2-sandbox.legalcity.fr/docs/openapi.yaml",
  "auth": {
    "type": "Bearer Token (OAuth2)",
    "login_endpoint": "https://apiv2-sandbox.legalcity.fr/api/auth/login",
    "register_endpoint": "https://apiv2-sandbox.legalcity.fr/api/auth/register",
    "logout_endpoint": "https://apiv2-sandbox.legalcity.fr/api/auth/logout",
    "me_endpoint": "https://apiv2-sandbox.legalcity.fr/api/auth/me"
  },
  "endpoints": {
    "auth": "https://apiv2-sandbox.legalcity.fr/api/auth",
    "recoveries": "https://apiv2-sandbox.legalcity.fr/api/recoveries",
    "companies": "https://apiv2-sandbox.legalcity.fr/api/recoveries/{recoveryId}/companies",
    "documents": "https://apiv2-sandbox.legalcity.fr/api/recoveries/{recoveryId}/docs",
    "invoices": "https://apiv2-sandbox.legalcity.fr/api/recoveries/{recoveryId}/invoices",
    "comments": "https://apiv2-sandbox.legalcity.fr/api/recoveries/{recoveryId}/comments",
    "protected_invoices": "https://apiv2-sandbox.legalcity.fr/api/protected-invoices",
    "scoring": "https://apiv2-sandbox.legalcity.fr/api/scoring",
    "health": "https://apiv2-sandbox.legalcity.fr/api/health"
  },
  "features": {
    "recovery_management": "Complete debt recovery case management",
    "company_tracking": "Customer and debtor information management",
    "document_upload": "Secure document storage and retrieval",
    "invoice_tracking": "Invoice management with payment status",
    "comment_system": "Internal and external communication tracking",
    "protected_invoices": "Secure invoice storage with tracking codes",
    "scoring_services": "Credit scoring and solvency reports"
  },
  "supported_formats": {
    "response_format": "JSON",
    "authentication": "Bearer Token (OAuth2)",
    "file_uploads": "PDF, DOC, DOCX, XLS, XLSX, JPG, PNG, GIF (max 10MB)",
    "date_format": "YYYY-MM-DD",
    "datetime_format": "ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)"
  },
  "rate_limits": {
    "login_attempts": "5 per minute per IP",
    "api_requests": "1000 per hour per user",
    "file_uploads": "50 per hour per user"
  },
  "contact": {
    "support": "amine@legalcity.fr",
    "documentation": "https://apiv2-sandbox.legalcity.fr/docs",
  }
}
 

Request      

GET api/info

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Not Found Handler

Catches all undefined API routes and returns a standardized 404 error response. This ensures consistent error formatting across the API.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/|{+-0p" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/|{+-0p"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/|{+-0p';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/|{+-0p'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (404):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
 

{
    "success": false,
    "message": "API endpoint not found"
}
 

Request      

GET api/{fallbackPlaceholder}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

fallbackPlaceholder   string   

Example: |{+-0p

Authentication & User Sessions

Endpoints for handling user authentication, registration, and session management.

Login

Authenticate a user using their email and API key credentials. Returns an access token (Bearer) required for authorized API requests.

Use this endpoint to obtain a valid authentication token before accessing any protected routes within the LegalCity API.

Rate Limiting: This endpoint is limited to 5 attempts per minute per IP address. After 5 failed attempts, wait 1 minute before trying again.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"john@example.com\",
    \"key\": \"06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "john@example.com",
    "key": "06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/auth/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'john@example.com',
            'key' => '06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/auth/login'
payload = {
    "email": "john@example.com",
    "key": "06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "entreprise": "Company SARL",
      "can_register": true,
    },
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
    "token_type": "Bearer"
  },
  "message": "Login successful"
}
 

Example response (401):


{
    "success": false,
    "message": "Invalid credentials provided"
}
 

Example response (403):


{
    "success": false,
    "message": "You do not have permission to access this resource."
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed.",
    "errors": {
        "email": [
            "The email field is required."
        ],
        "key": [
            "The key field is required."
        ]
    }
}
 

Example response (429):


{
    "success": false,
    "message": "Too Many Attempts. Please wait 60 seconds before trying again."
}
 

Example response (500):


{
    "success": false,
    "message": "Authentication failed"
}
 

Request      

POST api/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The user's registered email address. Example: john@example.com

key   string   

The user's unique API key. Example: 06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5

User Registration

requires authentication

Create a new user account or update existing user with API access. Requires an authenticated user with "can_register" permission.

Important: This endpoint returns API credentials (api_key and auth_secret) for newly registered users. Store these securely as they won't be shown again.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/auth/register" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"email\": \"john@example.com\",
    \"entreprise\": \"Company SARL\",
    \"siren\": \"123456789\",
    \"address\": \"123 Main St\",
    \"city\": \"Paris\",
    \"postal\": \"75001\",
    \"phone\": \"+33123456789\",
    \"metadata\": {
        \"custom_field\": \"value\",
        \"preferences\": {
            \"theme\": \"dark\"
        }
    }
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/auth/register"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "entreprise": "Company SARL",
    "siren": "123456789",
    "address": "123 Main St",
    "city": "Paris",
    "postal": "75001",
    "phone": "+33123456789",
    "metadata": {
        "custom_field": "value",
        "preferences": {
            "theme": "dark"
        }
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/auth/register';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'email' => 'john@example.com',
            'entreprise' => 'Company SARL',
            'siren' => '123456789',
            'address' => '123 Main St',
            'city' => 'Paris',
            'postal' => '75001',
            'phone' => '+33123456789',
            'metadata' => [
                'custom_field' => 'value',
                'preferences' => [
                    'theme' => 'dark',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/auth/register'
payload = {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "entreprise": "Company SARL",
    "siren": "123456789",
    "address": "123 Main St",
    "city": "Paris",
    "postal": "75001",
    "phone": "+33123456789",
    "metadata": {
        "custom_field": "value",
        "preferences": {
            "theme": "dark"
        }
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "entreprise": "Company SARL",
      "can_register": false,
      "api_key": "06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5",
      "auth_secret": "uuid-secret-string",
    }
  },
  "message": "User already exists with API access"
}
 

Example response (201):


{
  "success": true,
  "data": {
    "user": {
      "id": 1,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "entreprise": "Company SARL",
      "can_register": false,
      "api_key": "06572215-cb86-4ca2-b6b1-2ba6ceb1e8a5",
      "auth_secret": "uuid-secret-string",
    }
  },
  "message": "User registered successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "You do not have permission to access this resource."
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "email": [
            "The email field is required."
        ],
        "first_name": [
            "The first name field is required."
        ]
    }
}
 

Request      

POST api/auth/register

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

first_name   string   

The user's first name. Example: John

last_name   string   

The user's last name. Example: Doe

email   string   

The user's email address. Example: john@example.com

entreprise   string   

Company name. Example: Company SARL

siren   string   

Company SIREN number. Example: 123456789

address   string   

Company address. Example: 123 Main St

city   string   

City. Example: Paris

postal   string   

Postal code. Example: 75001

phone   string   

Phone number. Example: +33123456789

metadata   object  optional  

optional Additional JSON metadata for future use.

Logout

requires authentication

Revoke the current user's access token and invalidate the session. After logout, the provided Bearer token will no longer be valid for API requests.

Note: Once logged out, you'll need to call the login endpoint again to obtain a new access token.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/auth/logout" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/auth/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/auth/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/auth/logout'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Logout successful"
}
 

Example response (401):


{
    "success": false,
    "message": "User not authenticated"
}
 

Request      

POST api/auth/logout

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Refresh Token

requires authentication

Refresh the current access token by revoking the old one and issuing a new one. Use this endpoint to obtain a fresh token without requiring the user to login again.

Important: After calling this endpoint, use the new token for all subsequent requests. The old token will be immediately revoked and no longer valid.

Rate Limiting: Limited to 10 attempts per minute to prevent abuse.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/auth/refresh" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/auth/refresh"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/auth/refresh';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/auth/refresh'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
        "token_type": "Bearer"
    },
    "message": "Token refreshed successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "User not authenticated"
}
 

Example response (500):


{
    "success": false,
    "message": "Token refresh failed"
}
 

Request      

POST api/auth/refresh

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Get Authenticated User

requires authentication

Retrieve the currently authenticated user's profile information including API access status and registration permissions.

Use this endpoint to verify your authentication status and get current user details.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/auth/me" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/auth/me"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/auth/me';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/auth/me'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "entreprise": "Company SARL",
    "can_register": true,
  },
  "message": "User retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Request      

GET api/auth/me

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Recovery Management

Complete API for managing debt recovery cases with support for both amicable recovery and legal injunction procedures. Includes CRUD operations, statistics, and injunction transfers. All business rules and validation are configurable through the system settings.

Create Complete Recovery Case

requires authentication

Create a complete recovery case with customer, debtor companies, and invoices in a single request. This endpoint combines the functionality of creating a recovery case, customer company, debtor company, and multiple invoices in one atomic transaction.

Workflow:

  1. Creates the recovery case with all financial parameters
  2. Creates customer company (creditor) and associates it with recovery
  3. Creates debtor company and associates it with recovery
  4. Creates all provided invoices and associates them with recovery
  5. Updates recovery totals based on invoice amounts

Important Notes:

Invoice Array Examples:

// No invoices
"invoices": []

// Single invoice
"invoices": [
  {"invoice_number": "INV-001", "invoice_date": "2025-10-20", "invoice_amount": 1500.00}
]

// Multiple invoices
"invoices": [
  {"invoice_number": "INV-001", "invoice_date": "2025-10-20", "invoice_amount": 1500.00},
  {"invoice_number": "INV-002", "invoice_date": "2025-10-21", "invoice_amount": 2000.00, "invoice_part_paid": true, "invoice_part_paid_amount": 500.00},
  {"invoice_number": "INV-003", "invoice_date": "2025-10-22", "invoice_amount": 800.00}
]
Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/complete" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"recovery\": {
        \"recovery_service_object\": \"Web development services\",
        \"recovery_due_date\": \"2025-12-31\",
        \"recovery_late_interest\": true,
        \"recovery_interest_rate\": \"yes\",
        \"recovery_interest_rate_percent\": \"5.50\",
        \"recovery_penalty\": true,
        \"recovery_penalty_type\": \"montant\",
        \"recovery_penalty_amount\": \"150.00\",
        \"recovery_penalty_percent\": \"10.00\",
        \"recovery_raison_notpaid\": 1,
        \"recovery_observations\": \"Client experiencing financial difficulties\",
        \"type\": 1,
        \"assign_to_me\": true
    },
    \"customer\": {
        \"company_type\": \"commercial\",
        \"company_legal_form\": \"SARL\",
        \"company_siren\": \"123456789\",
        \"company_name\": \"ABC Corp\",
        \"company_legalrep_firstname\": \"John\",
        \"company_legalrep_lastname\": \"Doe\",
        \"company_legalrep_gender\": \"M\",
        \"company_legalrep_quality\": 1,
        \"company_address\": \"123 Main St\",
        \"company_city\": \"Paris\",
        \"company_postal\": \"75001\",
        \"company_country\": \"France\",
        \"company_email\": \"john@abc.com\",
        \"company_phone\": \"+33123456789\"
    },
    \"debtor\": {
        \"company_type\": \"commercial\",
        \"company_legal_form\": \"SAS\",
        \"company_siren\": \"987654321\",
        \"company_name\": \"XYZ Ltd\",
        \"company_legalrep_firstname\": \"Jane\",
        \"company_legalrep_lastname\": \"Smith\",
        \"company_legalrep_gender\": \"Mme\",
        \"company_address\": \"456 Oak Ave\",
        \"company_city\": \"Lyon\",
        \"company_postal\": \"69001\",
        \"company_country\": \"France\",
        \"company_email\": \"jane@xyz.com\",
        \"company_phone\": \"+33987654321\"
    },
    \"invoices\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/complete"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "recovery": {
        "recovery_service_object": "Web development services",
        "recovery_due_date": "2025-12-31",
        "recovery_late_interest": true,
        "recovery_interest_rate": "yes",
        "recovery_interest_rate_percent": "5.50",
        "recovery_penalty": true,
        "recovery_penalty_type": "montant",
        "recovery_penalty_amount": "150.00",
        "recovery_penalty_percent": "10.00",
        "recovery_raison_notpaid": 1,
        "recovery_observations": "Client experiencing financial difficulties",
        "type": 1,
        "assign_to_me": true
    },
    "customer": {
        "company_type": "commercial",
        "company_legal_form": "SARL",
        "company_siren": "123456789",
        "company_name": "ABC Corp",
        "company_legalrep_firstname": "John",
        "company_legalrep_lastname": "Doe",
        "company_legalrep_gender": "M",
        "company_legalrep_quality": 1,
        "company_address": "123 Main St",
        "company_city": "Paris",
        "company_postal": "75001",
        "company_country": "France",
        "company_email": "john@abc.com",
        "company_phone": "+33123456789"
    },
    "debtor": {
        "company_type": "commercial",
        "company_legal_form": "SAS",
        "company_siren": "987654321",
        "company_name": "XYZ Ltd",
        "company_legalrep_firstname": "Jane",
        "company_legalrep_lastname": "Smith",
        "company_legalrep_gender": "Mme",
        "company_address": "456 Oak Ave",
        "company_city": "Lyon",
        "company_postal": "69001",
        "company_country": "France",
        "company_email": "jane@xyz.com",
        "company_phone": "+33987654321"
    },
    "invoices": [
        "architecto"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/complete';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'recovery' => [
                'recovery_service_object' => 'Web development services',
                'recovery_due_date' => '2025-12-31',
                'recovery_late_interest' => true,
                'recovery_interest_rate' => 'yes',
                'recovery_interest_rate_percent' => '5.50',
                'recovery_penalty' => true,
                'recovery_penalty_type' => 'montant',
                'recovery_penalty_amount' => '150.00',
                'recovery_penalty_percent' => '10.00',
                'recovery_raison_notpaid' => 1,
                'recovery_observations' => 'Client experiencing financial difficulties',
                'type' => 1,
                'assign_to_me' => true,
            ],
            'customer' => [
                'company_type' => 'commercial',
                'company_legal_form' => 'SARL',
                'company_siren' => '123456789',
                'company_name' => 'ABC Corp',
                'company_legalrep_firstname' => 'John',
                'company_legalrep_lastname' => 'Doe',
                'company_legalrep_gender' => 'M',
                'company_legalrep_quality' => 1,
                'company_address' => '123 Main St',
                'company_city' => 'Paris',
                'company_postal' => '75001',
                'company_country' => 'France',
                'company_email' => 'john@abc.com',
                'company_phone' => '+33123456789',
            ],
            'debtor' => [
                'company_type' => 'commercial',
                'company_legal_form' => 'SAS',
                'company_siren' => '987654321',
                'company_name' => 'XYZ Ltd',
                'company_legalrep_firstname' => 'Jane',
                'company_legalrep_lastname' => 'Smith',
                'company_legalrep_gender' => 'Mme',
                'company_address' => '456 Oak Ave',
                'company_city' => 'Lyon',
                'company_postal' => '69001',
                'company_country' => 'France',
                'company_email' => 'jane@xyz.com',
                'company_phone' => '+33987654321',
            ],
            'invoices' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/complete'
payload = {
    "recovery": {
        "recovery_service_object": "Web development services",
        "recovery_due_date": "2025-12-31",
        "recovery_late_interest": true,
        "recovery_interest_rate": "yes",
        "recovery_interest_rate_percent": "5.50",
        "recovery_penalty": true,
        "recovery_penalty_type": "montant",
        "recovery_penalty_amount": "150.00",
        "recovery_penalty_percent": "10.00",
        "recovery_raison_notpaid": 1,
        "recovery_observations": "Client experiencing financial difficulties",
        "type": 1,
        "assign_to_me": true
    },
    "customer": {
        "company_type": "commercial",
        "company_legal_form": "SARL",
        "company_siren": "123456789",
        "company_name": "ABC Corp",
        "company_legalrep_firstname": "John",
        "company_legalrep_lastname": "Doe",
        "company_legalrep_gender": "M",
        "company_legalrep_quality": 1,
        "company_address": "123 Main St",
        "company_city": "Paris",
        "company_postal": "75001",
        "company_country": "France",
        "company_email": "john@abc.com",
        "company_phone": "+33123456789"
    },
    "debtor": {
        "company_type": "commercial",
        "company_legal_form": "SAS",
        "company_siren": "987654321",
        "company_name": "XYZ Ltd",
        "company_legalrep_firstname": "Jane",
        "company_legalrep_lastname": "Smith",
        "company_legalrep_gender": "Mme",
        "company_address": "456 Oak Ave",
        "company_city": "Lyon",
        "company_postal": "69001",
        "company_country": "France",
        "company_email": "jane@xyz.com",
        "company_phone": "+33987654321"
    },
    "invoices": [
        "architecto"
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "recovery": {
            "id": 25,
            "recovery_reference": "REC-XYZ123",
            "recovery_service_object": "Web development services",
            "recovery_last_status": 1,
            "recovery_due_date": "2025-12-31",
            "amount": "3000.00",
            "amount_torecover": "3000.00",
            "user_id": 1,
            "created_at": "2025-12-07T10:30:00.000000Z"
        },
        "customer": {
            "id": 15,
            "company_name": "ABC Corp",
            "company_legalrep_firstname": "John",
            "company_legalrep_lastname": "Doe",
            "company_email": "john@abc.com"
        },
        "debtor": {
            "id": 16,
            "company_name": "XYZ Ltd",
            "company_legalrep_firstname": "Jane",
            "company_legalrep_lastname": "Smith",
            "company_email": "jane@xyz.com"
        },
        "invoices": [
            {
                "id": 42,
                "invoice_number": "INV-2025-001",
                "invoice_amount": "1500.00",
                "invoice_date": "2025-10-20",
                "remaining_amount": "1500.00"
            },
            {
                "id": 43,
                "invoice_number": "INV-2025-002",
                "invoice_amount": "1500.00",
                "invoice_date": "2025-10-21",
                "remaining_amount": "1500.00"
            }
        ],
        "summary": {
            "total_invoices": 2,
            "total_amount": "3000.00",
            "total_remaining": "3000.00"
        }
    },
    "message": "Complete recovery case created successfully"
}
 

Example response (201, Without invoices):


{
  "success": true,
  "data": {
    "recovery": {
      "id": 26,
      "recovery_reference": "REC-ABC456",
      "amount": "0.00",
      "amount_torecover": "0.00"
    },
    "customer": {...},
    "debtor": {...},
    "invoices": [],
    "summary": {
      "total_invoices": 0,
      "total_amount": "0.00",
      "total_remaining": "0.00"
    }
  },
  "message": "Complete recovery case created successfully"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "recovery.recovery_service_object": [
            "The recovery service object field is required."
        ],
        "customer.company_legalrep_firstname": [
            "The customer legal representative first name is required."
        ],
        "debtor.company_legalrep_lastname": [
            "The debtor legal representative last name is required."
        ],
        "invoices.0.invoice_number": [
            "The invoice number field is required."
        ]
    }
}
 

Example response (500):


{
    "success": false,
    "message": "Failed to create complete recovery case"
}
 

Request      

POST api/recoveries/complete

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

recovery   object   

Recovery case information

recovery_service_object   string   

Description of the service or product. Example: Web development services

recovery_due_date   date   

Payment due date. Example: 2025-12-31

recovery_late_interest   boolean  optional  

optional Apply late payment interest. Default: false. Example: true

recovery_interest_rate   string  optional  

optional Interest rate type (yes/no). Example: yes

recovery_interest_rate_percent   numeric  optional  

optional Interest rate percentage (0-100). Required if recovery_interest_rate is 'yes'. Example: 5.50

recovery_penalty   boolean  optional  

optional Apply penalty. Default: false. Example: true

recovery_penalty_type   string  optional  

optional Penalty type (montant/pourcent). Required if recovery_penalty is true. Example: montant

recovery_penalty_amount   numeric  optional  

optional Penalty fixed amount. Required if penalty_type is 'montant'. Example: 150.00

recovery_penalty_percent   numeric  optional  

optional Penalty percentage. Required if penalty_type is 'pourcent'. Example: 10.00

recovery_raison_notpaid   integer  optional  

optional Reason code for non-payment. Example: 1

recovery_observations   string  optional  

optional Additional observations. Example: Client experiencing financial difficulties

type   integer  optional  

optional Recovery type (1=amicable, 2=injunction). Default: 1. Example: 1

assign_to_me   boolean  optional  

optional Assign case to authenticated user. Default: true. Example: true

customer   object   

Customer (creditor) company information

company_type   string  optional  

optional Company type (particular, commercial, freelance, liberal, civil, association). Example: commercial

company_legal_form   string  optional  

optional Legal form (SAS, SARL, SA, SNC, GIE). Required for commercial/civil/association. Example: SARL

company_siren   string  optional  

optional SIREN number. Required for commercial/civil/association. Example: 123456789

company_name   string  optional  

optional Company name. Required for commercial/civil/association. Example: ABC Corp

company_legalrep_firstname   string   

Legal representative first name. Example: John

company_legalrep_lastname   string   

Legal representative last name. Example: Doe

company_legalrep_gender   string  optional  

optional Gender (M, Mme). Example: M

company_legalrep_quality   integer  optional  

optional Representative quality/position. Example: 1

company_address   string  optional  

optional Full address. Example: 123 Main St

company_city   string  optional  

optional City. Example: Paris

company_postal   string  optional  

optional Postal code. Example: 75001

company_country   string  optional  

optional Country. Example: France

company_email   email  optional  

optional Email address. Example: john@abc.com

company_phone   string  optional  

optional Phone number. Example: +33123456789

debtor   object   

Debtor company information (same fields as customer)

company_type   string  optional  

optional Company type. Example: commercial

company_legal_form   string  optional  

optional Legal form. Example: SAS

company_siren   string  optional  

optional SIREN number. Example: 987654321

company_name   string  optional  

optional Company name. Example: XYZ Ltd

company_legalrep_firstname   string   

Legal representative first name. Example: Jane

company_legalrep_lastname   string   

Legal representative last name. Example: Smith

company_legalrep_gender   string  optional  

optional Gender. Example: Mme

company_address   string  optional  

optional Full address. Example: 456 Oak Ave

company_city   string  optional  

optional City. Example: Lyon

company_postal   string  optional  

optional Postal code. Example: 69001

company_country   string  optional  

optional Country. Example: France

company_email   email  optional  

optional Email address. Example: jane@xyz.com

company_phone   string  optional  

optional Phone number. Example: +33987654321

invoices   string[]  optional  

optional Array of invoice objects (0 or more)

invoice_number   string   

Unique invoice number. Example: INV-2025-001

invoice_date   date   

Invoice issue date. Example: 2025-10-20

invoice_due_date   date  optional  

optional Payment due date. Example: 2025-11-20

invoice_amount   numeric   

Invoice amount. Example: 1500.00

invoice_part_paid   boolean  optional  

optional Partial payment status. Default: false. Example: false

invoice_part_paid_amount   numeric  optional  

optional Partial payment amount. Example: 500.00

api_invoice_id   string  optional  

optional Client internal reference. Example: CLIENT-REF-001

List Recovery Cases

requires authentication

Retrieve a paginated list of debt recovery cases for the authenticated user with advanced filtering, sorting, and search capabilities. Supports both amicable recovery and injunction procedures with comprehensive status tracking.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries?status=1&search=John&sort_by=recovery_reference&sort_order=asc&per_page=20&page=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries"
);

const params = {
    "status": "1",
    "search": "John",
    "sort_by": "recovery_reference",
    "sort_order": "asc",
    "per_page": "20",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'status' => '1',
            'search' => 'John',
            'sort_by' => 'recovery_reference',
            'sort_order' => 'asc',
            'per_page' => '20',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries'
params = {
  'status': '1',
  'search': 'John',
  'sort_by': 'recovery_reference',
  'sort_order': 'asc',
  'per_page': '20',
  'page': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "recoveries": [
            {
                "id": 1,
                "recovery_reference": "REC-ABC123",
                "debtor_name": "John Doe",
                "debtor_company": "Example Corp",
                "customer_company": "LegalCity SARL",
                "amount": "1500.00",
                "amount_torecover": "1500.00",
                "recovery_last_status": 1,
                "recovery_due_date": "2025-11-20",
                "created_at": "2025-10-20T10:30:00.000000Z",
                "updated_at": "2025-10-20T10:30:00.000000Z",
                "status": {
                    "id": 1,
                    "name": "Dossier Créé",
                    "description": "Recovery case created and awaiting processing"
                },
                "user": {
                    "id": 1,
                    "first_name": "John",
                    "last_name": "Doe"
                },
                "invoices_count": 2,
                "comments_count": 5
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 15,
            "total": 50,
            "last_page": 4,
            "from": 1,
            "to": 15,
            "has_more_pages": true
        },
        "filters_applied": {
            "status": 1,
            "search": null,
            "sort_by": "created_at",
            "sort_order": "desc"
        }
    },
    "message": "Recoveries retrieved successfully. Total: 50 recoveries found."
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "status": [
            "The selected status filter is invalid."
        ],
        "sort_by": [
            "The selected sort field is invalid."
        ],
        "per_page": [
            "The per page field must be between 1 and 100."
        ]
    }
}
 

Request      

GET api/recoveries

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

status   integer  optional  

optional Filter by recovery status group. Available groups:
1 = Dossier Créé
2 = Relance 1
3 = Relance 2
Example: 1

search   string  optional  

optional Search across multiple fields including reference, debtor name, debtor company name, and customer company name. Example: John

sort_by   string  optional  

optional Sort by recovery field. Available fields:
id - Recovery ID
recovery_reference - Recovery reference
recovery_service_object - Service description
recovery_last_status - Status ID
recovery_due_date - Due date
amount - Total amount
amount_torecover - Amount to recover
user_id - Assigned user ID
created_at - Creation date
updated_at - Last update date
debtor_name - Debtor name
debtor_company - Debtor company name
customer_company - Customer company name
Defaults to created_at. Example: recovery_reference

sort_order   string  optional  

optional Sort order (asc/desc). Defaults to desc. Example: asc

per_page   integer  optional  

optional Items per page (max configurable limit). Defaults to configured value. Example: 20

page   integer  optional  

optional Page number for pagination. Defaults to 1. Example: 1

POST api/recoveries

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request      

POST api/recoveries

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get Recovery Case Details

requires authentication

Retrieve comprehensive details of a specific recovery case including all related entities: companies, invoices, documents, comments, status history, payments, and debts. Includes ownership verification for security.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/15" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "id": 15,
    "recovery_reference": "REC-ABC123",
    "recovery_status": 2,
    "amount": "1500.00",
    "amount_torecover": "1500.00",
    "user": {...},
    "customer": {...},
    "debtor": {...},
    "status": {...},
    "statusHistory": [...],
    "invoices": [...],
    "docs": [...],
    "comments": [...],
    "acomptes": [...],
    "dettes": [...],
    "all_docs": [...]
  },
  "message": "Recovery retrieved successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this recovery"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery not found"
}
 

Request      

GET api/recoveries/{id}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the recovery case. Example: 15

Update Recovery Case

requires authentication

Update an existing recovery case with new information. Uses configurable validation rules for updates and maintains data integrity. Only the recovery owner can modify the case.

Example request:
curl --request PUT \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": 1,
    \"recovery_service_object\": \"Updated web development services\",
    \"recovery_raison_notpaid\": 3,
    \"recovery_observations\": \"Latest client communication\",
    \"recovery_due_date\": \"2026-01-31\",
    \"recovery_late_interest\": true,
    \"recovery_interest_rate\": \"yes\",
    \"recovery_interest_rate_percent\": \"6.0\",
    \"recovery_penalty\": false,
    \"recovery_penalty_type\": \"amount\",
    \"recovery_penalty_amount\": \"150.00\",
    \"recovery_penalty_percent\": \"12.0\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": 1,
    "recovery_service_object": "Updated web development services",
    "recovery_raison_notpaid": 3,
    "recovery_observations": "Latest client communication",
    "recovery_due_date": "2026-01-31",
    "recovery_late_interest": true,
    "recovery_interest_rate": "yes",
    "recovery_interest_rate_percent": "6.0",
    "recovery_penalty": false,
    "recovery_penalty_type": "amount",
    "recovery_penalty_amount": "150.00",
    "recovery_penalty_percent": "12.0"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 1,
            'recovery_service_object' => 'Updated web development services',
            'recovery_raison_notpaid' => 3,
            'recovery_observations' => 'Latest client communication',
            'recovery_due_date' => '2026-01-31',
            'recovery_late_interest' => true,
            'recovery_interest_rate' => 'yes',
            'recovery_interest_rate_percent' => '6.0',
            'recovery_penalty' => false,
            'recovery_penalty_type' => 'amount',
            'recovery_penalty_amount' => '150.00',
            'recovery_penalty_percent' => '12.0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15'
payload = {
    "type": 1,
    "recovery_service_object": "Updated web development services",
    "recovery_raison_notpaid": 3,
    "recovery_observations": "Latest client communication",
    "recovery_due_date": "2026-01-31",
    "recovery_late_interest": true,
    "recovery_interest_rate": "yes",
    "recovery_interest_rate_percent": "6.0",
    "recovery_penalty": false,
    "recovery_penalty_type": "amount",
    "recovery_penalty_amount": "150.00",
    "recovery_penalty_percent": "12.0"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "id": 15,
    "recovery_reference": "REC-ABC123",
    "recovery_service_object": "Updated web development services",
    "updated_at": "2025-10-23T15:30:00.000000Z",
    "user": {...},
    "customer": {...},
    "debtor": {...},
    "status": {...}
  },
  "message": "Recovery updated successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this recovery"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "recovery_interest_rate_percent": [
            "The interest rate must be between 0 and 100."
        ]
    }
}
 

Request      

PUT api/recoveries/{id}

PATCH api/recoveries/{id}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the recovery case to update. Example: 15

Body Parameters

type   integer  optional  

optional Recovery type. Available options:
1 = Amicable recovery
2 = Injunction procedure
Example: 1

recovery_service_object   string  optional  

optional Updated description of services/products. Example: Updated web development services

recovery_raison_notpaid   integer  optional  

optional Updated reason for non-payment. Available options:
0 = Other
1 = Bad payer
2 = Temporary financial difficulties
3 = Major financial difficulties
4 = Service poorly performed
5 = Service partially carried out
6 = Service never requested
7 = None
8 = Other
Example: 3

recovery_observations   string  optional  

optional Updated additional observations. Example: Latest client communication

recovery_due_date   date  optional  

optional Updated due date for payment. Example: 2026-01-31

recovery_late_interest   boolean  optional  

optional Updated late interest setting. When false, recovery_interest_rate and recovery_interest_rate_percent must be null. Example: true

recovery_interest_rate   string  optional  

optional Updated interest rate type (required when recovery_late_interest is true). Available options:
no = No interest rate
yes = Custom rate (requires recovery_interest_rate_percent)
yes 3 = Legal rate (3x)
Must be null when recovery_late_interest is false. Example: yes

recovery_interest_rate_percent   numeric  optional  

optional Updated interest rate percentage (0-100). Required when recovery_interest_rate is "yes", otherwise must be null. Example: 6.0

recovery_penalty   boolean  optional  

optional Updated penalty setting. When false, recovery_penalty_type, recovery_penalty_amount and recovery_penalty_percent must be null. Example: false

recovery_penalty_type   string  optional  

optional Updated penalty calculation type (required when recovery_penalty is true). Available options:
amount = Fixed amount (requires recovery_penalty_amount)
percent = Percentage (requires recovery_penalty_percent)
Must be null when recovery_penalty is false. Example: amount

recovery_penalty_amount   numeric  optional  

optional Updated fixed penalty amount. Required when recovery_penalty_type is "amount", otherwise must be null. Example: 150.00

recovery_penalty_percent   numeric  optional  

optional Updated penalty percentage (0-100). Required when recovery_penalty_type is "percent", otherwise must be null. Example: 12.0

Delete Recovery Case

requires authentication

Permanently delete a recovery case from the system. This action is irreversible and will cascade delete all related entities including companies, invoices, comments, and status history. Only the recovery owner can delete the case.

Example request:
curl --request DELETE \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Recovery deleted successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this recovery"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery not found"
}
 

Request      

DELETE api/recoveries/{id}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   string   

The ID of the recovery case to delete. Example: 15

Transfer Recovery to Injunction Procedure

requires authentication

Transform an amicable recovery case into a legal injunction procedure ("injonction de payer"). This endpoint validates eligibility requirements and handles the complete transfer process including entity duplication, specialized configuration, and legal procedure tracking. Supports both national and European injunction procedures based on debtor country and business rules.

Eligibility Requirements:

Process Flow:

  1. Validates ownership (404 if not found, 403 if unauthorized)
  2. Validates eligibility requirements (status, debtor country, product eligibility)
  3. Creates new injunction recovery with specialized configuration
  4. Duplicates customer and debtor companies with data integrity
  5. Copies unpaid/partially paid invoices only
  6. Duplicates all recovery comments with visibility settings
  7. Creates initial status history record
  8. Links original recovery to new injunction case
  9. Generates payment URLs and references
Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15/injonction-transfer" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15/injonction-transfer"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15/injonction-transfer';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15/injonction-transfer'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 45,
        "reference": "REC-INJC1234",
        "type": "INJONCTION DE PAYER",
        "assign_to_me": true,
        "customer_ref": "CUST-ABC123",
        "debtor_ref": "DEBT-DEF456",
        "url_pay": "https://api.legalcity.fr/injonction/INJC1234KEY"
    },
    "message": "Recovery successfully transferred to injunction procedure"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this recovery"
}
 

Example response (403):


{
    "success": false,
    "message": "This recovery is not eligible for injunction transfer"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery not found"
}
 

Example response (500):


{
    "success": false,
    "message": "An error occurred during injunction transfer"
}
 

Request      

POST api/recoveries/{recovery}/injonction-transfer

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recovery   integer   

The ID of the recovery case to transfer to injunction. Example: 15

Company Management

APIs for managing company information including customers and debtors

List Companies

requires authentication

Get a paginated list of companies for a specific recovery case with optional filtering and search.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies?search=LegalCity&relation_type=customer&sort_by=company_name&sort_order=desc&per_page=20&page=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies"
);

const params = {
    "search": "LegalCity",
    "relation_type": "customer",
    "sort_by": "company_name",
    "sort_order": "desc",
    "per_page": "20",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search' => 'LegalCity',
            'relation_type' => 'customer',
            'sort_by' => 'company_name',
            'sort_order' => 'desc',
            'per_page' => '20',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies'
params = {
  'search': 'LegalCity',
  'relation_type': 'customer',
  'sort_by': 'company_name',
  'sort_order': 'desc',
  'per_page': '20',
  'page': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "companies": [
      {
        "id": 1,
        "company_type": "commercial",
        "company_legal_form": "SARL",
        "company_siren": "123456789",
        "company_name": "LegalCity SARL",
        "company_legalrep_gender": "M",
        "company_legalrep_firstname": "John",
        "company_legalrep_lastname": "Doe",
        "company_address": "123 Avenue des Champs",
        "company_city": "Paris",
        "company_postal": "75008",
        "company_country": "France",
        "company_email": "contact@legalcity.com",
        "company_phone": "+33123456789",
      }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 15,
      "total": 25,
      "last_page": 2,
      "from": 1,
      "to": 15,
      "has_more_pages": true
    },
    "filters_applied": {
      "search": "LegalCity",
      "relation_type": "customer",
      "sort_by": "company_legalrep_lastname",
      "sort_order": "asc"
    }
  },
  "message": "Companies retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "per_page": [
            "The per page field must be between 1 and 100."
        ],
        "relation_type": [
            "The relation type must be either customer or debtor."
        ]
    }
}
 

Request      

GET api/recoveries/{recoveryId}/companies

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

Query Parameters

search   string  optional  

optional Search in company name, firstname, lastname, email, phone, or SIREN. Example: LegalCity

relation_type   string  optional  

optional Filter by relation type in recovery (customer, debtor). Example: customer

sort_by   string  optional  

optional Sort by field. Defaults to company_legalrep_lastname. Example: company_name

sort_order   string  optional  

optional Sort order (asc/desc). Defaults to asc. Example: desc

per_page   integer  optional  

optional Items per page (max 100). Defaults to 15. Example: 20

page   integer  optional  

optional Page number. Defaults to 1. Example: 1

Create Company for Recovery

requires authentication

Create a new company that MUST be associated with the specified recovery case. Each recovery can have exactly 2 companies: 1 customer (creditor) and 1 debtor.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15/companies" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"relation_type\": \"customer\",
    \"company_type\": \"commercial\",
    \"company_legal_form\": \"SARL\",
    \"company_siren\": \"123456789\",
    \"company_name\": \"Example Corp\",
    \"company_legalrep_firstname\": \"John\",
    \"company_legalrep_lastname\": \"Doe\",
    \"company_legalrep_gender\": \"M\",
    \"company_legalrep_quality\": 1,
    \"company_legalrep_quality_other\": \"Fondateur\",
    \"company_freelance_type\": \"trader\",
    \"company_address\": \"123 Main Street\",
    \"company_city\": \"Paris\",
    \"company_postal\": \"75001\",
    \"company_country\": \"France\",
    \"company_email\": \"john@example.com\",
    \"company_phone\": \"+33123456789\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/15/companies"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "relation_type": "customer",
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "Example Corp",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_legalrep_gender": "M",
    "company_legalrep_quality": 1,
    "company_legalrep_quality_other": "Fondateur",
    "company_freelance_type": "trader",
    "company_address": "123 Main Street",
    "company_city": "Paris",
    "company_postal": "75001",
    "company_country": "France",
    "company_email": "john@example.com",
    "company_phone": "+33123456789"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15/companies';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'relation_type' => 'customer',
            'company_type' => 'commercial',
            'company_legal_form' => 'SARL',
            'company_siren' => '123456789',
            'company_name' => 'Example Corp',
            'company_legalrep_firstname' => 'John',
            'company_legalrep_lastname' => 'Doe',
            'company_legalrep_gender' => 'M',
            'company_legalrep_quality' => 1,
            'company_legalrep_quality_other' => 'Fondateur',
            'company_freelance_type' => 'trader',
            'company_address' => '123 Main Street',
            'company_city' => 'Paris',
            'company_postal' => '75001',
            'company_country' => 'France',
            'company_email' => 'john@example.com',
            'company_phone' => '+33123456789',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/15/companies'
payload = {
    "relation_type": "customer",
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "Example Corp",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_legalrep_gender": "M",
    "company_legalrep_quality": 1,
    "company_legalrep_quality_other": "Fondateur",
    "company_freelance_type": "trader",
    "company_address": "123 Main Street",
    "company_city": "Paris",
    "company_postal": "75001",
    "company_country": "France",
    "company_email": "john@example.com",
    "company_phone": "+33123456789"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
  "success": true,
  "data": {
    "id": 10,
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "LegalCity SARL",
    "company_legalrep_gender": "M",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_address": "123 Avenue des Champs",
    "company_city": "Paris",
    "company_postal": "75008",
    "company_country": "France",
    "company_email": "contact@legalcity.com",
    "company_phone": "+33123456789",
  },
  "message": "Company created and associated with recovery successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this recovery"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "relation_type": [
            "The relation type field is required."
        ],
        "company_legalrep_firstname": [
            "The company legalrep firstname field is required."
        ],
        "company_name": [
            "The company name field is required when company type is commercial."
        ]
    }
}
 

Example response (500):


{
    "success": false,
    "message": "Failed to create company: This recovery case already has a customer. Each recovery can have only one customer and one debtor."
}
 

Request      

POST api/recoveries/{recoveryId}/companies

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

Recovery case ID to associate company with. Example: 15

Body Parameters

relation_type   string   

Type of relation (customer=creditor, debtor=debtor). Example: customer

company_type   string  optional  

optional Company type (particular, commercial, freelance, liberal, civil, association). Can be null. Example: commercial

company_legal_form   string  optional  

optional Legal form (SAS, SARL, SA, SNC, GIE). Required when company_type is commercial/civil/association, null otherwise. Example: SARL

company_siren   string  optional  

optional SIREN number. Required when company_type is commercial/civil/association, optional for freelance, null for others. Example: 123456789

company_name   string  optional  

optional Company name. Required when company_type is commercial/civil/association, null otherwise. Example: Example Corp

company_legalrep_firstname   string   

Legal representative first name. Example: John

company_legalrep_lastname   string   

Legal representative last name. Example: Doe

company_legalrep_gender   string  optional  

optional Legal representative gender (M, Mme). Can be null. Example: M

company_legalrep_quality   integer  optional  

optional Legal representative quality. For SAS/SA/GIE: 1=Président, 2=Directeur Général, 5=Autre. For SARL/SNC: 3=Gérant, 4=Co-Gérant, 5=Autre. Can be null. Example: 1

company_legalrep_quality_other   string  optional  

optional Description when quality=5 (Autre). Required when quality=5, null otherwise. Example: Fondateur

company_freelance_type   string  optional  

optional Freelance type (trader, artisan). Only allowed when company_type is freelance, null otherwise. Example: trader

company_address   string  optional  

optional Full address. Example: 123 Main Street

company_city   string  optional  

optional City. Example: Paris

company_postal   string  optional  

optional Postal code. Example: 75001

company_country   string  optional  

optional Country. Example: France

company_email   email  optional  

optional Email address. Example: john@example.com

company_phone   string  optional  

optional Phone number. Example: +33123456789

Display the specified company.

requires authentication

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "id": 10,
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "Example Corp",
    "company_legalrep_gender": "M",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_address": "123 Main Street",
    "company_city": "Paris",
    "company_postal": "75001",
    "company_country": "France",
    "company_email": "contact@example.com",
    "company_phone": "+33123456789",
  },
  "message": "Company retrieved successfully"
}
 

Example response (404):


{
    "success": false,
    "message": "Company not found"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Request      

GET api/recoveries/{recoveryId}/companies/{companyId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

companyId   integer   

ID of the company. Example: 10

Update the specified company.

requires authentication

Example request:
curl --request PUT \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"company_type\": \"commercial\",
    \"company_legal_form\": \"SARL\",
    \"company_siren\": \"123456789\",
    \"company_name\": \"Updated Corp Name\",
    \"company_legalrep_firstname\": \"John\",
    \"company_legalrep_lastname\": \"Doe\",
    \"company_legalrep_gender\": \"M\",
    \"company_legalrep_quality\": 1,
    \"company_legalrep_quality_other\": \"Fondateur\",
    \"company_legalrep_birthday\": \"1980-05-15\",
    \"company_legalrep_birthday_city\": \"Paris\",
    \"company_legalrep_nationality\": \"French\",
    \"company_legalrep_profession\": \"Engineer\",
    \"company_freelance_type\": \"trader\",
    \"company_address\": \"123 Main Street\",
    \"company_city\": \"Paris\",
    \"company_postal\": \"75001\",
    \"company_country\": \"France\",
    \"company_state\": \"Île-de-France\",
    \"company_email\": \"updated@example.com\",
    \"company_phone\": \"+33123456789\",
    \"company_activity\": \"Software Development\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "Updated Corp Name",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_legalrep_gender": "M",
    "company_legalrep_quality": 1,
    "company_legalrep_quality_other": "Fondateur",
    "company_legalrep_birthday": "1980-05-15",
    "company_legalrep_birthday_city": "Paris",
    "company_legalrep_nationality": "French",
    "company_legalrep_profession": "Engineer",
    "company_freelance_type": "trader",
    "company_address": "123 Main Street",
    "company_city": "Paris",
    "company_postal": "75001",
    "company_country": "France",
    "company_state": "Île-de-France",
    "company_email": "updated@example.com",
    "company_phone": "+33123456789",
    "company_activity": "Software Development"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'company_type' => 'commercial',
            'company_legal_form' => 'SARL',
            'company_siren' => '123456789',
            'company_name' => 'Updated Corp Name',
            'company_legalrep_firstname' => 'John',
            'company_legalrep_lastname' => 'Doe',
            'company_legalrep_gender' => 'M',
            'company_legalrep_quality' => 1,
            'company_legalrep_quality_other' => 'Fondateur',
            'company_legalrep_birthday' => '1980-05-15',
            'company_legalrep_birthday_city' => 'Paris',
            'company_legalrep_nationality' => 'French',
            'company_legalrep_profession' => 'Engineer',
            'company_freelance_type' => 'trader',
            'company_address' => '123 Main Street',
            'company_city' => 'Paris',
            'company_postal' => '75001',
            'company_country' => 'France',
            'company_state' => 'Île-de-France',
            'company_email' => 'updated@example.com',
            'company_phone' => '+33123456789',
            'company_activity' => 'Software Development',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10'
payload = {
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "Updated Corp Name",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_legalrep_gender": "M",
    "company_legalrep_quality": 1,
    "company_legalrep_quality_other": "Fondateur",
    "company_legalrep_birthday": "1980-05-15",
    "company_legalrep_birthday_city": "Paris",
    "company_legalrep_nationality": "French",
    "company_legalrep_profession": "Engineer",
    "company_freelance_type": "trader",
    "company_address": "123 Main Street",
    "company_city": "Paris",
    "company_postal": "75001",
    "company_country": "France",
    "company_state": "Île-de-France",
    "company_email": "updated@example.com",
    "company_phone": "+33123456789",
    "company_activity": "Software Development"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "success": true,
  "data": {
    "id": 10,
    "company_type": "commercial",
    "company_legal_form": "SARL",
    "company_siren": "123456789",
    "company_name": "Updated Corp Name",
    "company_legalrep_gender": "M",
    "company_legalrep_firstname": "John",
    "company_legalrep_lastname": "Doe",
    "company_address": "123 Main Street",
    "company_city": "Paris",
    "company_postal": "75001",
    "company_country": "France",
    "company_email": "updated@example.com",
    "company_phone": "+33123456789",
  },
  "message": "Company updated successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Company not found"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "company_email": [
            "The company email must be a valid email address."
        ]
    }
}
 

Request      

PUT api/recoveries/{recoveryId}/companies/{companyId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

companyId   integer   

ID of the company to update. Example: 10

Body Parameters

company_type   string  optional  

optional Company type (particular, commercial, freelance, liberal, civil, association). Example: commercial

company_legal_form   string  optional  

optional Legal form (SAS, SARL, SA, SNC, GIE). Example: SARL

company_siren   string  optional  

optional SIREN number. Example: 123456789

company_name   string  optional  

optional Company name. Example: Updated Corp Name

company_legalrep_firstname   string  optional  

optional Legal representative first name. Example: John

company_legalrep_lastname   string  optional  

optional Legal representative last name. Example: Doe

company_legalrep_gender   string  optional  

optional Legal representative gender (M, Mme). Example: M

company_legalrep_quality   integer  optional  

optional Legal representative quality. Example: 1

company_legalrep_quality_other   string  optional  

optional Description when quality=5 (Autre). Example: Fondateur

company_legalrep_birthday   date  optional  

optional Legal representative birthday. Example: 1980-05-15

company_legalrep_birthday_city   string  optional  

optional Legal representative birth city. Example: Paris

company_legalrep_nationality   string  optional  

optional Legal representative nationality. Example: French

company_legalrep_profession   string  optional  

optional Legal representative profession. Example: Engineer

company_freelance_type   string  optional  

optional Freelance type (trader, artisan). Example: trader

company_address   string  optional  

optional Full address. Example: 123 Main Street

company_city   string  optional  

optional City. Example: Paris

company_postal   string  optional  

optional Postal code. Example: 75001

company_country   string  optional  

optional Country. Example: France

company_state   string  optional  

optional State/Region. Example: Île-de-France

company_email   email  optional  

optional Email address. Example: updated@example.com

company_phone   string  optional  

optional Phone number. Example: +33123456789

company_activity   string  optional  

optional Company activity description. Example: Software Development

Remove the specified company.

requires authentication

Example request:
curl --request DELETE \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/companies/10'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Company removed from recovery successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Company not found"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (500):


{
    "success": false,
    "message": "Failed to delete company: Cannot delete this company - recovery would be incomplete"
}
 

Request      

DELETE api/recoveries/{recoveryId}/companies/{companyId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

companyId   integer   

ID of the company to delete. Example: 10

Get Companies by Type

requires authentication

Retrieve companies filtered by their relationship type (customer, debtor, or both) for the authenticated user.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/companies/type/customer" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/companies/type/customer"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/companies/type/customer';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/companies/type/customer'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
  "success": true,
  "data": [
    {
      "id": 10,
      "company_type": "commercial",
      "company_legal_form": "SARL",
      "company_siren": "123456789",
      "company_name": "Example Corp",
      "company_legalrep_gender": "Mme",
      "company_legalrep_firstname": "Jane",
      "company_legalrep_lastname": "Smith",
      "company_address": "456 Rue de la Paix",
      "company_city": "Lyon",
      "company_postal": "69001",
      "company_country": "France",
      "company_email": "contact@example.com",
      "company_phone": "+33987654321",
    }
  ],
  "message": "Companies of type 'customer' retrieved successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "Invalid type. Must be customer, debtor, or both"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Request      

GET api/companies/type/{type}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

type   string   

The type of companies to filter (customer, debtor, or both). Example: customer

Invoice Management

APIs for managing invoices related to debt recovery cases

List Invoices

requires authentication

Get a paginated list of invoices for the authenticated user with advanced filtering options.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices?is_part_paid=&search=INV-2025&date_from=2025-01-01&date_to=2025-12-31&sort_by=invoice_amount&sort_order=asc&per_page=20&page=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices"
);

const params = {
    "is_part_paid": "0",
    "search": "INV-2025",
    "date_from": "2025-01-01",
    "date_to": "2025-12-31",
    "sort_by": "invoice_amount",
    "sort_order": "asc",
    "per_page": "20",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'is_part_paid' => '0',
            'search' => 'INV-2025',
            'date_from' => '2025-01-01',
            'date_to' => '2025-12-31',
            'sort_by' => 'invoice_amount',
            'sort_order' => 'asc',
            'per_page' => '20',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices'
params = {
  'is_part_paid': '0',
  'search': 'INV-2025',
  'date_from': '2025-01-01',
  'date_to': '2025-12-31',
  'sort_by': 'invoice_amount',
  'sort_order': 'asc',
  'per_page': '20',
  'page': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "invoices": [
            {
                "id": 1,
                "recovery_id": 5,
                "invoice_amount": "1500.00",
                "invoice_number": "INV-2025-001",
                "invoice_date": "2025-10-20",
                "invoice_due_date": "2025-11-20",
                "invoice_part_paid": false,
                "invoice_part_paid_amount": null,
                "remaining_amount": "1500.00",
                "api_invoice_id": "CLIENT-REF-001",
                "is_paid": false,
                "days_overdue": 5,
                "recovery": {
                    "id": 5,
                    "recovery_reference": "REC-ABC123",
                    "debtor_name": "John Doe",
                    "recovery_last_status": 1
                }
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 15,
            "total": 45,
            "last_page": 3,
            "from": 1,
            "to": 15,
            "has_more_pages": true
        },
        "summary": {
            "total_amount": "67500.00",
            "total_paid": "15000.00",
            "total_remaining": "52500.00",
            "partially_paid_count": 8,
            "overdue_count": 12
        },
        "filters_applied": {
            "is_part_paid": false,
            "search": "INV-2025",
            "date_from": "2025-01-01",
            "date_to": "2025-12-31",
            "sort_by": "invoice_date",
            "sort_order": "desc"
        }
    },
    "message": "Invoices retrieved successfully. Total: 45 invoices found."
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "date_from": [
            "The date from field must be a valid date."
        ],
        "date_to": [
            "The date to field must be a valid date after date from."
        ],
        "per_page": [
            "The per page field must be between 1 and 100."
        ]
    }
}
 

Request      

GET api/recoveries/{recoveryId}/invoices

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

Query Parameters

is_part_paid   boolean  optional  

optional Filter by partial payment status. Example: false

search   string  optional  

optional Search in invoice number, reference, or description. Example: INV-2025

date_from   string  optional  

date optional Filter invoices from this date. Example: 2025-01-01

date_to   string  optional  

date optional Filter invoices until this date. Example: 2025-12-31

sort_by   string  optional  

optional Sort by field. Defaults to invoice_date. Example: invoice_amount

sort_order   string  optional  

optional Sort order (asc/desc). Defaults to desc. Example: asc

per_page   integer  optional  

optional Items per page (max 100). Defaults to 15. Example: 20

page   integer  optional  

optional Page number. Defaults to 1. Example: 1

Create Invoice

requires authentication

Create a new invoice associated with a recovery case including all financial details.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"invoice_number\": \"INV-2025-001\",
    \"invoice_date\": \"2025-10-20\",
    \"invoice_due_date\": \"2025-11-20\",
    \"invoice_amount\": \"1500.00\",
    \"invoice_part_paid\": false,
    \"invoice_part_paid_amount\": \"500.00\",
    \"api_invoice_id\": \"CLIENT-REF-123\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "invoice_number": "INV-2025-001",
    "invoice_date": "2025-10-20",
    "invoice_due_date": "2025-11-20",
    "invoice_amount": "1500.00",
    "invoice_part_paid": false,
    "invoice_part_paid_amount": "500.00",
    "api_invoice_id": "CLIENT-REF-123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'invoice_number' => 'INV-2025-001',
            'invoice_date' => '2025-10-20',
            'invoice_due_date' => '2025-11-20',
            'invoice_amount' => '1500.00',
            'invoice_part_paid' => false,
            'invoice_part_paid_amount' => '500.00',
            'api_invoice_id' => 'CLIENT-REF-123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices'
payload = {
    "invoice_number": "INV-2025-001",
    "invoice_date": "2025-10-20",
    "invoice_due_date": "2025-11-20",
    "invoice_amount": "1500.00",
    "invoice_part_paid": false,
    "invoice_part_paid_amount": "500.00",
    "api_invoice_id": "CLIENT-REF-123"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "id": 15,
        "recovery_id": 5,
        "invoice_amount": "1500.00",
        "invoice_number": "INV-2025-001",
        "invoice_date": "2025-10-20",
        "invoice_due_date": "2025-11-20",
        "invoice_part_paid": false,
        "invoice_part_paid_amount": null,
        "remaining_amount": "1500.00",
        "api_invoice_id": "CLIENT-REF-123",
        "is_paid": false,
        "days_overdue": 0,
        "recovery": {
            "id": 5,
            "recovery_reference": "REC-ABC123",
            "debtor_name": "John Doe",
            "debtor_company": "Example Corp"
        }
    },
    "message": "Invoice created successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "recovery_id": [
            "The recovery id field is required."
        ],
        "invoice_number": [
            "The invoice number field is required."
        ],
        "invoice_amount": [
            "The invoice amount field is required."
        ]
    }
}
 

Request      

POST api/recoveries/{recoveryId}/invoices

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case (must exist and belong to authenticated user). Example: 5

Body Parameters

invoice_number   string   

Unique invoice number. Example: INV-2025-001

invoice_date   date   

Invoice issue date. Example: 2025-10-20

invoice_due_date   date  optional  

optional Payment due date (must be after invoice date). Example: 2025-11-20

invoice_amount   numeric   

Invoice amount. Example: 1500.00

invoice_part_paid   boolean  optional  

optional Partial payment status. Example: false

invoice_part_paid_amount   numeric  optional  

optional Partial payment amount. Example: 500.00

api_invoice_id   string  optional  

optional Internal client reference. Example: CLIENT-REF-123

Show Invoice

requires authentication

Retrieve detailed information about a specific invoice including recovery case details and financial breakdown.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 5,
        "recovery_id": 3,
        "invoice_amount": "1500.00",
        "invoice_number": "INV-2025-001",
        "invoice_date": "2025-10-20",
        "invoice_due_date": "2025-11-20",
        "invoice_part_paid": false,
        "invoice_part_paid_amount": null,
        "remaining_amount": "1500.00",
        "api_invoice_id": null,
        "is_paid": false,
        "days_overdue": 5,
        "recovery": {
            "id": 3,
            "recovery_reference": "REC-ABC123",
            "debtor_name": "John Doe",
            "debtor_company": "Example Corp",
            "case_status": "active"
        }
    },
    "message": "Invoice retrieved successfully"
}
 

Example response (404):


{
    "success": false,
    "message": "Invoice not found"
}
 

Request      

GET api/recoveries/{recoveryId}/invoices/{invoiceId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

invoiceId   integer   

ID of the invoice. Example: 5

Update Invoice

requires authentication

Update invoice details including financial information, payment status, and related recovery case data.

Example request:
curl --request PUT \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"invoice_number\": \"INV-2025-001-UPDATED\",
    \"invoice_date\": \"2025-10-20\",
    \"invoice_due_date\": \"2025-11-20\",
    \"invoice_amount\": \"1600.00\",
    \"invoice_part_paid\": true,
    \"invoice_part_paid_amount\": \"800.00\",
    \"api_invoice_id\": \"CLIENT-REF-123-UPD\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "invoice_number": "INV-2025-001-UPDATED",
    "invoice_date": "2025-10-20",
    "invoice_due_date": "2025-11-20",
    "invoice_amount": "1600.00",
    "invoice_part_paid": true,
    "invoice_part_paid_amount": "800.00",
    "api_invoice_id": "CLIENT-REF-123-UPD"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'invoice_number' => 'INV-2025-001-UPDATED',
            'invoice_date' => '2025-10-20',
            'invoice_due_date' => '2025-11-20',
            'invoice_amount' => '1600.00',
            'invoice_part_paid' => true,
            'invoice_part_paid_amount' => '800.00',
            'api_invoice_id' => 'CLIENT-REF-123-UPD',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5'
payload = {
    "invoice_number": "INV-2025-001-UPDATED",
    "invoice_date": "2025-10-20",
    "invoice_due_date": "2025-11-20",
    "invoice_amount": "1600.00",
    "invoice_part_paid": true,
    "invoice_part_paid_amount": "800.00",
    "api_invoice_id": "CLIENT-REF-123-UPD"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 5,
        "recovery_id": 5,
        "invoice_amount": "1600.00",
        "invoice_number": "INV-2025-001-UPDATED",
        "invoice_date": "2025-10-20",
        "invoice_due_date": "2025-11-20",
        "invoice_part_paid": true,
        "invoice_part_paid_amount": "800.00",
        "remaining_amount": "800.00",
        "api_invoice_id": "CLIENT-REF-123-UPD",
        "is_paid": false,
        "days_overdue": 0,
        "recovery": {
            "id": 5,
            "recovery_reference": "REC-ABC123",
            "debtor_name": "John Doe",
            "debtor_company": "Example Corp"
        }
    },
    "message": "Invoice updated successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Invoice not found"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "invoice_due_date": [
            "The invoice due date must be after the invoice date."
        ],
        "invoice_part_paid_amount": [
            "The partial payment amount cannot exceed the invoice amount."
        ]
    }
}
 

Request      

PUT api/recoveries/{recoveryId}/invoices/{invoiceId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

invoiceId   integer   

ID of the invoice to update. Example: 5

Body Parameters

invoice_number   string  optional  

optional Unique invoice number. Example: INV-2025-001-UPDATED

invoice_date   date  optional  

optional Invoice issue date. Example: 2025-10-20

invoice_due_date   date  optional  

optional Payment due date (must be after invoice date). Example: 2025-11-20

invoice_amount   numeric  optional  

optional Invoice amount. Example: 1600.00

invoice_part_paid   boolean  optional  

optional Partial payment status. Example: true

invoice_part_paid_amount   numeric  optional  

optional Partial payment amount. Example: 800.00

api_invoice_id   string  optional  

optional Internal client reference. Example: CLIENT-REF-123-UPD

Delete Invoice

requires authentication

Permanently delete an invoice from the system. This action cannot be undone.

Example request:
curl --request DELETE \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/invoices/5'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Invoice deleted successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Recovery cannot be modified. Only recoveries with status 1 or 2 can be updated."
}
 

Example response (404):


{
    "success": false,
    "message": "Invoice not found"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Request      

DELETE api/recoveries/{recoveryId}/invoices/{invoiceId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

invoiceId   integer   

ID of the invoice to delete. Example: 5

Document Management

APIs for managing documents related to recovery cases including correspondence, legal documents, invoices, and file attachments. Use GET /api/docs/file-types to retrieve available document types before creating or filtering documents.

Get File Types

requires authentication

Retrieve all active file types available for documents. Use this endpoint before creating documents to ensure you're using valid file type IDs.

Supported File Types: PDF, DOC, DOCX, XLS, XLSX, JPG, PNG, GIF Maximum File Size: 10MB per file Security: All files are scanned for malware and validated for content type

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/docs/file-types" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/docs/file-types"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/docs/file-types';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/docs/file-types'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": [
        {
            "id": 1,
            "type": "Facture",
            "position": 1,
            "active": true,
            "description": "Invoice or billing document"
        },
        {
            "id": 2,
            "type": "Courrier",
            "position": 2,
            "active": true,
            "description": "General correspondence"
        },
        {
            "id": 3,
            "type": "LRAR",
            "position": 3,
            "active": true,
            "description": "Registered mail with acknowledgment of receipt"
        }
    ],
    "message": "Active file types retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Request      

GET api/docs/file-types

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

List Documents

requires authentication

Get all documents for a specific recovery case with filtering and pagination.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs?search=contrat&invoice_id=3&file_type=1&sort_by=file_created_at&sort_order=desc&per_page=15&page=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs"
);

const params = {
    "search": "contrat",
    "invoice_id": "3",
    "file_type": "1",
    "sort_by": "file_created_at",
    "sort_order": "desc",
    "per_page": "15",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search' => 'contrat',
            'invoice_id' => '3',
            'file_type' => '1',
            'sort_by' => 'file_created_at',
            'sort_order' => 'desc',
            'per_page' => '15',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs'
params = {
  'search': 'contrat',
  'invoice_id': '3',
  'file_type': '1',
  'sort_by': 'file_created_at',
  'sort_order': 'desc',
  'per_page': '15',
  'page': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "documents": [
            {
                "id": 1,
                "recovery_id": 5,
                "invoice_id": 3,
                "adminUserId": 1,
                "fileId": 10,
                "fileTypeId": 1,
                "visibleToUser": true,
                "visibleToDebtor": false,
                "visibleToBailiff": false,
                "visibleToOIP": false,
                "isSigned": false,
                "created_at": "2025-10-19T15:30:00.000000Z",
                "updated_at": "2025-10-20T10:30:00.000000Z",
                "recovery": {
                    "id": 5,
                    "recovery_reference": "REC-ABC123",
                    "debtor_name": "John Doe",
                    "debtor_company": "Example Corp"
                },
                "invoice": {
                    "id": 3,
                    "invoice_number": "INV-2025-001",
                    "amount_ttc": "1500.00"
                },
                "file": {
                    "id": 10,
                    "filename": "document.pdf",
                    "mime": "application/pdf"
                },
                "file_type_info": {
                    "id": 1,
                    "type": "Mise en demeure"
                }
            }
        ]
    },
    "pagination": {
        "current_page": 1,
        "per_page": 15,
        "total": 42,
        "last_page": 3,
        "from": 1,
        "to": 15,
        "has_more_pages": true
    },
    "message": "Documents retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Request      

GET api/recoveries/{recoveryId}/docs

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

Query Parameters

search   string  optional  

Search in document filename. Example: contrat

invoice_id   integer  optional  

Filter documents by invoice ID. Example: 3

file_type   integer  optional  

Filter by file type ID (use GET /api/docs/file-types to get available types). Example: 1

sort_by   string  optional  

Sort field (recovery_id, file_type, invoice_id, file_created_at). Example: file_created_at

sort_order   string  optional  

Sort direction (asc, desc). Example: desc

per_page   integer  optional  

Items per page (max 100). Example: 15

page   integer  optional  

Page number for pagination. Example: 1

Create Document

requires authentication

Store a new document with file upload for a specific recovery case.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Mise en demeure #1\",
    \"pathinfo\": \"https:\\/\\/example.com\\/document.pdf\",
    \"invoice_id\": 3,
    \"file_type\": 1
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Mise en demeure #1",
    "pathinfo": "https:\/\/example.com\/document.pdf",
    "invoice_id": 3,
    "file_type": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'Mise en demeure #1',
            'pathinfo' => 'https://example.com/document.pdf',
            'invoice_id' => 3,
            'file_type' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs'
payload = {
    "name": "Mise en demeure #1",
    "pathinfo": "https:\/\/example.com\/document.pdf",
    "invoice_id": 3,
    "file_type": 1
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "id": 1,
        "recovery_id": 5,
        "invoice_id": 3,
        "adminUserId": 1,
        "fileId": 10,
        "fileTypeId": 1,
        "visibleToUser": true,
        "visibleToDebtor": false,
        "visibleToBailiff": false,
        "visibleToOIP": false,
        "isSigned": false,
        "created_at": "2025-10-19T15:30:00.000000Z",
        "updated_at": "2025-10-20T10:30:00.000000Z",
        "recovery": {
            "id": 5,
            "recovery_reference": "REC-ABC123",
            "debtor_name": "John Doe",
            "debtor_company": "Example Corp"
        },
        "invoice": {
            "id": 3,
            "invoice_number": "INV-2025-001",
            "amount_ttc": "1500.00"
        },
        "file": {
            "id": 10,
            "filename": "document.pdf",
            "mime": "application/pdf"
        },
        "file_type_info": {
            "id": 1,
            "type": "Mise en demeure"
        }
    },
    "message": "Document uploaded successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "Failed to process file"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404, Recovery not found):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (404, Invoice not found):


{
    "success": false,
    "message": "Invoice not found or does not belong to this recovery"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "pathinfo": [
            "The pathinfo field is required when file is not present."
        ]
    }
}
 

Example response (500):


{
    "success": false,
    "message": "Failed to upload document"
}
 

Request      

POST api/recoveries/{recoveryId}/docs

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case (must exist and belong to authenticated user). Example: 5

Body Parameters

name   string   

Document name that will be used as filename. Example: Mise en demeure #1

pathinfo   string   

URL to download the document from (legacy API compatibility). Example: https://example.com/document.pdf

invoice_id   integer  optional  

ID of the associated invoice. Example: 3

file_type   integer  optional  

Document type identifier (use GET /api/docs/file-types to get available types). Example: 1

Show Document

requires authentication

Get detailed document information for a specific recovery case.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "recovery_id": 5,
        "invoice_id": 3,
        "adminUserId": 1,
        "fileId": 10,
        "fileTypeId": 1,
        "visibleToUser": true,
        "visibleToDebtor": false,
        "visibleToBailiff": false,
        "visibleToOIP": false,
        "isSigned": false,
        "created_at": "2025-10-19T15:30:00.000000Z",
        "updated_at": "2025-10-20T10:30:00.000000Z",
        "recovery": {
            "id": 5,
            "recovery_reference": "REC-ABC123",
            "debtor_name": "John Doe",
            "debtor_company": "Example Corp"
        },
        "invoice": {
            "id": 3,
            "invoice_number": "INV-2025-001",
            "amount_ttc": "1500.00"
        },
        "file": {
            "id": 10,
            "filename": "document.pdf",
            "mime": "application/pdf"
        },
        "file_type_info": {
            "id": 1,
            "type": "Mise en demeure"
        }
    },
    "message": "Document retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this document"
}
 

Example response (404, Recovery not found):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (404, Document not found):


{
    "success": false,
    "message": "Document not found"
}
 

Request      

GET api/recoveries/{recoveryId}/docs/{docId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

docId   integer   

ID of the document. Example: 123

Download Document File

requires authentication

Download the actual file for a specific document with secure access control. Files are served with proper security headers and content type validation.

Security Features:

File Serving:

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123/download" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123/download"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123/download';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123/download'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


"File download with proper headers and content-disposition"
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (403, Unauthorized):


{
    "success": false,
    "message": "Unauthorized access to this document"
}
 

Example response (403, Not implemented):


{
    "success": false,
    "message": "This endpoint is not yet implemented. Feature under development."
}
 

Example response (404, Recovery not found):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (404, Document not found):


{
    "success": false,
    "message": "Document not found"
}
 

Example response (404, File not found):


{
    "success": false,
    "message": "File not found"
}
 

Example response (500):


{
    "success": false,
    "message": "File could not be accessed"
}
 

Request      

GET api/recoveries/{recoveryId}/docs/{docId}/download

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

docId   integer   

ID of the document. Example: 123

Delete Document

requires authentication

Remove document from a specific recovery case.

Example request:
curl --request DELETE \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/5/docs/123'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Document deleted successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "Cannot delete document with pending signature requests"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized access to this document"
}
 

Example response (404, Recovery not found):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (404, Document not found):


{
    "success": false,
    "message": "Document not found"
}
 

Request      

DELETE api/recoveries/{recoveryId}/docs/{docId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

ID of the recovery case. Example: 5

docId   integer   

ID of the document to delete. Example: 123

Comment Management

APIs for managing comments on recovery cases including internal notes, communications, and case updates with advanced visibility controls.

Visibility System:

Use Cases:

List Comments

requires authentication

Get all comments for a specific recovery case with visibility filtering and access control. Comments are automatically filtered based on user permissions and visibility settings.

Visibility Rules:

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments?per_page=20&page=1&visibility=user&unread_only=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments"
);

const params = {
    "per_page": "20",
    "page": "1",
    "visibility": "user",
    "unread_only": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '20',
            'page' => '1',
            'visibility' => 'user',
            'unread_only' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments'
params = {
  'per_page': '20',
  'page': '1',
  'visibility': 'user',
  'unread_only': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "comments": [
            {
                "id": 1,
                "recovery_id": 1,
                "user_id": 1,
                "comment": "Client contacted by phone - no response received",
                "visibleToUser": true,
                "visibleToDebtor": false,
                "visibleToBailiff": true,
                "isRead": false,
                "created_at": "2025-10-20T10:30:00.000000Z",
                "updated_at": "2025-10-20T10:30:00.000000Z"
            },
            {
                "id": 2,
                "recovery_id": 1,
                "user_id": 1,
                "comment": "Payment plan proposal sent to debtor",
                "visibleToUser": true,
                "visibleToDebtor": true,
                "visibleToBailiff": false,
                "isRead": true,
                "created_at": "2025-10-21T14:15:00.000000Z",
                "updated_at": "2025-10-21T14:15:00.000000Z"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 189,
            "last_page": 10,
            "from": 1,
            "to": 20,
            "has_more_pages": true
        },
        "summary": {
            "total_comments": 189,
            "unread_count": 45,
            "visible_to_debtor": 23,
            "visible_to_bailiff": 67
        }
    },
    "message": "Comments retrieved successfully. Total: 189 comments found."
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Request      

GET api/recoveries/{recoveryId}/comments

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

The recovery case ID. Example: 1

Query Parameters

per_page   integer  optional  

optional Items per page (max 100). Defaults to 15. Example: 20

page   integer  optional  

optional Page number. Defaults to 1. Example: 1

visibility   string  optional  

enum optional Filter by visibility level (user, debtor, bailiff, all). Example: user

unread_only   boolean  optional  

optional Show only unread comments. Example: true

Create Comment

requires authentication

Add a new comment to a recovery case with specified visibility settings.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"comment\": \"<p>Client contacted by phone - <strong>no response<\\/strong><\\/p>\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "comment": "<p>Client contacted by phone - <strong>no response<\/strong><\/p>"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'comment' => '<p>Client contacted by phone - <strong>no response</strong></p>',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments'
payload = {
    "comment": "<p>Client contacted by phone - <strong>no response<\/strong><\/p>"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "id": 1,
        "recovery_id": 1,
        "user_id": 1,
        "comment": "Client contacted by phone - no response",
        "visibleToUser": true,
        "visibleToDebtor": false,
        "visibleToBailiff": true,
        "isRead": false,
        "created_at": "2025-10-20T10:30:00.000000Z",
        "updated_at": "2025-10-20T10:30:00.000000Z"
    },
    "message": "Comment created successfully"
}
 

Example response (404):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "comment": [
            "The comment field is required.",
            "The comment contains potentially dangerous HTML tags.",
            "The comment contains too much HTML markup."
        ]
    }
}
 

Request      

POST api/recoveries/{recoveryId}/comments

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

The recovery case ID. Example: 1

Body Parameters

comment   string   

The comment text (HTML allowed with restrictions). Allowed HTML tags: p, br, strong, b, em, i, u, ul, ol, li, h1-h6, blockquote, a. No JavaScript or dangerous attributes allowed. Example: <p>Client contacted by phone - <strong>no response</strong></p>

Show Comment

requires authentication

Get details of a specific comment.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "recovery_id": 1,
        "user_id": 1,
        "comment": "Client contacted by phone - no response",
        "visibleToUser": true,
        "visibleToDebtor": false,
        "visibleToBailiff": true,
        "isRead": false,
        "created_at": "2025-10-20T10:30:00.000000Z",
        "updated_at": "2025-10-20T10:30:00.000000Z"
    },
    "message": "Comment retrieved successfully"
}
 

Example response (404, Recovery not found):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (404, Comment not found):


{
    "success": false,
    "message": "Comment not found"
}
 

Request      

GET api/recoveries/{recoveryId}/comments/{commentId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

The recovery case ID. Example: 1

commentId   integer   

The comment ID. Example: 1

Update Comment

requires authentication

Update an existing comment with new content or visibility settings.

Example request:
curl --request PUT \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"comment\": \"<p>Client contacted by phone - <em>answered this time<\\/em><\\/p>\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "comment": "<p>Client contacted by phone - <em>answered this time<\/em><\/p>"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'comment' => '<p>Client contacted by phone - <em>answered this time</em></p>',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1'
payload = {
    "comment": "<p>Client contacted by phone - <em>answered this time<\/em><\/p>"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "recovery_id": 1,
        "user_id": 1,
        "comment": "Client contacted by phone - answered this time",
        "visibleToUser": true,
        "visibleToDebtor": false,
        "visibleToBailiff": true,
        "isRead": false,
        "created_at": "2025-10-20T10:30:00.000000Z",
        "updated_at": "2025-10-20T10:30:00.000000Z"
    },
    "message": "Comment updated successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Cannot update comment that is visible to debtor/bailiff or has been read"
}
 

Example response (404):


{
    "success": false,
    "message": "Comment not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "comment": [
            "The comment must not be greater than 2000 characters.",
            "The comment contains potentially dangerous HTML tags.",
            "The comment contains too much HTML markup."
        ]
    }
}
 

Request      

PUT api/recoveries/{recoveryId}/comments/{commentId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

The recovery case ID. Example: 1

commentId   integer   

The comment ID. Example: 1

Body Parameters

comment   string  optional  

optional The updated comment text (HTML allowed with restrictions). Allowed HTML tags: p, br, strong, b, em, i, u, ul, ol, li, h1-h6, blockquote, a. No JavaScript or dangerous attributes allowed. Example: <p>Client contacted by phone - <em>answered this time</em></p>

Delete Comment

requires authentication

Remove a comment from the recovery case.

Example request:
curl --request DELETE \
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/recoveries/1/comments/1'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Comment deleted successfully"
}
 

Example response (403):


{
    "success": false,
    "message": "Cannot delete comment that is visible to debtor/bailiff or has been read"
}
 

Example response (404, Recovery not found):


{
    "success": false,
    "message": "Recovery case not found"
}
 

Example response (404, Comment not found):


{
    "success": false,
    "message": "Comment not found"
}
 

Request      

DELETE api/recoveries/{recoveryId}/comments/{commentId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

recoveryId   integer   

The recovery case ID. Example: 1

commentId   integer   

The comment ID. Example: 1

Protected Invoice Management

Endpoints for managing protected invoices. These endpoints handle secure invoice information storage and retrieval for client billing.

List Protected Invoices

requires authentication

Retrieves a paginated list of protected invoices with optional filters.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/protected-invoices?search=INV-2024&status=pending&siren=123456789&sort_by=invoice_number&sort_order=asc&per_page=20&page=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices"
);

const params = {
    "search": "INV-2024",
    "status": "pending",
    "siren": "123456789",
    "sort_by": "invoice_number",
    "sort_order": "asc",
    "per_page": "20",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search' => 'INV-2024',
            'status' => 'pending',
            'siren' => '123456789',
            'sort_by' => 'invoice_number',
            'sort_order' => 'asc',
            'per_page' => '20',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices'
params = {
  'search': 'INV-2024',
  'status': 'pending',
  'siren': '123456789',
  'sort_by': 'invoice_number',
  'sort_order': 'asc',
  'per_page': '20',
  'page': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "protected_invoices": [
            {
                "id": 1,
                "api_invoice_id": "INV-202405252001",
                "tracking_code": "fyn_INV-202405252001",
                "siren": "123456789",
                "invoice_number": "INV-2024-001",
                "due_date": "2024-12-31",
                "amount": "1500.50",
                "currency": "EUR",
                "status": "pending",
                "status_label": "À payer",
                "formatted_amount": "1500.50 EUR",
                "is_overdue": false,
                "is_paid": false,
                "created_at": "2024-10-31T21:15:00.000000Z",
                "updated_at": "2024-10-31T21:15:00.000000Z"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 15,
            "total": 1,
            "last_page": 1,
            "from": 1,
            "to": 1,
            "has_more_pages": false
        }
    },
    "message": "Protected invoices retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Request      

GET api/protected-invoices

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

search   string  optional  

optional Search in invoice numbers and descriptions. Example: INV-2024

status   string  optional  

optional Filter by invoice status (pending, paid, cancelled). Example: pending

siren   string  optional  

optional Filter by client SIREN. Example: 123456789

sort_by   string  optional  

optional Sort by field. Defaults to due_date. Example: invoice_number

sort_order   string  optional  

optional Sort order (asc/desc). Defaults to desc. Example: asc

per_page   integer  optional  

optional Items per page (max 100). Defaults to 15. Example: 20

page   integer  optional  

optional Page number. Defaults to 1. Example: 1

Store Protected Invoice

requires authentication

Creates a new protected invoice with automatic tracking code generation. The tracking code is automatically generated with the prefix "fyn_" followed by a unique identifier.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"api_invoice_id\": \"INV-202405252001\",
    \"siren\": \"123456789\",
    \"invoice_number\": \"INV-2024-001\",
    \"due_date\": \"2024-12-31\",
    \"amount\": \"1500.50\",
    \"currency\": \"EUR\",
    \"status\": \"pending\",
    \"description\": \"Services rendered for January 2024\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "api_invoice_id": "INV-202405252001",
    "siren": "123456789",
    "invoice_number": "INV-2024-001",
    "due_date": "2024-12-31",
    "amount": "1500.50",
    "currency": "EUR",
    "status": "pending",
    "description": "Services rendered for January 2024"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'api_invoice_id' => 'INV-202405252001',
            'siren' => '123456789',
            'invoice_number' => 'INV-2024-001',
            'due_date' => '2024-12-31',
            'amount' => '1500.50',
            'currency' => 'EUR',
            'status' => 'pending',
            'description' => 'Services rendered for January 2024',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices'
payload = {
    "api_invoice_id": "INV-202405252001",
    "siren": "123456789",
    "invoice_number": "INV-2024-001",
    "due_date": "2024-12-31",
    "amount": "1500.50",
    "currency": "EUR",
    "status": "pending",
    "description": "Services rendered for January 2024"
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "id": 1,
        "api_invoice_id": "INV-202405252001",
        "tracking_code": "fyn_INV-202405252001",
        "siren": "123456789",
        "invoice_number": "INV-2024-001",
        "due_date": "2024-12-31",
        "amount": "1500.50",
        "currency": "EUR",
        "status": "pending",
        "status_label": "À payer",
        "description": "Services rendered for January 2024",
        "formatted_amount": "1500.50 EUR",
        "is_overdue": false,
        "is_paid": false,
        "created_at": "2024-10-31T21:15:00.000000Z",
        "updated_at": "2024-10-31T21:15:00.000000Z"
    },
    "message": "Protected invoice created successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "api_invoice_id": [
            "An invoice with this API ID already exists for your account."
        ],
        "siren": [
            "The siren must be exactly 9 characters."
        ]
    }
}
 

Request      

POST api/protected-invoices

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

api_invoice_id   string   

Unique invoice identifier for your system. Example: INV-202405252001

siren   string   

Client SIREN (9 digits). Example: 123456789

invoice_number   string   

Invoice number (free-form). Example: INV-2024-001

due_date   date   

Invoice due date (format: YYYY-MM-DD). Example: 2024-12-31

amount   decimal   

Invoice amount. Example: 1500.50

currency   string  optional  

optional Invoice currency (EUR, USD, GBP). Defaults to EUR. Example: EUR

status   string  optional  

optional Initial status (pending, paid, cancelled). Defaults to pending. Example: pending

description   string  optional  

optional Invoice description. Example: Services rendered for January 2024

Show Protected Invoice

requires authentication

Retrieves details of a specific protected invoice by its ID.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "api_invoice_id": "INV-202405252001",
        "tracking_code": "fyn_INV-202405252001",
        "siren": "123456789",
        "invoice_number": "INV-2024-001",
        "due_date": "2024-12-31",
        "amount": "1500.50",
        "currency": "EUR",
        "status": "pending",
        "status_label": "À payer",
        "description": "Services rendered for January 2024",
        "formatted_amount": "1500.50 EUR",
        "is_overdue": false,
        "is_paid": false,
        "created_at": "2024-10-31T21:15:00.000000Z",
        "updated_at": "2024-10-31T21:15:00.000000Z"
    },
    "message": "Protected invoice retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Protected invoice not found"
}
 

Request      

GET api/protected-invoices/{id}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The protected invoice ID. Example: 1

Update Protected Invoice Status

requires authentication

Updates the status of a protected invoice. This automatically updates the timestamp. Only the status can be modified after creation.

Example request:
curl --request PUT \
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"status\": \"\\\"paid\\\"\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "status": "\"paid\""
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'status' => '"paid"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices/1'
payload = {
    "status": "\"paid\""
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "api_invoice_id": "INV-202405252001",
        "tracking_code": "fyn_INV-202405252001",
        "siren": "123456789",
        "invoice_number": "INV-2024-001",
        "due_date": "2024-12-31",
        "amount": "1500.50",
        "currency": "EUR",
        "status": "paid",
        "status_label": "Payée",
        "formatted_amount": "1500.50 EUR",
        "is_overdue": false,
        "is_paid": true,
        "created_at": "2024-10-31T21:15:00.000000Z",
        "updated_at": "2024-10-31T21:30:00.000000Z"
    },
    "message": "Protected invoice status updated successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Protected invoice not found"
}
 

Example response (422):


{
    "success": false,
    "message": "Validation failed",
    "errors": {
        "status": [
            "Status must be one of: pending, paid, cancelled."
        ]
    }
}
 

Request      

PUT api/protected-invoices/{id}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

The protected invoice ID. Example: 1

Body Parameters

status   string   

New status (pending, paid, cancelled). Example: "paid"

Get Protected Invoice by API Invoice ID

requires authentication

Retrieves a protected invoice using its unique API invoice ID.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/protected-invoices/api/INV-202405252001" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/protected-invoices/api/INV-202405252001"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices/api/INV-202405252001';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/protected-invoices/api/INV-202405252001'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "id": 1,
        "api_invoice_id": "INV-202405252001",
        "tracking_code": "fyn_INV-202405252001",
        "siren": "123456789",
        "invoice_number": "INV-2024-001",
        "due_date": "2024-12-31",
        "amount": "1500.50",
        "currency": "EUR",
        "status": "pending",
        "status_label": "À payer",
        "description": "Services rendered for January 2024",
        "formatted_amount": "1500.50 EUR",
        "is_overdue": false,
        "is_paid": false,
        "created_at": "2024-10-31T21:15:00.000000Z",
        "updated_at": "2024-10-31T21:15:00.000000Z"
    },
    "message": "Protected invoice found"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "success": false,
    "message": "Protected invoice not found with this API invoice ID"
}
 

Request      

GET api/protected-invoices/api/{apiInvoiceId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

apiInvoiceId   string   

The API invoice ID. Example: INV-202405252001

Scoring Management

Endpoints for managing credit scoring, solvency reports, and company surveillance. These endpoints handle ordering and monitoring of financial assessments.

Order Scoring Report

requires authentication

Orders a solvency report and/or surveillance for a company. This endpoint allows ordering both services simultaneously or individually.

Example request:
curl --request POST \
    "https://apiv2-sandbox.legalcity.fr/api/scoring/order" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"company_id\": 123,
    \"company_name\": \"\\\"ACME Corporation\\\"\",
    \"company_siret\": \"\\\"12345678901234\\\"\",
    \"services\": [
        \"solvency_report\",
        \"surveillance\"
    ],
    \"report_type\": \"\\\"standard\\\"\",
    \"surveillance_duration\": 12,
    \"priority\": \"\\\"standard\\\"\"
}"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/scoring/order"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "company_id": 123,
    "company_name": "\"ACME Corporation\"",
    "company_siret": "\"12345678901234\"",
    "services": [
        "solvency_report",
        "surveillance"
    ],
    "report_type": "\"standard\"",
    "surveillance_duration": 12,
    "priority": "\"standard\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/order';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'company_id' => 123,
            'company_name' => '"ACME Corporation"',
            'company_siret' => '"12345678901234"',
            'services' => [
                'solvency_report',
                'surveillance',
            ],
            'report_type' => '"standard"',
            'surveillance_duration' => 12,
            'priority' => '"standard"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/order'
payload = {
    "company_id": 123,
    "company_name": "\"ACME Corporation\"",
    "company_siret": "\"12345678901234\"",
    "services": [
        "solvency_report",
        "surveillance"
    ],
    "report_type": "\"standard\"",
    "surveillance_duration": 12,
    "priority": "\"standard\""
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "data": {
        "order_id": "SCR-2024-001",
        "services": [
            "solvency_report",
            "surveillance"
        ],
        "status": "pending",
        "estimated_delivery": "2024-01-17T10:00:00.000000Z"
    },
    "message": "Scoring order placed successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (403):


{
    "success": false,
    "message": "This endpoint is not yet implemented. Feature under development."
}
 

Request      

POST api/scoring/order

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

company_id   integer   

The target company identifier. Example: 123

company_name   string   

The company name. Example: "ACME Corporation"

company_siret   string  optional  

The company SIRET number. Example: "12345678901234"

services   string[]   

Array of requested services.

*   string  optional  

The service type. Available: solvency_report, surveillance. Example: "solvency_report"

report_type   string  optional  

The type of solvency report (if applicable). Example: "standard"

surveillance_duration   integer  optional  

Duration in months for surveillance (if applicable). Example: 12

priority   string  optional  

The processing priority. Example: "standard"

Check Available Tokens

requires authentication

Returns the number of remaining tokens available for ordering reports and surveillance. This endpoint helps users monitor their consumption and remaining credits.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/scoring/tokens" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/scoring/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/tokens';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/tokens'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "remaining_tokens": 75
    },
    "message": "Token information retrieved successfully"
}
 

Example response (200):


{
    "success": true,
    "data": {
        "remaining_tokens": 0
    },
    "message": "No tokens available"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Request      

GET api/scoring/tokens

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

List Scoring Orders

requires authentication

Retrieves a list of scoring orders for the authenticated user.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/scoring/orders?status=completed&service_type=solvency_report&per_page=15&page=1" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/scoring/orders"
);

const params = {
    "status": "completed",
    "service_type": "solvency_report",
    "per_page": "15",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/orders';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'status' => 'completed',
            'service_type' => 'solvency_report',
            'per_page' => '15',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/orders'
params = {
  'status': 'completed',
  'service_type': 'solvency_report',
  'per_page': '15',
  'page': '1',
}
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "scoring_orders": []
    },
    "pagination": {
        "current_page": 1,
        "per_page": 15,
        "total": 0,
        "last_page": 1,
        "from": null,
        "to": null
    },
    "message": "Scoring orders retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (403):


{
    "success": false,
    "message": "This endpoint is not yet implemented. Feature under development."
}
 

Request      

GET api/scoring/orders

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

status   string  optional  

Filter by order status. Example: completed

service_type   string  optional  

Filter by service type. Example: solvency_report

per_page   integer  optional  

Number of items per page. Example: 15

page   integer  optional  

The page number for pagination. Example: 1

Show Scoring Order

requires authentication

Retrieves details of a specific scoring order including results if available.

Example request:
curl --request GET \
    --get "https://apiv2-sandbox.legalcity.fr/api/scoring/orders/SCR-2024-001" \
    --header "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://apiv2-sandbox.legalcity.fr/api/scoring/orders/SCR-2024-001"
);

const headers = {
    "Authorization": "Bearer {YOUR_ACCESS_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/orders/SCR-2024-001';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://apiv2-sandbox.legalcity.fr/api/scoring/orders/SCR-2024-001'
headers = {
  'Authorization': 'Bearer {YOUR_ACCESS_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "order_id": "SCR-2024-001",
        "company_name": "ACME Corporation",
        "services": [
            "solvency_report"
        ],
        "status": "completed",
        "results": {
            "solvency_score": 85,
            "risk_level": "low"
        }
    },
    "message": "Scoring order retrieved successfully"
}
 

Example response (401):


{
    "success": false,
    "message": "Unauthenticated"
}
 

Example response (403):


{
    "success": false,
    "message": "This endpoint is not yet implemented. Feature under development."
}
 

Example response (404):


{
    "success": false,
    "message": "Scoring order not found"
}
 

Request      

GET api/scoring/orders/{orderId}

Headers

Authorization      

Example: Bearer {YOUR_ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

orderId   string   

The scoring order ID. Example: SCR-2024-001