Skip to main content

Python SDK

Open-source metering and usage-based billing

SDK Installation

pip install lago-billing

SDK Example Usage

import lago
from lago.models import operations, shared

s = lago.Lago(
    security=shared.Security(
        bearer_auth="Bearer YOUR_BEARER_TOKEN_HERE",
    ),
)


req = operations.FindInvoiceRequest(
    id="1a901a90-1a90-1a90-1a90-1a901a901a90",
)
    
res = s.invoices.find(req)

if res.invoice is not None:
    # handle response

Available Resources and Operations

add_ons

  • apply - Apply an add-on to a customer
  • create - Create a new add-on
  • destroy - Delete an add-on
  • find - Find add-on by code
  • find_all - Find add-ons
  • update - Update an existing add-on

billable_metrics

  • create - Create a new billable metric
  • destroy - Delete a billable metric
  • find - Find billable metric by code
  • find_all - Find Billable metrics
  • find_all_groups - Find Billable metric groups
  • update - Update an existing billable metric

coupons

  • applied_coupons - Find Applied Coupons
  • apply - Apply a coupon to a customer
  • create - Create a new coupon
  • destroy - Delete a coupon
  • find - Find coupon by code
  • find_all - Find Coupons
  • update - Update an existing coupon

credit_notes

  • create - Create a new Credit note
  • download - Download an existing credit note
  • find - Find credit note
  • find_all - Find Credit notes
  • update - Update an existing credit note
  • void - Void existing credit note

customers

  • create - Create a customer
  • current_usage - Find customer current usage
  • delete_applied_coupon - Delete customer's appplied coupon
  • destroy - Delete a customer
  • find - Find customer by external ID
  • find_all - Find customers
  • portal_url - Get customer portal URL

events

  • estimate_fees - Estimate fees for an instant charge
  • batch_create - Create batch events
  • create - Create a new event
  • find - Find event by transaction ID

fees

  • find - Find fee by ID
  • find_all - Find all fees
  • update - Update an existing fee

invoices

  • download - Download an existing invoice
  • finalize - Finalize a draft invoice
  • find - Find invoice by ID
  • find_all - Find all invoices
  • retry - Retry invoice payment
  • update - Update an existing invoice status
  • void - Refresh a draft invoice

organizations

  • update - Update an existing Organization

plans

  • create - Create a new plan
  • destroy - Delete a plan
  • find - Fin plan by code
  • find_all - Find plans
  • update - Update an existing plan

subscriptions

  • create - Assign a plan to a customer
  • destroy - Terminate a subscription
  • find_all - Find subscriptions
  • update - Update an existing subscription

wallets

  • create - Create a new wallet
  • create_transaction - Create a new wallet transaction
  • destroy - Delete a wallet
  • find - Find wallet
  • find_all - Find wallets
  • find_all_transactions - Find wallet transactions
  • update - Update an existing wallet

webhooks

  • fetch_public_key - Fetch webhook public key

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !

SDK Created by Speakeasy

Metadata

Release files for lago-billing 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lago-billing 1.0.1
File Size Uploaded Provenance
lago-billing-1.0.1.tar.gz 40.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lago-billing 1.0.1
File Interpreter ABI Platform
lago_billing-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 170.6 kB

Release files / lago-billing-1.0.1.tar.gz

Download URL lago-billing-1.0.1.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
57cf1814277be865e3f47e3ea38f465c900f3ecb5616f05ad1e48cd742ae3c8e
BLAKE2b-256 checksum
How to use checksums
8b701989e908572859fa98693f4af878cc62bacec10192e3c3290a5e50bd2f6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / lago_billing-1.0.1-py3-none-any.whl

Download URL lago_billing-1.0.1-py3-none-any.whl
Size 130.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80b8006391c865fa32e307ce13e60f72b98b1994eb689e37771bae1f585ffc02
BLAKE2b-256 checksum
How to use checksums
8e28c9fe4aab3d6e81cd5c920f31bb278600d1ae2af0ee8666355b591ab9917e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for lago-billing 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page