Baremetrics

App · 25 actions

Read subscription analytics and manage API-source customers, plans, subscriptions and annotations.

Actions

ActionWhat it does
Cancel subscriptionCancel Subscription.
Create annotationCreate Annotation.
Create customerCreate Customer.
Create planCreate Plan.
Create subscriptionCreate Subscription.
Delete annotationDelete Annotation.
Delete customerDelete Customer.
Delete planDelete Plan.
Delete subscriptionDelete Subscription.
Get accountGet Account.
Get annotationShow Annotation.
Get customerShow Customer.
Get metricsShow Summary.
Get planShow Plan.
Get subscriptionShow Subscription.
List annotationsList Annotations.
List chargesList Charges.
List customer eventsList Customer Events.
List customersList Customers.
List eventsList Events.
List plansList Plans.
List refundsList Refunds.
List sourcesList Sources.
List subscriptionsList Subscriptions.
Update customerUpdate Customer.

Cancel subscription

Cancel Subscription.

Inputs

Subscription oidsubscription_oidtextRequired
Your unique ID for the subscription
Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Canceled atcanceled_atdate and timeRequired
A unix timestamp of when this subscription was, or should be canceled.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "event": {
      "id": "example",
      "info": {
        "addons": [],
        "canceled_at": 1
      },
      "occurred_at": 1,
      "received_at": 1,
      "type": "example"
    }
  }
}

Create annotation

Create Annotation.

Inputs

MetricmetrictextRequired
Which metric is this for?
AnnotationannotationtextRequired
The annotation text
DatedatedateRequired
YYYY-MM-DD
Visible to the whole accountglobal_valuetrue/falseRequired
Should this show on all graphs?
User IDuser_id_valuetextRequired
Who added this annotation?

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "annotation": {
      "annotation": "example",
      "date": "example",
      "global": false,
      "id": "example",
      "metric": "example",
      "user": {
        "admin": false,
        "email": "example",
        "id": "example",
        "name": "example"
      }
    }
  }
}

Create customer

Create Customer.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Namenametext
Name.
Notesnotestext
Your own notes for this customer. These will be displayed in the profile
Emailemailtext
An email address for this customer. This is used to lookup extra profile information
OidoidtextRequired
Your unique ID for the customer
Createdcreateddate and time
A unix timestamp of when this customer was created. Defaults to now.Default: NOW.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "customer": {
      "created": 1,
      "current_mrr": 1,
      "current_plans": [],
      "display_image": "example",
      "display_name": "example",
      "email": "example",
      "is_active": false,
      "is_canceled": false,
      "ltv": 1,
      "name": "example",
      "notes": "example",
      "oid": "example",
      "source": "example",
      "source_id": "example"
    }
  }
}

Create plan

Create Plan.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
OidoidtextRequired
Your unique ID for the plan
NamenametextRequired
Your internal name for this plan. This will be displayed in the Plan Breakout section
CurrencycurrencytextRequired
Three-letter ISO currency code, such as USD.
AmountamountnumberRequired
How much is this plan? (In cents)
IntervalintervaltextRequired
day, month or yearOne of: day, month, year.
Interval countinterval_countnumberRequired
Interval count.
Trial durationtrial_durationnumber
The duration of this trial. This is to be used in conjunction with trial_duration_unitDefault: 0.
Trial duration unittrial_duration_unittext
This is to be used in conjunction with trial_durationOne of: day, month, year. Default: day.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "plan": {
      "active": false,
      "amounts": [],
      "created": "example",
      "interval": "example",
      "interval_count": 1,
      "name": "example",
      "oid": "example",
      "setup_fees": 1,
      "source": "example",
      "source_id": "example",
      "trial_duration": "example",
      "trial_duration_unit": "example"
    }
  }
}

Create subscription

Create Subscription.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
OidoidtextRequired
Your unique ID for the subscription
Started atstarted_atdate and timeRequired
A unix timestamp of when this subscription started
Canceled atcanceled_atdate and time
A unix timestamp of when this subscription was, or should be canceled. This cannot be changed, so only set this if you are certain you know when the subscription will end.
Plan oidplan_oidtextRequired
Your unique ID for the plan
Customer oidcustomer_oidtextRequired
Your unique ID for the customer
Addonsaddonslist
Addons.
Quantityquantitynumber
Quantity.Default: 1.
Discountdiscountnumber
Integer value (in the same currency as the plan)

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "event": {
      "id": "example",
      "info": {
        "addons": [],
        "canceled_at": "example",
        "customer_oid": "example",
        "oid": "example",
        "plan_oid": "example",
        "quantity": 1,
        "started_at": 1
      },
      "occurred_at": 1,
      "received_at": 1,
      "type": "example"
    }
  }
}

