Skip to main content
POST
/
organizations
/
{orgId}
/
accountplans
/
{id}
/
replace
Replace AccountPlan
curl --request POST \
  --url https://api.m3ter.com/organizations/{orgId}/accountplans/{id}/replace \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "version": 123,
  "customFields": "<unknown>",
  "planId": "<string>",
  "planGroupId": "<string>",
  "endDate": "2023-11-07T05:31:56Z",
  "code": "<string>",
  "billEpoch": "2023-12-25",
  "contractId": "<string>",
  "childBillingMode": "PARENT_SUMMARY"
}
'
{
  "originalAccountPlan": {
    "id": "<string>",
    "version": 123,
    "customFields": {},
    "accountId": "<string>",
    "productId": "<string>",
    "planId": "<string>",
    "planGroupId": "<string>",
    "startDate": "2023-11-07T05:31:56Z",
    "endDate": "2023-11-07T05:31:56Z",
    "code": "<string>",
    "billEpoch": "2023-12-25",
    "contractId": "<string>",
    "childBillingMode": "PARENT_SUMMARY",
    "dtCreated": "2023-11-07T05:31:56Z",
    "dtLastModified": "2023-11-07T05:31:56Z",
    "createdBy": "<string>",
    "lastModifiedBy": "<string>"
  },
  "newAccountPlan": {
    "id": "<string>",
    "version": 123,
    "customFields": {},
    "accountId": "<string>",
    "productId": "<string>",
    "planId": "<string>",
    "planGroupId": "<string>",
    "startDate": "2023-11-07T05:31:56Z",
    "endDate": "2023-11-07T05:31:56Z",
    "code": "<string>",
    "billEpoch": "2023-12-25",
    "contractId": "<string>",
    "childBillingMode": "PARENT_SUMMARY",
    "dtCreated": "2023-11-07T05:31:56Z",
    "dtLastModified": "2023-11-07T05:31:56Z",
    "createdBy": "<string>",
    "lastModifiedBy": "<string>"
  }
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

UUID of the organization

id
string
required

The UUID of the AccountPlan to replace.

Body

application/json
accountId
string
required

The unique identifier (UUID) for the Account.

Required string length: 36
startDate
string<date-time>
required

The start date (in ISO-8601 format) for the AccountPlan or AccountPlanGroup becoming active for the Account.

version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
customFields
any
planId
string

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.

Required string length: 36
planGroupId
string

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.

Required string length: 36
endDate
string<date-time>

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.

code
string

A unique short code for the AccountPlan or AccountPlanGroup.

Maximum string length: 80
billEpoch
string<date>

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.
contractId
string

The unique identifier (UUID) for a Contract to which you want to add the Plan or Plan Group being attached to the Account.

Required string length: 36
childBillingMode
enum<string>

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.

Available options:
PARENT_SUMMARY,
PARENT_BREAKDOWN,
CHILD

Response

Return the updated existing AccountPlan and the created AccountPlan

originalAccountPlan
object
newAccountPlan
object