credit_notes

Estimate amounts for a new credit note

Changed on

This endpoint allows you to retrieve amounts for a new credit note creation. This is a premium feature. Amounts cannot be estimated on an invoice in a pending or failed status. In that case the endpoint returns a 405 error with the invalid_type_or_status code.

post/credit_notes/estimate

Request

Request body

Example request

{
  "credit_note": {
    "invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "items": [
      {
        "fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "amount_cents": 10
      },
      {
        "fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
        "amount_cents": 5
      }
    ]
  }
}

Response

Credit note amounts

Example response

{
  "estimated_credit_note": {
    "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "invoice_number": "LAG-1234",
    "currency": "USD",
    "taxes_amount_cents": 20,
    "precise_taxes_amount_cents": "20.1",
    "taxes_rate": 20,
    "sub_total_excluding_taxes_amount_cents": 100,
    "max_creditable_amount_cents": 100,
    "coupons_adjustment_amount_cents": 20,
    "precise_coupons_adjustment_amount_cents": "20.1",
    "items": [
      {
        "amount_cents": 100,
        "lago_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
      }
    ],
    "applied_taxes": [
      {
        "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "tax_name": "TVA",
        "tax_code": "french_standard_vat",
        "tax_rate": 20,
        "tax_description": "French standard VAT",
        "base_amount_cents": 100,
        "amount_cents": 2000,
        "amount_currency": "USD"
      }
    ]
  }
}

Changes

    • breaking

      request body became required

    • breaking

      the / response's property type changed from number to string for status

    • breaking

      the / response's property type changed from number to string for status

    • warning

      added the new SYP enum value to the /// response property for the response status

    • warning

      added the new SYP enum value to the / response property for the response status

    • warning

      added the new TND enum value to the /// response property for the response status

    • warning

      added the new TND enum value to the / response property for the response status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status