v1

latestOpenAPI 3.1.0AGPLv32026-07-26168262527.5 KB
credit_notes

List all credit notes

This endpoint list all existing credit notes.

get/credit_notes

Query parameters

pageinteger
Example:1

Page number.

per_pageinteger
Example:20

Number of records per page.

external_customer_idstring
Example:5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba

Unique identifier assigned to the customer in your application.

issuing_date_fromstring date
Example:2022-07-08

Filter credit notes starting from a specific date.

issuing_date_tostring date
Example:2022-08-09

Filter credit notes up to a specific date.

search_termstring
Example:Jane

Search credit notes by id, number, customer name, customer external_id or customer email.

currencystring
Example:EUR

Filter credit notes by currency. Possible values ISO 4217 currency codes.

reason'product_unsatisfactory' | 'order_change' | 'order_cancellation' | 'fraudulent_charge' | 'duplicated_charge' | 'other'

Filter credit notes by reasons. Possible values are product_unsatisfactory, order_change, order_cancellation, fraudulent_charge, duplicated_charge or other.

credit_status'available' | 'consumed' | 'voided'

Filter credit notes by credit status. Possible values are available, consumed or voided.

refund_status'pending' | 'succeeded' | 'failed'

Filter credit notes by refund status. Possible values are pending, succeeded or failed.

invoice_numberstring
Example:INV-001-002

Filter credit notes by their related invoice number.

amount_frominteger
Example:9000

Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.

amount_tointeger
Example:100000

Filter credit notes up to a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.

self_billedboolean
Example:true

Filter credit notes belonging to a self billed invoice. Possible values are true or false.

billing_entity_codes[]string[]

Filter credit notes by billing entity codes.

[
  "billing_entity_code_1",
  "billing_entity_code_2"
]

Response

Credit notes

Example response

{
  "credit_notes": [
    {
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "billing_entity_code": "acme_corp",
      "sequential_id": 2,
      "number": "LAG-1234-CN2",
      "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "invoice_number": "LAG-1234",
      "issuing_date": "2022-12-06",
      "credit_status": "available",
      "refund_status": "pending",
      "reason": "other",
      "description": "Free text",
      "currency": "USD",
      "total_amount_cents": 120,
      "taxes_amount_cents": 20,
      "taxes_rate": 20,
      "sub_total_excluding_taxes_amount_cents": 100,
      "balance_amount_cents": 100,
      "credit_amount_cents": 100,
      "coupons_adjustment_amount_cents": 20,
      "created_at": "2022-09-14T16:35:31Z",
      "updated_at": "2022-09-14T16:35:31Z",
      "file_url": "https://getlago.com/credit_note/file",
      "items": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "amount_cents": 100,
          "amount_currency": "USD",
          "fee": {
            "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_charge_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_charge_filter_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_fixed_charge_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_true_up_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_true_up_parent_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_subscription_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "external_customer_id": "external_id",
            "external_subscription_id": "external_id",
            "amount_cents": 100,
            "precise_amount": "1.0001",
            "precise_total_amount": "1.0212",
            "amount_currency": "USD",
            "taxes_amount_cents": 20,
            "taxes_precise_amount": "0.20123",
            "taxes_rate": 20,
            "units": "0.32",
            "precise_unit_amount": "312.5",
            "total_aggregated_units": "0.32",
            "total_amount_cents": 120,
            "total_amount_currency": "USD",
            "events_count": 23,
            "pay_in_advance": true,
            "invoiceable": true,
            "from_date": "2022-04-29T08:59:51Z",
            "to_date": "2022-05-29T08:59:51Z",
            "payment_status": "pending",
            "created_at": "2022-08-24T14:58:59Z",
            "succeeded_at": "2022-08-24T14:58:59Z",
            "failed_at": "2022-08-24T14:58:59Z",
            "refunded_at": "2022-08-24T14:58:59Z",
            "event_transaction_id": "transaction_1234567890",
            "description": "Fee description",
            "precise_coupons_amount_cents": "0.0",
            "sub_total_excluding_taxes_amount_cents": 100,
            "sub_total_excluding_taxes_precise_amount_cents": "100.0",
            "amount_details": {
              "plan_amount_cents": 10000,
              "graduated_ranges": [
                {
                  "units": "10.0",
                  "to_value": 10,
                  "flat_unit_amount": "1.0",
                  "per_unit_amount": "1.0",
                  "per_unit_total_amount": "10.0",
                  "total_with_flat_amount": "11.0"
                }
              ],
              "graduated_percentage_ranges": [
                {
                  "units": "10.0",
                  "to_value": 10,
                  "flat_unit_amount": "1.0",
                  "rate": "1.0",
                  "per_unit_total_amount": "10.0",
                  "total_with_flat_amount": "11.0"
                }
              ],
              "free_units": "10.0",
              "paid_units": "40.0",
              "per_package_size": 1000,
              "per_package_unit_amount": "0.5",
              "per_unit_total_amount": "10.0",
              "units": "20.0",
              "free_events": 10,
              "rate": "1.0",
              "paid_events": 20,
              "fixed_fee_unit_amount": "1.0",
              "fixed_fee_total_amount": "20.0",
              "min_max_adjustment_total_amount": "20.0",
              "per_unit_amount": "0.5",
              "flat_unit_amount": "10.0"
            },
            "item": {
              "type": "subscription",
              "code": "startup",
              "name": "Startup",
              "description": "Startup",
              "invoice_display_name": "Setup Fee (SF1)",
              "filter_invoice_display_name": "AWS eu-east-1",
              "lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
              "item_type": "Subscription"
            },
            "applied_taxes": [
              {
                "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
                "tax_name": "TVA",
                "tax_code": "french_standard_vat",
                "tax_rate": 20,
                "tax_description": "French standard VAT",
                "amount_cents": 2000,
                "amount_currency": "USD",
                "created_at": "2022-09-14T16:35:31Z"
              }
            ],
            "pricing_unit_details": {
              "lago_pricing_unit_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
              "pricing_unit_code": "credits",
              "short_name": "CR",
              "amount_cents": 200,
              "precise_amount_cents": "200.0",
              "unit_amount_cents": 100,
              "precise_unit_amount": "100.0",
              "conversion_rate": "0.5"
            },
            "presentation_breakdowns": [
              {
                "units": "9.0"
              }
            ]
          }
        }
      ],
      "applied_taxes": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "tax_name": "TVA",
          "tax_code": "french_standard_vat",
          "tax_rate": 20,
          "tax_description": "French standard VAT",
          "amount_cents": 2000,
          "amount_currency": "USD",
          "created_at": "2022-09-14T16:35:31Z"
        }
      ],
      "customer": {
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "sequential_id": 1,
        "slug": "LAG-1234-001",
        "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
        "billing_entity_code": "acme_corp",
        "address_line1": "5230 Penfield Ave",
        "applicable_timezone": "America/Los_Angeles",
        "city": "Woodland Hills",
        "country": "US",
        "currency": "USD",
        "email": "dinesh@piedpiper.test",
        "legal_name": "Coleman-Blair",
        "legal_number": "49-008-2965",
        "logo_url": "http://hooli.com/logo.png",
        "name": "Gavin Belson",
        "firstname": "Gavin",
        "lastname": "Belson",
        "account_type": "customer",
        "phone": "1-171-883-3711 x245",
        "state": "CA",
        "tax_identification_number": "EU123456789",
        "timezone": "America/Los_Angeles",
        "url": "http://hooli.com",
        "zipcode": "91364",
        "net_payment_term": 30,
        "created_at": "2022-04-29T08:59:51Z",
        "updated_at": "2022-04-29T08:59:51Z",
        "finalize_zero_amount_invoice": "inherit",
        "billing_configuration": {
          "invoice_grace_period": 3,
          "subscription_invoice_issuing_date_anchor": "next_period_start",
          "subscription_invoice_issuing_date_adjustment": "keep_anchor",
          "payment_provider": "stripe",
          "payment_provider_code": "stripe-eu-1",
          "provider_customer_id": "cus_12345",
          "sync": true,
          "sync_with_provider": true,
          "document_locale": "fr",
          "provider_payment_methods": [
            "card",
            "sepa_debit",
            "us_bank_account",
            "bacs_debit",
            "link",
            "boleto",
            "crypto",
            "customer_balance"
          ]
        },
        "shipping_address": {
          "address_line1": "5230 Penfield Ave",
          "city": "Woodland Hills",
          "country": "US",
          "state": "CA",
          "zipcode": "91364"
        },
        "metadata": [
          {
            "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "key": "Purchase Order",
            "value": "123456789",
            "display_in_invoice": true,
            "created_at": "2022-04-29T08:59:51Z"
          }
        ]
      },
      "metadata": {
        "external_id": "ext-123",
        "synced_at": "2024-01-15",
        "source": null
      },
      "error_details": [
        {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "error_code": "tax_error"
        }
      ]
    }
  ],
  "meta": {
    "current_page": 2,
    "next_page": 3,
    "prev_page": 1,
    "total_pages": 4,
    "total_count": 70
  }
}