Revenue

Learn how to see and get customer revenue

Octane automatically maintains a Revenue Ledger by applying price plans to customer usage. The ledger contains a second-by-second breakdown of how much a customer owes for each component of their subscribed price plan.

The Revenue Ledger records the (non-discounted) amount that a customer owes. Trials, credit, and discounts are only applied in reports, invoices, and charges.

We can see the revenue in the UI or fetch filtered revenue from Octane.

Viewing revenue in portal

Octane shows you a real-time view of your revenue as well as a historical view of all your invoiced revenue. Simply go to the Customers tab to have an overview of the complete system as shown below.

The Total Accrued Revenue is a real-time display of the amount of money you are owed for the current billing cycle. It will automatically update as time passes. The Total Invoiced Revenue is the amount of revenue that has already been invoiced to the customer.

Additionally, you can see the usage by meters in the graph to the right. You can get this same view at a per customer level by clicking on the customer you are interested in.

35423542

Fetching revenue programmatically

import octane
octane.api_key = "<YOUR_API_KEY>"

octane.Customer.revenue(
  "customer_1",
  start_time="2020-01-01",
  end_time="2020-02-01"
)
import Octane from "octane-node";
const octane = new Octane("<YOUR_API_KEY>");

octane.customers.retrieveRevenue(
  "customer_1",
  new Date("2020-01-01"),
  new Date("2020-02-01")
)
package main

import (
    "fmt"
    "time"

    "github.com/antihax/optional"
    "github.com/getoctane/octane-go"
)

func main() {
  client := octane.NewClient("<YOUR_API_KEY>")
  
  // Build time.Time objects from raw date strings
  // Note: "2006-01-02" is simply a format match string
  startTimeStr := "2020-01-01"
  startTimeObj, err := time.Parse("2006-01-02", startTimeStr)
  if err != nil {
    panic(err)
  }
  endTimeStr := "2020-02-01"
  endTimeObj, err := time.Parse("2006-01-02", endTimeStr)
  if err != nil {
    panic(err)
  }
  
  opts := octane.CustomersApiCustomersCustomerNameRevenueGetOpts{
    StartTime: optional.NewTime(startTimeObj),
    EndTime:   optional.NewTime(endTimeObj),
  }
  
  revenue, _, err := client.Customers.RetrieveRevenue("customer_1", opts)
  if err != nil {
    panic(err)
  }
  
  fmt.Printf("Revenue: $%.2f\n", revenue.Revenue/100)
}

Did this page help you?