Skip to content

Billing: Integrate Polar usage events #6

@cuevaio

Description

@cuevaio

Description

Send usage records to Polar for billing and subscription management.

Tasks

  • From the gateway Lambda, send Polar Events usage records per execution
  • Include required fields:
    • Organization ID / user ID
    • Machine type
    • Billed duration (seconds)
    • Price
    • Metadata (input/output size, etc.)
  • Implement idempotency for usage events
  • Add error handling for Polar API failures
  • Implement retry logic with backoff if Polar is down
  • Add dead-letter queue or fallback for failed events

Acceptance Criteria

  • All executions generate Polar usage events
  • Events are idempotent (no duplicate billing)
  • System gracefully handles Polar downtime
  • Failed events are recoverable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions