/v1/straight-line
Straight-line depreciation
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
curl "https://api.oanor.com/depreciation-api/v1/straight-line" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/depreciation-api/v1/straight-line", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/depreciation-api/v1/straight-line");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
"https://api.oanor.com/depreciation-api/v1/straight-line",
headers={"x-oanor-key": "oanor_test_..."}
)
Exemple de réponse
Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.
{
"data": {
"note": "Straight-line: equal annual depreciation = (cost − salvage) / life.",
"inputs": {
"cost": 10000,
"life": 5,
"salvage": 1000
},
"method": "straight-line",
"schedule": [
{
"year": 1,
"book_value": 8200,
"accumulated": 1800,
"depreciation": 1800
},
{
"year": 2,
"book_value": 6400,
"accumulated": 3600,
"depreciation": 1800
},
{
"year": 3,
"book_value": 4600,
"accumulated": 5400,
"depreciation": 1800
},
{
"year": 4,
"book_value": 2800,
"accumulated": 7200,
"depreciation": 1800
},
{
"year": 5,
"book_value": 1000,
"accumulated": 9000,
"depreciation": 1800
}
],
"total_depreciation": 9000,
"annual_depreciation": 1800
},
"meta": {
"timestamp": "2026-06-04T18:38:16.288Z",
"request_id": "bf9b00b2-7335-46f3-81bd-24e29cf4ed64"
},
"status": "ok",
"message": "Straight-line",
"success": true
}