Skip to main content

Official Python SDK for the Linkbridge e-invoicing API

Project description

linkbridge (Python SDK)

Official Python client for the Linkbridge e-invoicing API. Mirrors the surface of the Go and Node SDKs against the same OpenAPI contract (tools/openapi/openapi.yaml).

  • Zero runtime dependencies — uses only the Python standard library so the package drops cleanly into Lambda layers, vendored POS firmware, and air-gapped merchant ERPs.
  • Sync API with explicit OAuth2 client-credentials handling and automatic token refresh.
  • Webhook signature verification with constant-time comparison and the same 5-minute clock-skew window enforced server-side.

Install

pip install linkbridge

Requires Python 3.9 or newer.

Quickstart

from linkbridge import LinkbridgeClient

client = LinkbridgeClient(
    base_url="https://api.linkbridge.ng",
    client_id="your-client-id",
    client_secret="your-client-secret",
    scopes=["invoices:write", "invoices:read"],
)

accepted = client.invoices.submit({
    "irn": "INV001-SVC01-20260601",
    "invoice_kind": "Standard",
    # …rest of the canonical NRS payload — see
    # packages/schema/invoice.schema.json
})
print(accepted["irn"], accepted["status"])

# Read back, paginate, retry, mutate payment status:
record   = client.invoices.get(accepted["irn"])
page     = client.invoices.list(limit=20, status="failed")
requeued = client.invoices.transmit(accepted["irn"])
paid     = client.invoices.update_status(accepted["irn"],
              payment_status="PAID", reference="RCPT-001")

Webhook verification

from linkbridge import verify_webhook, SignatureError

@app.post("/hooks/linkbridge")
def hook(request):
    try:
        verify_webhook(
            secret=os.environ["WEBHOOK_SECRET"].encode(),
            body=request.body,                     # raw bytes off the wire
            header=request.headers["X-Linkbridge-Signature"],
        )
    except SignatureError:
        return 401
    # …handle the event

Errors

All non-2xx responses raise linkbridge.APIError, which exposes the HTTP status, the canonical error.code, the human error.message, and the trace_id so that operators can correlate against server logs.

Versioning

The package follows the same 0.MINOR.PATCH cadence as the API surface during the beta. Breaking changes will be confined to MINOR bumps until the API freezes at 1.0.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkbridge-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkbridge-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file linkbridge-0.1.1.tar.gz.

File metadata

  • Download URL: linkbridge-0.1.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for linkbridge-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a8963446ac0f4f62a917ee50c73f7e5654c4046d02219c2685efbaa8281a188
MD5 79ecc388a5a72cbc3e4c69dfea45638b
BLAKE2b-256 7bb8fe6670cd7b51b61c763fa5a807c7b22abc2fff0bee43981961a2d79ce2f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for linkbridge-0.1.1.tar.gz:

Publisher: release.yml on Linkbridge-Systems/linkbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linkbridge-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: linkbridge-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for linkbridge-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5f464a684a1b7d591f703128dfa46dd0adb0a6844865979cf936e0ecfb3cdbc
MD5 683ce8dc11d5c6036e646d72ff282299
BLAKE2b-256 74141f100dc788a914a0defe5da1234a5bb4662d080ddaf3fbd7690688ecd179

See more details on using hashes here.

Provenance

The following attestation bundles were made for linkbridge-0.1.1-py3-none-any.whl:

Publisher: release.yml on Linkbridge-Systems/linkbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page