Partnership API subscription object

A New Relic account has one or more subscriptions. A subscription is the level of service that a customer purchases. As a partner, use the subscription API to manage the New Relic product levels for your accounts.

This information is for version 2 of the Partnership API. Use v2 for all new integrations. Earlier versions have been deprecated. If you have problems with an older integration, upgrade to v2.

Product subscriptions for an account

The Partnership API does not allow you to upgrade or downgrade individual product subscriptions for an account. Instead, the API requires you to replace (add) the configuration for all product subscriptions for the account.

If any product configurations are not included, the New Relic Partnership API provisions the account with the best free product type available. The API automatically selects the product level based on the configuration and custom pricing for the account's partnership.

Subscription object attributes

Here are the Partnership API subscription object's attributes.

product_id (REQUIRED for new subscriptions)
Type: Integer
Default: (none)

The product ID attribute identifies the New Relic product being defined for this subscription. It is required for Create calls.

Exception: All accounts automatically receive free, unlimited use of New Relic Plugins. This product does not need to be provisioned via the Partnership API.

quantity (REQUIRED for new subscriptions)
Type: Integer
Default: (none)

The quantity attribute is required for Create calls, even if a product level is unlimited. The API will ignore the quantity value entered for unlimited product subscriptions, such as New Relic APM Lite.

New Relic Insights, Browser, and Synthetics require you to identify a predefined usage level (product bucket). This allows the API to apply a pricing discount based on the specific quantity you select.

The quantity you identify must be an exact match for the product and subscription level. For a list of available product buckets, see:

promo_code
Type: String
Default: (none)

Any related promotional code for this subscription.

Not yet supported through the Partnership API's subscription endpoint. However, you can pass the promo_code as part of the subscription with the account API's Create call.

data_retention (required only for Insights subscriptions)
Type: Integer
Default: (none)

Number of weeks the Insights event information will be retained.

Mapping for products (product_id)

With each account creation call, you must supply at least one New Relic product type. The API only accepts the numeric product_id for the type.

Creating subscriptions for Serverless, Logs, and Traces is not supported in the New Relic Partnership API. If your account has these subscriptions, any attempt to make changes will return an error. Please contact your account executive to modify subscriptions.

New Startup and Small Business service plans no longer are available through the New Relic Partnership API.

APM

The number of allowable hosts per account and the data retention period vary by subscription level within New Relic APM's pricing structure. For example, New Relic APM allows an unlimited number of allowable hosts for Lite accounts but only a 24-hour data retention period.

In addition, pricing and data retention depend on whether you select pricing plans based on hosts or compute units (CU). Use the product ID's integer format to identify the subscription level and type of plan.

APM subscription level Product ID
Lite 1
Standard 2
Standard Annual 3
Pro (Host) 4
Pro Annual (Host) 5
Enterprise 6
Enterprise Annual 7
APM Essentials (Host) 8
APM Essentials Annual (Host) 9

If you select pricing plans based on compute units (CU), use these product ID integer formats to identify the subscription level and type of plan.

APM Compute Units (CU) subscription level Product ID
Pro CU 26
Pro Annual CU 27
APM Essentials CU 28
APM Essentials Annual CU 29
Mobile

New Relic Mobile's pricing structure allows 100,000 monthly active users per account at the Enterprise subscription level. Data retention varies by subscription level. Use the product ID's integer format to identify the subscription level.

Mobile subscription level Product ID
Lite 10
Enterprise 13
Enterprise Annual 14
Insights

New Relic Insights bases the pricing structure on the number of allowable events stored and the associated data retention policy. For example, data retention for Insights Free is one day.

Insights subscription level Product ID
Free 15
None 16
Pro 18
Pro Annual 19
Browser

New Relic Browser's pricing structure allows an unlimited number of app users, regardless of subscription level. However, the number of allowable page views per month and the data retention period vary by subscription level. For example:

  • Lite accounts include an unlimited number of page views per month and 24-hour data retention.
  • Pro account pricing starts at 500,000 page views per month and three months data retention.

Use the product ID's integer format to identify the subscription level.

Browser subscription level Product ID
Lite 20
Pro 21
Pro Annual 22
Synthetics

With New Relic Synthetics' pricing structure, the default number of allowable monitoring checks and the data retention period vary by subscription level. Use the product ID's integer format to identify the subscription level.

Synthetics subscription level Product ID
Lite 23
Pro 24
Pro Annual 25

If you previously used the deprecated Partnership availability monitoring API, you can use the Synthetics API to provision a check and the REST API for New Relic Alerts to create an alert notification for your customers.

Infrastructure

With New Relic Infrastructure's pricing structure, the default number of instances and the data retention period vary by subscription level. Infrastructure events do not count against your New Relic Insights quota, even though you can query them in Insights.

New Relic Infrastructure offers pricing plans based on Compute Units (CU) only. Use the product ID's integer format to identify the subscription level.

Infrastructure subscription level Product ID
Infrastructure None 31
Infrastructure Pro (CU) 32
Infrastructure Pro Annual (CU) 33
Infrastructure Essentials (CU) 34
Infrastructure Essentials Annual (CU) 35

Subscription API calls

Here are the URL patterns for subscription-related API functions. If used, send them along with the JSON object and an HTTP header containing the Partner API key. For example:

