POST
/
invoices
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"

curl --location --request POST "$LAGO_URL/api/v1/invoices" \
  --header "Authorization: Bearer $API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "invoice": {
      "external_customer_id": "hooli_1234",
      "currency": "USD",
      "fees": [
        {
          "add_on_code": "setup_fee",
          "units": 2.5,
          "unit_amount_cents": 1200,
          "description": "This is a description.",
          "tax_codes": ["french_standard_vat]
        }
      ]
    }
  }'
{
  "invoice": {
    "applied_taxes": [
      {
        "amount_cents": 2000,
        "amount_currency": "USD",
        "created_at": "2022-09-14T16:35:31Z",
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "tax_code": "french_standard_vat",
        "tax_description": "French standard VAT",
        "tax_name": "TVA",
        "tax_rate": 20,
        "fees_amount_cents": 20000,
        "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
      }
    ],
    "coupons_amount_cents": 10,
    "credit_notes_amount_cents": 10,
    "currency": "EUR",
    "customer": {
      "address_line1": "5230 Penfield Ave",
      "address_line2": "null",
      "applicable_timezone": "America/Los_Angeles",
      "billing_configuration": {
        "document_locale": "fr",
        "invoice_grace_period": 3,
        "payment_provider": "stripe",
        "payment_provider_code": "stripe-eu-1",
        "provider_customer_id": "cus_12345",
        "provider_payment_methods": [
          "card",
          "sepa_debit"
        ],
        "sync": true,
        "sync_with_provider": true
      },
      "city": "Woodland Hills",
      "country": "US",
      "created_at": "2022-04-29T08:59:51Z",
      "currency": "USD",
      "email": "dinesh@piedpiper.test",
      "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "legal_name": "Coleman-Blair",
      "legal_number": "49-008-2965",
      "logo_url": "http://hooli.com/logo.png",
      "metadata": [
        {
          "created_at": "2022-04-29T08:59:51Z",
          "display_in_invoice": true,
          "key": "Purchase Order",
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "value": "123456789"
        }
      ],
      "name": "Gavin Belson",
      "net_payment_term": 30,
      "phone": "1-171-883-3711 x245",
      "sequential_id": 1,
      "slug": "LAG-1234-001",
      "state": "CA",
      "tax_identification_number": "EU123456789",
      "timezone": "America/Los_Angeles",
      "updated_at": "2022-04-29T08:59:51Z",
      "url": "http://hooli.com",
      "zipcode": "91364"
    },
    "fees_amount_cents": 100,
    "file_url": "https://getlago.com/invoice/file",
    "invoice_type": "subscription",
    "issuing_date": "2022-04-30",
    "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "metadata": [
      {
        "created_at": "2022-04-29T08:59:51Z",
        "key": "digital_ref_id",
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "value": "INV-0123456-98765"
      }
    ],
    "net_payment_term": 30,
    "number": "LAG-1234-001-002",
    "payment_due_date": "2022-04-30",
    "payment_status": "succeeded",
    "prepaid_credit_amount_cents": 123,
    "sequential_id": 2,
    "status": "finalized",
    "sub_total_excluding_taxes_amount_cents": 100,
    "sub_total_including_taxes_amount_cents": 120,
    "taxes_amount_cents": 20,
    "total_amount_cents": 100,
    "version_number": 3,
    "credits": [
      {
        "amount_cents": 1200,
        "amount_currency": "EUR",
        "before_taxes": true,
        "invoice": {
          "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "payment_status": "succeeded"
        },
        "item": {
          "code": "startup_deal",
          "lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "name": "Startup Deal",
          "type": "coupon"
        },
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
      }
    ],
    "fees": [
      {
        "amount_cents": 100,
        "amount_currency": "EUR",
        "amount_details": {
          "fixed_fee_total_amount": "20.0",
          "fixed_fee_unit_amount": "1.0",
          "free_events": 10,
          "free_units": "10.0",
          "graduated_percentage_ranges": [
            {
              "flat_unit_amount": "1.0",
              "from_value": 123,
              "per_unit_total_amount": "10.0",
              "rate": "1.0",
              "to_value": 10,
              "total_with_flat_amount": "11.0",
              "units": "10.0"
            }
          ],
          "graduated_ranges": [
            {
              "flat_unit_amount": "1.0",
              "from_value": 123,
              "per_unit_amount": "1.0",
              "per_unit_total_amount": "10.0",
              "to_value": 10,
              "total_with_flat_amount": "11.0",
              "units": "10.0"
            }
          ],
          "min_max_adjustment_total_amount": "20.0",
          "paid_events": 20,
          "paid_units": "40.0",
          "per_package_size": 1000,
          "per_package_unit_amount": "0.5",
          "per_unit_total_amount": "10.0",
          "rate": "1.0",
          "units": "20.0",
          "volume_ranges": [
            {
              "flat_unit_amount": "10.0",
              "per_unit_amount": "0.5",
              "per_unit_total_amount": "10.0"
            }
          ]
        },
        "applied_taxes": [
          {
            "amount_cents": 2000,
            "amount_currency": "USD",
            "created_at": "2022-09-14T16:35:31Z",
            "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "lago_tax_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
            "tax_code": "french_standard_vat",
            "tax_description": "French standard VAT",
            "tax_name": "TVA",
            "tax_rate": 20,
            "lago_fee_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
          }
        ],
        "created_at": "2022-08-24T14:58:59Z",
        "event_transaction_id": "transaction_1234567890",
        "events_count": 23,
        "external_customer_id": "external_id",
        "external_subscription_id": "external_id",
        "failed_at": "2022-08-24T14:58:59Z",
        "from_date": "2022-04-29T08:59:51Z",
        "invoice_display_name": "Setup Fee (SF1)",
        "invoiceable": true,
        "item": {
          "code": "startup",
          "group_invoice_display_name": "Transactions - ACH",
          "grouped_by": {},
          "invoice_display_name": "Setup Fee (SF1)",
          "item_type": "Subscription",
          "lago_item_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
          "name": "Startup",
          "type": "subscription"
        },
        "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "lago_group_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "lago_subscription_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",
        "pay_in_advance": true,
        "payment_status": "pending",
        "precise_unit_amount": "312.5",
        "refunded_at": "2022-08-24T14:58:59Z",
        "succeeded_at": "2022-08-24T14:58:59Z",
        "taxes_amount_cents": 20,
        "taxes_rate": 20,
        "to_date": "2022-05-29T08:59:51Z",
        "total_amount_cents": 120,
        "total_amount_currency": "EUR",
        "units": "0.32"
      }
    ],
    "subscriptions": [
      {
        "billing_time": "anniversary",
        "canceled_at": "2022-09-14T16:35:31Z",
        "created_at": "2022-08-08T00:00:00Z",
        "downgrade_plan_date": "2022-04-30",
        "ending_at": "2022-10-08T00:00:00Z",
        "external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
        "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
        "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
        "name": "Repository A",
        "next_plan_code": "null",
        "plan_code": "premium",
        "previous_plan_code": "null",
        "started_at": "2022-08-08T00:00:00Z",
        "status": "active",
        "subscription_at": "2022-08-08T00:00:00Z",
        "terminated_at": "2022-09-14T16:35:31Z"
      }
    ]
  }
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
invoice
object
required

Response

200 - application/json
invoice
object
required