M3ter AccountPlan API
Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, list and delete. **AccountPlans** An Account represents one of your end-customer accounts. To create an AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the charges incurred at billing by your end customer for consuming the Product the Plan is for: * **AccountPlan Active/Inactive**. Set start and end dates to define the period the AccountPlan is active for the Account. * **AccountPlan per Product**. If an end customer consumes multiple Products, create separate AccountPlans to charge for each Product. **AccountPlan Constraints:** * Only one AccountPlan per Product can be active at any one time for an Account. * If you create a Plan as a custom Plan for a specific Account, you can only use it to create an AccountPlan for that Account. **AccountPlanGroups** Plan Groups are used when you want to apply a minimum spend amount at billing across several of your Products each of which are priced separately - when you create the Plan Group, you define an overall minimum spend and then add any priced Plans you want to include in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account that consumes the separate Products which are priced using the included Plans. At billing, the minimum spend you've defined for the Plan Group is applied: * **Active AccountPlanGroup**. Set the start and end dates to define the period for which the Plan Group will be active for the Account. **Plan Group Notes:** * You can only add *one Plan for the same Product* to a Plan Group. See the [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more details on creating Plan Groups. * You can create a *custom Plan Group* for an Account, which means the Plan Group can only be attached to that Account to create an AccountPlanGroup. **AcountPlanGroup - Notes and Constraints:** * **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, this creates an AccountPlanGroup. However, the m3ter data model *does not support a separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a `planGroupId` is used instead of a `planId` when it's created. See the [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) call in this section and [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) in our main User Documentation. * **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product can be active at any one time for an Account* is preserved: * Multiple attached Plan Groups on an Account can have overlapping dates only if none of the Plan Groups contain a Plan belonging to the same Product. If you try to attach a Plan Group to an Account with Plan Groups already attached and: * The new Plan Group contains a Product Plan that also belongs to a Plan Group already attached to the Account. * The dates for these "matched Plan" Plan Groups being active for the Account would overlap. * Then you'll receive an error and the attachment will be blocked.
Documentation
Specifications
Other Resources
openapi: 3.0.1
info:
title: m3ter Account AccountPlan API
description: "If you are using Postman, you can:\n- Use the **Download** button above to download the m3ter Open API spec JSON file and then import this file as the **m3ter API Collection** into your Workspace. See [Importing the m3ter Open API](https://www.m3ter.com/docs/guides/m3ter-apis/getting-started-with-api-calls#importing-the-m3ter-open-api) in our main user Documentation for details.\n- Copy this link: [m3ter-Template API Collection](https://www.datocms-assets.com/78893/1672846767-m3ter-template-api-collection-postman_collection.json) and use it to import the **m3ter-Template API Collection** into your Workspace. See [Importing the m3ter Template API Collection](https://www.m3ter.com/docs/guides/m3ter-apis/getting-started-with-api-calls#importing-the-m3ter-template-api-collection) in our main user Documentation for details.\n\n---\n\n# Introduction\nThe m3ter platform supports two HTTP-based REST APIs returning JSON encoded responses:\n- The **Ingest API**, which you can use for submitting raw data measurements. *(See the [Submit Measurements](https://www.m3ter.com/docs/api#tag/Measurements/operation/SubmitMeasurements) endpoint in this API Reference.)*\n- The **Config API**, which you can use for configuration and management. *(All other endpoints in this API Reference.)* \n\n## Authentication and Authorization\nOur APIs use an industry-standard authorization protocol known as the OAuth 2.0 specification.\n\nOAuth2 supports several grant types, each designed for a specific use case. m3ter uses the following two grant types:\n - **Authorization Code**: Used for human login access via the m3ter Console.\n - **Client Credentials**: Used for machine-to-machine communication and API access.\n\nComplete the following flow for API access:\n\n1. **Create a Service User and add Permissions**: Log in to the m3ter Console, go to **Settings**, **Access** then **Service Users** tab, and create a Service User. To enable API calls, grant the user **Administrator** permissions. \n \n2. **Generate Access Keys**: In the Console, open the *Overview* page for the Service User by clicking on the name. Generate an **Access Key id** and **Api Secret**. Make sure you copy the **Api Secret** because it is only visible at the time of creation. \n\nSee [Service Authentication](https://www.m3ter.com/docs/guides/authenticating-with-the-platform/service-authentication) for detailed instructions and an example.\n\n3. **Obtain a Bearer Token using Basic Auth**: We implement the OAuth 2.0 Client Credentials Grant authentication flow for Service User Authentication. Submit a request to the m3ter OAuth Client Credentials authentication flow, using your concatenated **Access Key id** and **Api Secret** to obtain a Bearer Token for your Service User. *See examples below.* \n \n4. **Bearer Token Usage**: Use the HTTP 'Authorization' header with the bearer token to authorise all subsequent API requests. \n\n> Warning: The Bearer Token is valid for 18,000 seconds or 5 hours. When the token has expired, you must obtain a new one.\n\nBelow are two examples for obtaining a Bearer Token using Basic Auth: the first in cURL and the second as a Python script. \n\n### cURL Example\n1. Open your terminal or command prompt. \n2. Use the following `cURL` command to obtain a Bearer Token:\n\n```bash\ncurl -X POST https://api.m3ter.com/oauth/token \\\n -H 'Content-Type: application/x-www-form-urlencoded' \\\n -u your_access_key_id:your_api_secret \\\n -d 'grant_type=client_credentials'\n```\n\nReplace `your_access_key_id` and `your_api_secret` with your actual **Access Key id** and **Api Secret**.\n\n3. Run the command, and if successful, it will return a JSON response containing the Bearer Token. The response will look like this:\n\n```json\n{\n \"access_token\": \"your_bearer_token\",\n \"token_type\": \"Bearer\",\n \"expires_in\": 18000\n}\n```\n\nYou can then use the Bearer Token *(the value of `\"access_token\"`)* for subsequent API calls to m3ter.\n\n### Python Example\n1. Install the `requests` library if you haven't already:\n\n```bash\npip install requests\n```\n\n2. Use the following Python script to obtain a Bearer Token:\n\n```python\nimport requests\nimport base64\n\n# Replace these with your Access Key id and Api Secret\naccess_key_id = 'your_access_key_id'\napi_secret = 'your_api_secret'\n\n# Encode the Access Key id and Api Secret in base64 format\ncredentials = base64.b64encode(f'{access_key_id}:{api_secret}'.encode('utf-8')).decode('utf-8')\n\n# Set the m3ter token endpoint URL\ntoken_url = 'https://api.m3ter.com/oauth/token'\n\n# Set the headers for the request\nheaders = {\n 'Authorization': f'Basic {credentials}',\n 'Content-Type': 'application/x-www-form-urlencoded'\n}\n\n# Set the payload for the request\npayload = {\n 'grant_type': 'client_credentials'\n}\n\n# Send the request to obtain the Bearer Token\nresponse = requests.post(token_url, headers=headers, data=payload)\n\n# Check if the request was successful\nif response.status_code == 200:\n # Extract the Bearer Token from the response\n bearer_token = response.json()['access_token']\n print(f'Bearer Token: {bearer_token}')\nelse:\n print(f'Error: {response.status_code} - {response.text}')\n```\n\nReplace `your_access_key_id` and `your_api_secret` with your actual **Access Key id** and **Api Secret**. \n\n3. Run the script, and if successful, it will print the Bearer Token. You can then use this Bearer Token for subsequent API calls to m3ter.\n\n## Submitting Personally Identifiable Information (PII)\n**IMPORTANT!** Under the [Data Processing Agreement](https://www.m3ter.com/docs/legal/dpa), the only fields permissible for use in submitting any of your end-customer PII data in m3ter are the ``name``, ``address``, and ``emailAddress`` fields on the **Account** entity - see the details for [Create Account](https://www.m3ter.com/docs/api#operation/PostAccount). See also section 4.2 of the [Terms of Service](https://www.m3ter.com/docs/legal/terms-of-service).\n\n## Rate and Payload Limits\n### Config API Request Rate Limits\nSee [Config API Limits](https://www.m3ter.com/docs/guides/m3ter-apis/config-api-limits).\n\n### Data Explorer API Request Rate Limits\nSee [Data Explorer Request Rate Limits](https://www.m3ter.com/docs/guides/m3ter-apis/config-api-limits#date-explorer-request-rate-limits).\n\n### Ingest API Request Rate and Payload Limits\nSee [Ingest API Limits](https://www.m3ter.com/docs/guides/m3ter-apis/ingest-api-limits) for more information.\n\n## Pagination\n**List Endpoints**\nAPI endpoints that have a List resources request support cursor-based pagination - for example, the `List Accounts` request. These List calls support pagination by taking the two parameters `pageSize` and `nextToken`. \n\nThe response of a List API call is a single page list. If the `nextToken` parameter is not supplied, the first page returned contains the newest objects chronologically. Specify a `nextToken` to retrieve the page of older objects that occur immediately after the last object on the previous page.\n\nUse `pageSize` to limit the list results per page, typically this allows up to a maximum of 100 or 200 per page.\n\n**Search Endpoints**\nAPI endpoints that have a Search resources request support cursor-based pagination - for example, the `Search Accounts` request. These Search calls support pagination by taking the two parameters `pageSize` and `fromDocument`.\n\nThe response of a Search API call is a single page list. If the `fromDocument` parameter is not supplied, the first page returned contains the newest objects chronologically. Specify a `fromDocument` to retrieve the page of older objects that occur immediately after the last object on the previous page.\n\nUse `pageSize` to limit the list results per page, typically this allows up to a maximum of 100 or 200 per page. Default is 10.\n\n## API Quick Start\nSee [Getting Started with API Calls](https://www.m3ter.com/docs/guides/m3ter-apis/getting-started-with-api-calls) for detailed guidance on how to use our API to:\n* Create a Service User and add permissions.\n* Generate access keys for the Service User.\n* Use basic authentication to obtain a Bearer Token.\n\nFor further guidance, also see [Creating and Configuring Service Users](https://www.m3ter.com/docs/guides/organization-and-access-management/managing-users/creating-and-configuring-service-users).\n\n## Other Languages\nIf you want to work with the m3ter REST APIs using other languages such as:\n* Python\n* JavaScript\n* C++\n\nPlease see the [Developer Tools](https://www.m3ter.com/docs/guides/developer-tools) topic in our main documentation for information about available SDKs.\n\n\n# Authentication\n<!-- ReDoc-Inject: <security-definitions> -->"
version: '1.0'
x-logo:
url: https://console.m3ter.com/m3ter-logo-black.svg
servers:
- url: https://api.m3ter.com
security:
- OAuth2: []
tags:
- name: AccountPlan
description: "Endpoints for AccountPlan and AccountPlanGroup related operations such as creation, update, list and delete. \n\n**AccountPlans**\nAn Account represents one of your end-customer accounts. To create an AccountPlan, you attach a Product Plan to an Account. The AccountPlan then determines the charges incurred at billing by your end customer for consuming the Product the Plan is for:\n* **AccountPlan Active/Inactive**. Set start and end dates to define the period the AccountPlan is active for the Account.\n* **AccountPlan per Product**. If an end customer consumes multiple Products, create separate AccountPlans to charge for each Product.\n\n**AccountPlan Constraints:**\n* Only one AccountPlan per Product can be active at any one time for an Account.\n* If you create a Plan as a custom Plan for a specific Account, you can only use it to create an AccountPlan for that Account.\n\n**AccountPlanGroups**\nPlan Groups are used when you want to apply a minimum spend amount at billing across several of your Products each of which are priced separately - when you create the Plan Group, you define an overall minimum spend and then add any priced Plans you want to include in the Group. To create an AccounPlanGroup, you can attach a Plan Group to an Account that consumes the separate Products which are priced using the included Plans. At billing, the minimum spend you've defined for the Plan Group is applied:\n* **Active AccountPlanGroup**. Set the start and end dates to define the period for which the Plan Group will be active for the Account.\n\n**Plan Group Notes:**\n* You can only add *one Plan for the same Product* to a Plan Group. See the [Plan Group](https://www.m3ter.com/docs/api#tag/PlanGroup) in this API Reference for more details on creating Plan Groups.\n* You can create a *custom Plan Group* for an Account, which means the Plan Group can only be attached to that Account to create an AccountPlanGroup.\n\n**AcountPlanGroup - Notes and Constraints:**\n* **AccountPlanGroup is type of AccountPlan** When you attach a Plan Group to an Account, this creates an AccountPlanGroup. However, the m3ter data model *does not support a separate AccountPlanGroup entity*, and an AccountPlanGroup is a type of AccountPlan where a `planGroupId` is used instead of a `planId` when it's created. See the [Create AccountPlan](https://www.m3ter.com/docs/api#tag/AccountPlan/operation/PostAccountPlan) call in this section and [Attaching Plan Groups to an Account](https://www.m3ter.com/docs/guides/end-customer-accounts/attaching-plan-groups-to-an-account) in our main User Documentation.\n* **Multiple AccountPlan Groups:** You can attach more than one Plan Group to an Account to create multiple AccountPlanGroups, but the rule that *only one attached Plan per Product can be active at any one time for an Account* is preserved:\n\t* Multiple attached Plan Groups on an Account can have overlapping dates only if none of the Plan Groups contain a Plan belonging to the same Product. If you try to attach a Plan Group to an Account with Plan Groups already attached and:\n\t\t* The new Plan Group contains a Product Plan that also belongs to a Plan Group already attached to the Account.\n\t\t* The dates for these \"matched Plan\" Plan Groups being active for the Account would overlap.\n\t\t* Then you'll receive an error and the attachment will be blocked.\n"
paths:
/organizations/{orgId}/accountplans/{id}:
get:
tags:
- AccountPlan
summary: Retrieve AccountPlan
description: Retrieve the AccountPlan or AccountPlanGroup details corresponding to the given UUID.
operationId: GetAccountPlan
parameters:
- name: orgId
in: path
description: The unique identifier (UUID) for your Organization. The Organization represents your company as a direct customer of our service.
required: true
style: simple
explode: false
schema:
type: string
deprecated: true
x-stainless-deprecation-message: the org id should be set at the client level instead
- name: id
in: path
description: The unique identifier (UUID) of the AccountPlan or AccountPlanGroup to retrieve.
required: true
style: simple
explode: false
schema:
type: string
responses:
'200':
description: Returns the AccountPlan or AccountPlanGroup
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanResponse'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
put:
tags:
- AccountPlan
summary: Update AccountPlan
description: 'Update the AccountPlan or AccountPlanGroup with the given UUID.
This endpoint updates a new AccountPlan or AccountPlanGroup for a specific Account in your Organization. The updated information should be provided in the request body.
**Notes:**
* You cannot use this call to update *both* an AccountPlan and AccountPlanGroup for an Account at the same time. If you want to update an AccounPlan and an AccountPlanGroup attached to an Account, you must submit two separate calls.
* If you have created Custom Fields for an AccountPlan, when you use this endpoint to update the AccountPlan use the `customFields` parameter to preserve those Custom Fields. If you omit them from the update request, they will be lost.'
operationId: PutAccountPlan
parameters:
- name: orgId
in: path
description: The unique identifier (UUID) for your Organization. The Organization represents your company as a direct customer of our service.
required: true
style: simple
explode: false
schema:
type: string
deprecated: true
x-stainless-deprecation-message: the org id should be set at the client level instead
- name: id
in: path
description: The unique identifier (UUID) of the AccountPlan or AccountPlanGroup to update.
required: true
style: simple
explode: false
schema:
type: string
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanRequest'
required: true
responses:
'200':
description: Returns the updated AccountPlan or AccountPlanGroup.
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanResponse'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
delete:
tags:
- AccountPlan
summary: Delete AccountPlan
description: 'Delete the AccountPlan or AccountPlanGroup with the given UUID.
This endpoint deletes an AccountPlan or AccountPlanGroup that has been attached to a specific Account in your Organization.'
operationId: DeleteAccountPlan
parameters:
- name: orgId
in: path
description: The unique identifier (UUID) of your Organization. The Organization represents your company as a direct customer of our service.
required: true
style: simple
explode: false
schema:
type: string
deprecated: true
x-stainless-deprecation-message: the org id should be set at the client level instead
- name: id
in: path
description: The unique identifer (UUID) of the AccountPlan or AccountPlanGroup to delete.
required: true
style: simple
explode: false
schema:
type: string
responses:
'200':
description: Returns the deleted AccountPlan or AccountPlanGroup
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanResponse'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
/organizations/{orgId}/accountplans:
get:
tags:
- AccountPlan
summary: List AccountPlans
description: 'Retrieves a list of AccountPlan and AccountPlanGroup entities for the specified Organization. The list can be paginated for easier management, and supports filtering with various query parameters.
'
operationId: ListAccountPlans
parameters:
- name: orgId
in: path
description: The unique identifier (UUID) of your Organization. The Organization represents your company as a direct customer of our service.
required: true
style: simple
explode: false
schema:
type: string
deprecated: true
x-stainless-deprecation-message: the org id should be set at the client level instead
- name: pageSize
in: query
description: The maximum number of AccountPlans and AccountPlanGroups to return per page.
required: false
allowEmptyValue: true
style: form
explode: true
schema:
maximum: 100
minimum: 1
type: integer
format: int32
- name: nextToken
in: query
description: The `nextToken` for retrieving the next page of AccountPlans and AccountPlanGroups. It is used to fetch the next page of AccountPlans and AccountPlanGroups in a paginated list.
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: string
- name: date
in: query
description: 'The specific date for which you want to retrieve AccountPlans and AccountPlanGroups.
**NOTE:** Returns both active and inactive AccountPlans and AccountPlanGroups for the specified date.'
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: string
- name: account
in: query
description: 'The unique identifier (UUID) for the Account whose AccountPlans and AccountPlanGroups you want to retrieve.
**NOTE:** Only returns the currently active AccountPlans and AccountPlanGroups for the specified Account. Use in combination with the `includeall` query parameter to return both active and inactive.'
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: string
- name: plan
in: query
description: 'The unique identifier (UUID) for the Plan whose associated AccountPlans you want to retrieve.
**NOTE:** Does not return AccountPlanGroups if you use a `planGroupId`.'
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: string
- name: product
in: query
description: 'The unique identifier (UUID) for the Product whose associated AccountPlans you want to retrieve.
**NOTE:** You cannot use the `product` query parameter as a single filter condition, but must always use it in combination with the `account` query parameter.'
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: string
- name: includeall
in: query
description: 'A Boolean flag that specifies whether to include both active and inactive AccountPlans and AccountPlanGroups in the list.
* **TRUE** - both active and inactive AccountPlans and AccountPlanGroups are included in the list.
* **FALSE** - only active AccountPlans and AccountPlanGroups are retrieved in the list.*(Default)*
**NOTE:** Only operative if you also have one of `account`, `plan` or `contract` as a query parameter.'
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: boolean
- name: ids
in: query
description: A list of unique identifiers (UUIDs) for specific AccountPlans and AccountPlanGroups you want to retrieve.
required: false
allowEmptyValue: true
style: form
explode: true
schema:
type: array
items:
type: string
- name: contract
in: query
description: 'The unique identifier (UUID) of the Contract which the AccountPlans you want to retrieve have been linked to.
**NOTE:** Does not return AccountPlanGroups that have been linked to the Contract.'
required: false
style: form
explode: true
schema:
type: string
nullable: true
responses:
'200':
description: Returns the list of AccountPlans and AccountPlanGroups
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedAccountPlanResponseData'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
post:
tags:
- AccountPlan
summary: Create AccountPlan
description: 'Create a new AccountPlan or AccountPlanGroup.
This endpoint creates a new AccountPlan or AccountPlanGroup for a specific Account in your Organization. The details of the new AccountPlan or AccountPlanGroup should be supplied in the request body.
**Note:** You cannot use this call to create *both* an AccountPlan and AccountPlanGroup for an Account at the same time. If you want to create both for an Account, you must submit two separate calls.'
operationId: PostAccountPlan
parameters:
- name: orgId
in: path
description: The unique identifier (UUID) for your Organization. The Organization represents your company as a direct customer of our service.
required: true
style: simple
explode: false
schema:
type: string
deprecated: true
x-stainless-deprecation-message: the org id should be set at the client level instead
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanRequest'
required: true
responses:
'200':
description: Returns the created AccountPlan or AccountPlanGroup
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanResponse'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
/organizations/{orgId}/accountplans/{id}/replace:
post:
tags:
- AccountPlan
summary: Replace AccountPlan
description: End-dates the specified AccountPlan at the new startDate and creates the new AccountPlan.
operationId: ReplaceAccountPlan
parameters:
- name: orgId
in: path
description: UUID of the organization
required: true
style: simple
explode: false
schema:
type: string
deprecated: true
x-stainless-deprecation-message: the org id should be set at the client level instead
- name: id
in: path
description: The UUID of the AccountPlan to replace.
required: true
style: simple
explode: false
schema:
type: string
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/AccountPlanRequest'
required: true
responses:
'200':
description: Return the updated existing AccountPlan and the created AccountPlan
content:
application/json:
schema:
$ref: '#/components/schemas/ReplaceAccountPlanResponse'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
components:
schemas:
PaginatedAccountPlanResponseData:
type: object
properties:
data:
type: array
description: ''
items:
$ref: '#/components/schemas/AccountPlanResponse'
nextToken:
type: string
description: ''
description: ''
AccountPlanRequest:
type: object
description: ''
allOf:
- $ref: '#/components/schemas/AbstractRequestWithCustomFields'
- $ref: '#/components/schemas/AbstractRequest'
- required:
- accountId
- startDate
properties:
accountId:
maxLength: 36
minLength: 36
type: string
description: The unique identifier (UUID) for the Account.
planId:
maxLength: 36
minLength: 36
type: string
description: 'The unique identifier (UUID) of the Plan to be attached to the Account to create an AccountPlan.
**Note:** Exclusive of the `planGroupId` request parameter - exactly one of `planId` or `planGroupId` must be used per call.'
planGroupId:
maxLength: 36
minLength: 36
type: string
description: 'The unique identifier (UUID) of the PlanGroup to be attached to the Account to create an AccountPlanGroup.
**Note:** Exclusive of the `planId` request parameter - exactly one of `planId` or `planGroupId` must be used per call.'
startDate:
type: string
description: The start date *(in ISO-8601 format)* for the AccountPlan or AccountPlanGroup becoming active for the Account.
format: date-time
endDate:
type: string
description: The end date *(in ISO-8601 format)* for when the AccountPlan or AccountPlanGroup ceases to be active for the Account. If not specified, the AccountPlan or AccountPlanGroup remains active indefinitely.
format: date-time
code:
maxLength: 80
pattern: ^([^[\p{Cntrl}\s]])|([^[\p{Cntrl}\s]][[^[\p{Cntrl}\s]] ]*[^[\p{Cntrl}\s]])$
type: string
description: A unique short code for the AccountPlan or AccountPlanGroup.
billEpoch:
type: string
description: 'Optional setting to define a *billing cycle date*, which acts as a reference for when in the applied billing frequency period bills are created:
* For example, if you attach a Plan to an Account where the Plan is configured for monthly billing frequency and you''ve defined the period the Plan will apply to the Account to be from January 1st, 2022 until January 1st, 2023. You then set a `billEpoch` date of February 15th, 2022. The first Bill will be created for the Account on February 15th, and subsequent Bills created on the 15th of the months following for the remainder of the billing period - March 15th, April 15th, and so on.
* If not defined, then the `billEpoch` date set for the Account will be used instead.
* The date is in ISO-8601 format.'
format: date
contractId:
maxLength: 36
minLength: 36
type: string
description: The unique identifier (UUID) for a Contract to which you want to add the Plan or Plan Group being attached to the Account.
childBillingMode:
description: 'If the Account is either a Parent or a Child Account, this specifies the Account hierarchy billing mode. The mode determines how billing will be handled and shown on bills for charges due on the Parent Account, and charges due on Child Accounts:
* **Parent Breakdown** - a separate bill line item per Account. Default setting.
* **Parent Summary** - single bill line item for all Accounts.
* **Child** - the Child Account is billed.'
$ref: '#/components/schemas/ChildBillingMode'
AbstractRequestWithCustomFields:
type: object
description: ''
allOf:
- $ref: '#/components/schemas/AbstractRequest'
- properties:
customFields:
type: object
description: 'User defined fields enabling you to attach custom data. The value for a custom field can be either a string or a number.
If `customFields` can also be defined for this entity at the Organizational level, `customField` values defined at individual level override values of `customFields` with the same name defined at Organization level.
See [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields) in the m3ter documentation for more information.'
maxItems: 100
additionalProperties:
anyOf:
- title: StringCustomFieldReq
type: string
- title: IntegerCustomFieldReq
type: integer
- title: NumberCustomFieldReq
type: number
AbstractResponse:
required:
- id
type: object
properties:
id:
type: string
description: 'The UUID of the entity. '
version:
type: integer
description: 'The version number:
- **Create:** On initial Create to insert a new entity, the version is set at 1 in the response.
- **Update:** On successful Update, the version is incremented by 1 in the response.'
format: int64
x-stainless-terraform-configurability: computed
x-stainless-terraform-always-send: true
description: ''
AccountPlanResponse:
type: object
description: ''
allOf:
- $ref: '#/components/schemas/AbstractResponseWithCustomFields'
- $ref: '#/components/schemas/AbstractResponse'
- properties:
accountId:
type: string
description: The unique identifier (UUID) for the Account to which the AccountPlan or AccounPlanGroup is attached.
productId:
type: string
description: 'The unique identifier (UUID) for the Product associated with the AccountPlan.
**Note:** Not present in response for AccountPlanGroup - Plan Groups can contain multiple Plans belonging to different Products.'
planId:
type: string
description: The unique identifier (UUID) of the Plan that has been attached to the Account to create the AccountPlan.
planGroupId:
type: string
description: The unique identifier (UUID) of the Plan Group that has been attached to the Account to create the AccountPlanGroup.
startDate:
type: string
description: The start date *(in ISO-8601 format)* for the when the AccountPlan or AccountPlanGroup starts to be active for the Account.
format: date-time
endDate:
type: string
description: The end date *(in ISO-8601 format)* for when the AccountPlan or AccountPlanGroup ceases to be active for the Account. If not specified, the AccountPlan or AccountPlanGroup remains active indefinitely.
format: date-time
code:
type: string
description: 'The unique short code of the AccountPlan or AccountPlanGroup. '
billEpoch:
type: string
description: The initial date for creating
# --- truncated at 32 KB (37 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/m3ter/refs/heads/main/openapi/m3ter-accountplan-api-openapi.yml