Creating Customers

Registering customers with Octane.

πŸ“˜

General Usage: Programmatic

Customers are at the core of your business and the Octane model.

Usage

Defining a customer is simple, requiring only a name and optional metadata.

Examples

import octane
octane.api_key = "<YOUR_API_KEY>"

octane.Customer.create(
  name="customer_1",
  display_name="Customer 1",
  contact_info={
    "email": "[email protected]",
    "url": "customer1.com",
    "address_line_1": "111 Main St",
    "address_line_2": "#1",
    "city": "New York",
    "state": "NY",
    "country": "United States",
    "zipcode": "10011"
  },
  
)
import Octane from "octane-node";
const octane = new Octane("<YOUR_API_KEY>");

octane.customers.create({
  name: "customer_1",
  displayName: "Customer 1",
  contactInfo: {
    email: "[email protected]",
    url: "customer1.com",
    addressLine1: "111 Main St",
    addressLine2: "#1",
    city: "New York",
    state: "NY",
    country: "United States",
    zipcode: "10011"
  }
});
package main

import "github.com/getoctane/octane-go"

func main() {
  client := octane.NewClient("<YOUR_API_KEY>")
  
  args := octane.CreateCustomerArgs{
    Name:        "customer_1",
    DisplayName: "Customer 1",
    ContactInfo: &octane.ContactInfoInputArgs{
      Email:        "[email protected]",
      Url:          "customer1.com",
      AddressLine1: "111 Main St",
      AddressLine2: "#1",
      City:         "New York",
      State:        "NY",
      Country:      "United States",
      Zipcode:      "10011",
    },
  }
  
  _, _, err := client.Customers.Create(args)
  if err != nil {
    panic(err)
  }
}

By default, Measurements are associated with customers using the customer_name field on the measurement.
For advancement mappings, we recommend using the Measurement Mappings field on the customer object and setting the appropriate labels on the measurement.

Definition

Field Name

Description

Type

Required

name

The customer identifier. Must be unique. Should be a dev-friendly string. *NOTE: This is known as 'ID' in the portal

String

Required

display_name

The name to display in UI. Defaults to name. NOTE: This is known as 'Name' in the portal

String

Optional

description

A description of the customer. Defaults to null.

String

Optional

email

An email for the customer. Defaults to null.

String

Optional

url

A url for company website. Defaults to null.

String

Optional

address_line_1

Customer's address line 1. Defaults to null.

String

Optional

address_line_2

Customer's address line 2. Defaults to null.

String

Optional

city

Customer's city. Defaults to null.

String

Optional

state

Customer's state. Defaults to null.

String

Optional

country

Customer's country. Defaults to null.

String

Optional

zipcode

Customer's zipcode. Defaults to null.

String

Optional

measurement_mappings

A set of measurement labels and corresponding value regexes to match measurements (see Measurement Mappings). These will apply to measurements for all meters. Defaults to null.

Dict[String, String]

Optional

price_plan_name

A price plan to subscribe the customer to (see Subscriptions). Defaults to null.

String

Optional


Did this page help you?