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:
- Efficiently manage debt collection cases, clients, and legal files
- Associate claims, documents, and payments with each case
- Track case progress and automate client notifications throughout the recovery process
Key Features
- Secure Authentication — API key–based access
- Comprehensive Management — Full control over users, companies, collections, and billing
- Automated Notifications — Professional email templates for client communication
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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:
- API version and metadata
- Documentation and collection URLs
- Authentication endpoints
- Main resource endpoints
- OpenAPI specification access
Use Cases:
- API client initialization
- Documentation discovery
- Integration testing
- Development environment setup
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",
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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:
- Creates the recovery case with all financial parameters
- Creates customer company (creditor) and associates it with recovery
- Creates debtor company and associates it with recovery
- Creates all provided invoices and associates them with recovery
- Updates recovery totals based on invoice amounts
Important Notes:
- All operations are performed in a database transaction (atomic operation)
- If any step fails, all changes are rolled back automatically
- Customer and debtor companies are mandatory
- Invoices are optional: you can send 0, 1, or multiple invoices in an array
- Each invoice must have a unique invoice_number
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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:
- Recovery must be owned by authenticated user
- Recovery status must be between 3 and 908 (configured range)
- No existing injunction link (injonction_id must be null)
- Debtor must be in allowed countries (configurable list)
- Must have eligible products/services or proper access configuration
- Validates order details and product eligibility
Process Flow:
- Validates ownership (404 if not found, 403 if unauthorized)
- Validates eligibility requirements (status, debtor country, product eligibility)
- Creates new injunction recovery with specialized configuration
- Duplicates customer and debtor companies with data integrity
- Copies unpaid/partially paid invoices only
- Duplicates all recovery comments with visibility settings
- Creates initial status history record
- Links original recovery to new injunction case
- 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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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:
- User ownership verification
- Document access permissions check
- File existence validation
- Secure file serving with proper headers
- Content-Type header protection
File Serving:
- Files are served with secure file response handling
- Original filename is preserved
- Proper MIME type detection
- Download logging for audit purposes
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Comment Management
APIs for managing comments on recovery cases including internal notes, communications, and case updates with advanced visibility controls.
Visibility System:
visibleToUser: Internal team visibilityvisibleToDebtor: Debtor can see this commentvisibleToBailiff: Bailiff/legal representative accessisRead: Read/validation status tracking
Use Cases:
- Internal case notes and updates
- Client communications log
- Legal procedure documentation
- Status change notifications
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:
- All users see comments where
visibleToUser = true - Debtors only see comments where
visibleToDebtor = true - Bailiffs see comments where
visibleToBailiff = true - Admin users can see all comments regardless of visibility
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.