Charges

Calculate a charge distribution

Calculates how a total charge amount is distributed across the leases of an estate, using the distribution key identified by key_id.

Returns the per-lease shares together with a human-readable explanation of each computation.

Usage Example

curl -X POST https://api.faireplace.com/api/charges/distributions/dd0e8400-e29b-41d4-a716-446655440008/calculate-distribution \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "estate_id": "aa0e8400-e29b-41d4-a716-446655440005",
    "total_amount": 1200.00
  }'

Response:

{
  "key_id": "dd0e8400-e29b-41d4-a716-446655440008",
  "total_amount": 1200.00,
  "distributions": [
    {
      "lease_id": "660e8400-e29b-41d4-a716-446655440001",
      "amount": 600.00,
      "calculation_details": "50.00% (tantièmes: 500 / 1000)"
    }
  ]
}
post/charges/distributions/{key_id}/calculate-distribution

Request

  • Base URL: https://api.faireplace.com/api
  • URL: https://api.faireplace.com/api/charges/distributions/{key_id}/calculate-distribution
  • Auth: HTTP bearer

Path parameters

key_idstring uuid required

Charge distribution key ID

Request body

estate_idstring uuid required

Estate whose leases the charge is distributed across.

total_amountnumber double required

Total charge amount to distribute (in euros).

Example request

{
  "estate_id": "aa0e8400-e29b-41d4-a716-446655440005",
  "total_amount": 1200
}

Response

Distribution calculated successfully

key_idstring uuid required

Distribution key used for the calculation.

total_amountnumber double required

Total amount that was distributed (in euros).

Example response

{
  "key_id": "dd0e8400-e29b-41d4-a716-446655440008",
  "total_amount": 1200,
  "distributions": [
    {
      "lease_id": "660e8400-e29b-41d4-a716-446655440001",
      "amount": 600,
      "calculation_details": "50.00% (tantièmes: 500 / 1000)"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.