Deposits

Apply deposit to an invoice

Apply all or part of a deposit's remaining balance to a specific invoice. Returns an error if the requested amount exceeds the remaining balance or if the deposit has already been applied to the given invoice.

post/v1/deposits/{depositId}/apply

Request

  • Base URL: https://api.frihet.io
  • URL: https://api.frihet.io/v1/deposits/{depositId}/apply
  • Auth: API key in header X-API-Key

Path parameters

depositIdstring required

Deposit unique identifier

Request body

invoiceIdstring required

ID of the invoice to apply the deposit to

invoiceNumberstring required

Invoice number (for audit trail)

amountnumber required

Amount to apply (must be positive and not exceed remaining balance)

Example request

{
  "invoiceId": "abc123def456",
  "invoiceNumber": "FAC-2026-0042",
  "amount": 500
}

Response

Deposit applied successfully

successboolean
depositIdstring
appliedAmountnumber
remainingBalancenumber
status'active' | 'partially_applied' | 'fully_applied'

Example response

{
  "success": true,
  "depositId": "dep_abc123",
  "appliedAmount": 500,
  "remainingBalance": 250,
  "status": "partially_applied"
}

Changes

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