Delete annotation

Delete Annotation.

Inputs

IdidtextRequired
Id.

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

Delete customer

Delete Customer.

Inputs

OidoidtextRequired
Oid.
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

Delete plan

Delete Plan.

Inputs

OidoidtextRequired
Oid.
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

Delete subscription

Delete Subscription.

Inputs

OidoidtextRequired
Oid.
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

Get account

Get Account.

Inputs

None.

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

Get annotation

Show Annotation.

Inputs

IdidtextRequired
Id.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "annotation": {
      "annotation": "example",
      "date": "example",
      "global": false,
      "id": "example",
      "metric": "example",
      "user": {
        "admin": false,
        "email": "example",
        "id": "example",
        "name": "example"
      }
    }
  }
}

Get customer

Show Customer.

Inputs

OidoidtextRequired
Oid.
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "customer": {
      "created": 1,
      "current_mrr": 1,
      "current_plans": [],
      "display_image": "example",
      "display_name": "example",
      "email": "example",
      "is_active": false,
      "is_canceled": false,
      "ltv": 1,
      "name": "example",
      "notes": "example",
      "oid": "example",
      "source": "example",
      "source_id": "example"
    }
  }
}

Get metrics

Show Summary.

Inputs

Start datestart_datedateRequired
Start date.
End dateend_datedateRequired
End date.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "metrics": []
  }
}

Get plan

Show Plan.

Inputs

OidoidtextRequired
Oid.
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "plan": {
      "active": false,
      "amounts": [],
      "created": "example",
      "interval": "example",
      "interval_count": 1,
      "name": "example",
      "oid": "example",
      "setup_fees": 1,
      "source": "example",
      "source_id": "example",
      "trial_duration": "example",
      "trial_duration_unit": "example"
    }
  }
}

Get subscription

Show Subscription.

Inputs

OidoidtextRequired
Oid.
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

List annotations

List Annotations.

Inputs

None.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "annotations": []
  }
}

List charges

List Charges.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Startstartdate and time
A unix timestamp
Endenddate and time
A unix timestamp
Subscription oidsubscription_oidtext
Subscription oid.
Customer oidcustomer_oidtext
Customer oid.

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

List customer events

List Customer Events.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
OidoidtextRequired
Oid.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "events": []
  }
}

List customers

List Customers.

Inputs

Searchsearchtext
Allows you to search for a customer based on: oid, email, notes and name
Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Sortsorttext
Allows you to sort the results. You can use ltv or createdDefault: created.
Orderordertext
Order.One of: asc, desc. Default: asc.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "customers": []
  }
}

List events

List Events.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Live streamlive_streamtext
Set this to true to only return events that show up in the live streamDefault: false.
Startstartdate and time
Start.
Endenddate and time
End.

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

List plans

List Plans.

Inputs

Searchsearchtext
Allows you to search based on the name or oid fields
Sourcesource_idtextRequired
Please see [Sources](ref:sources)

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "plans": []
  }
}

List refunds

List Refunds.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Startstartdate and time
Start.
Endenddate and time
End.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "refunds": []
  }
}

List sources

List Sources.

Inputs

None.

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "sources": []
  }
}

List subscriptions

List Subscriptions.

Inputs

Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Customer oidcustomer_oidtext
This allows you to return subscriptions for a given customer
Orderordertext
Allows you to order subscriptions from newest to oldest `desc` or oldest to newest `asc`One of: asc, desc. Default: desc.

Outputs

dataobject
Returned value.
Example output
{
  "data": {}
}

Update customer

Update Customer.

Inputs

Customer oidcustomer_oidtextRequired
Your unique ID for the customer
Sourcesource_idtextRequired
Please see [Sources](ref:sources)
Namenametext
Name.
Notesnotestext
Notes.
Createdcreateddate and time
Unix timestamp of when this customer was created
Emailemailtext
Email for this customer

Outputs

dataobject
Returned value.
Example output
{
  "data": {
    "customer": {
      "created": 1,
      "current_mrr": 1,
      "current_plans": [],
      "display_image": "example",
      "display_name": "example",
      "email": "example",
      "is_active": false,
      "is_canceled": false,
      "ltv": 1,
      "name": "example",
      "notes": "example",
      "oid": "example",
      "source": "example",
      "source_id": "example"
    }
  }
}

On this page