GET .../api/v2/partners/:PARTNER_ID:/accounts/:ACCOUNT_ID/subscriptions
x-api-key: :PARTNER_ACCOUNT_KEY:
Content-Type: application/json

{ JSON data }
Call Resource URL pattern
List (index) all subscriptions of an account.
GET /api/v2/partners/:PARTNER_ID:/accounts/:ACCOUNT_ID:/subscriptions
Show a subscription for an account.
GET /api/v2/partners/:PARTNER_ID:/accounts/:ACCOUNT_ID:/subscriptions/:ID
Replace the current subscription level with a new subscription.
POST /api/v2/partners/:PARTNER_ID:/accounts/:ACCOUNT_ID:/subscriptions

Subscription API examples

Here are examples of an API call to create a subscription and the JSON response listing subscriptions for the account.

Example subscription object
{
  "subscriptions": [
    {
      "product_id": 4,
      "quantity": 2
    },
    {
      "product_id": 13,
      "quantity": 2
    }
  ]
}
Example JSON response
{
  "id": 1069012,
  "starts_on": "2016-05-16",
  "expires_on": null,
  "annual_renewal_on": null,
  "products": [
  {
    "product_id": 4,
    "name": "Pro",
    "units": 2,
    "price": 218.0
  },
  {
    "product_id": 13,
    "name": "Mobile Enterprise",
    "units": 2,
    "price": 1500.0
  },
  {
    "product_id": 20,
    "name": "Browser Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 15,
    "name": "Insights Free",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 23,
    "name": "Synthetics Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 31,
    "name": "Infrastructure None",
    "units": 0,
    "price": 0.0
  }
  ]
}
Subscription status

Here are typical subscription status values that the API call may return.

Subscription status Description
pending The customer has signed up for a New Relic product, but payment still needs to be processed.
authorized A credit card has been authorized and the vault key stored, but payment has not been captured.
free This subscription is for a free New Relic product. No further processing is required.
paid A payment has been captured and the next payment date has been set.
payment_declined The last attempt to authorize payment failed.
canceled The New Relic account has no active subscription and is not active. No payments should be authorized or captured.
replaced This subscription has been superseded by another New Relic subscription.

API examples (v2)

Here are API example requests and responses to list, show, create, and update partner subscriptions. Line breaks in responses are for readability. The actual responses appear as a continuous line.

List

Request:

curl -X GET \
     -H 'x-api-key:PARTNER_ACCOUNT_KEY' \
     -H 'Content-Type:application/json' \
     https://rpm.newrelic.com/api/v2/partners/:PARTNER_ID/accounts/:ACCOUNT_ID/subscriptions

Response:

{
  "subscriptions": [
  {
    "id": :SUBSCRIPTION_ID,
    "starts_on": "2016-05-16",
    "expires_on": null,
    "annual_renewal_on": null,
    "products": [
    {
      "product_id": 1,
      "name": "Lite",
      "units": 0,
      "price": 0.0
    },
    {
      "product_id": 10,
      "name": "Mobile Lite",
      "units": 0,
      "price": 0.0
    },
    {
      "product_id": 20,
      "name": "Browser Lite",
      "units": 0,
      "price": 0.0
    },
   {
      "product_id": 16,
      "name": "Insights None",
      "units": 0,
      "price": 0.0
    },
    {
      "product_id": 23,
      "name": "Synthetics Lite",
      "units": 0,
      "price": 0.0
  },
  {
    "product_id": 31,
    "name": "Infrastructure None",
    "units": 0,
    "price": 0.0
  }
  ]
}
Show

Request:

curl -X GET \
     -H 'x-api-key:PARTNER_ACCOUNT_KEY' \
     -H 'Content-Type:application/json' \
     https://rpm.newrelic.com/api/v2/partners/:PARTNER_ID/accounts/:ACCOUNT_ID/subscriptions/:SUBSCRIPTION_ID

Response:

{
  "id": :SUBSCRIPTION_ID,
  "starts_on": "2016-05-16",
  "expires_on": null,
  "annual_renewal_on": null,
  "products": [
  {
    "product_id": 1,
    "name": "Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 10,
    "name": "Mobile Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 20,
    "name": "Browser Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 16,
    "name": "Insights None",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 23,
    "name": "Synthetics Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 31,
    "name": "Infrastructure None",
    "units": 0,
    "price": 0.0
  }
  ]
}
Create new (replace existing subscription)

Here is an example of how to use the Partnership API create a new subscription (replace the existing subscription level for all products) for the account.

Request:

curl -X POST \
     -H 'x-api-key:PARTNER_ACCOUNT_KEY' \
     -H 'Content-Type:application/json' \
     -d '{"subscriptions":[{"product_id":"1", "quantity":1}]}' \
     https://rpm.newrelic.com/api/v2/partners/:PARTNER_ID/accounts/:ACCOUNT_ID/subscriptions

Response:

{
  "id": 1069068,
  "starts_on": "2016-05-16",
  "expires_on": null,
  "annual_renewal_on": null,
  "products": [
  {
    "product_id": 1,
    "name": "Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 10,
    "name": "Mobile Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 20,
    "name": "Browser Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 16,
    "name": "Insights None",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 23,
    "name": "Synthetics Lite",
    "units": 0,
    "price": 0.0
  },
  {
    "product_id": 31,
    "name": "Infrastructure None",
    "units": 0,
    "price": 0.0
  }
  ]
}

For more help

Additional documentation resources include:

If you need more help, check out these support and learning resources: