Skip to main content
PUT
/
organizations
/
{orgId}
/
accounts
/
{id}
Update Account
curl --request PUT \
  --url https://api.m3ter.com/organizations/{orgId}/accounts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "code": "<string>",
  "emailAddress": "[email protected]",
  "version": 123,
  "customFields": "<unknown>",
  "address": {
    "addressLine1": "<string>",
    "addressLine2": "<string>",
    "addressLine3": "<string>",
    "addressLine4": "<string>",
    "locality": "<string>",
    "region": "<string>",
    "postCode": "<string>",
    "country": "<string>"
  },
  "parentAccountId": "<string>",
  "billEpoch": "2023-12-25",
  "purchaseOrderNumber": "<string>",
  "currency": "USD",
  "statementDefinitionId": "<string>",
  "autoGenerateStatementMode": "NONE",
  "creditApplicationOrder": [
    "PREPAYMENT"
  ],
  "daysBeforeBillDue": 1
}
'
{
  "id": "<string>",
  "version": 123,
  "customFields": {},
  "name": "<string>",
  "code": "<string>",
  "address": {
    "addressLine1": "<string>",
    "addressLine2": "<string>",
    "addressLine3": "<string>",
    "addressLine4": "<string>",
    "locality": "<string>",
    "region": "<string>",
    "postCode": "<string>",
    "country": "<string>"
  },
  "emailAddress": "<string>",
  "parentAccountId": "<string>",
  "billEpoch": "2023-12-25",
  "purchaseOrderNumber": "<string>",
  "currency": "USD",
  "statementDefinitionId": "<string>",
  "dtCreated": "2023-11-07T05:31:56Z",
  "dtLastModified": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastModifiedBy": "<string>",
  "autoGenerateStatementMode": "NONE",
  "creditApplicationOrder": [
    "PREPAYMENT"
  ],
  "daysBeforeBillDue": 123
}

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. The Organization represents your company as a direct customer of the m3ter service.

id
string
required

The UUID of the Account to update.

Body

application/json

Account request for operations such as Create or Update Account.

name
string
required

Name of the Account.

Required string length: 1 - 200
code
string
required

Code of the Account. This is a unique short code used for the Account.

Required string length: 1 - 80
emailAddress
string<email>
required

Contact email 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
address
object

Contact address for the Account.

parentAccountId
string

Parent Account ID, or null if this Account does not have a parent.

billEpoch
string<date>

Optional setting to define a billing cycle date, which sets the date of the first Bill and acts as a reference for when in the applied billing frequency period subsequent 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 relevant Epoch date set for the billing frequency period at Organization level will be used instead.
  • The date is in ISO-8601 format.
purchaseOrderNumber
string

Purchase Order Number of the Account.

Optional attribute - allows you to set a purchase order number that comes through into invoicing. For example, your financial systems might require this as a reference for clearing payments.

Maximum string length: 100
currency
string

Account level billing currency, such as USD or GBP. Optional attribute:

  • If you define an Account currency, this will be used for bills.
  • If you do not define a currency, the billing currency defined at Organizational level will be used.

Note: If you've attached a Plan to the Account that uses a different currency to the billing currency, then you must add the relevant currency conversion rate at Organization level to ensure the billing process can convert line items calculated using the Plan currency into the selected billing currency. If you don't add these conversion rates, then bills will fail for the Account.

Example:

"USD"

statementDefinitionId
string

The UUID of the statement definition used when Bill statements are generated for the Account. If no statement definition is specified for the Account, the statement definition specified at Organizational level is used.

Bill statements can be used as informative backing sheets to invoices. Based on the usage breakdown defined in the statement definition, generated statements give a breakdown of usage charges on Account Bills, which helps customers better understand usage charges incurred over the billing period.

See Working with Bill Statements in the m3ter documentation for more details.

autoGenerateStatementMode
enum<string>

Specify whether to auto-generate statements once Bills are approved or locked.

  • None. Statements will not be auto-generated.
  • JSON. Statements are auto-generated in JSON format.
  • JSON and CSV. Statements are auto-generated in both JSON and CSV formats.
Available options:
NONE,
JSON,
JSON_AND_CSV
creditApplicationOrder
enum<string>[]

Define the order in which any Prepayment or Balance amounts on the Account are to be drawn-down against for billing. Four options:

  • "PREPAYMENT","BALANCE". Draw-down against Prepayment credit before Balance credit.
  • "BALANCE","PREPAYMENT". Draw-down against Balance credit before Prepayment credit.
  • "PREPAYMENT". Only draw-down against Prepayment credit.
  • "BALANCE". Only draw-down against Balance credit.

NOTES:

  • Any setting you define here overrides the setting for credit application order at Organization level.
  • If the Account belongs to a Parent/Child Account hierarchy, then the creditApplicationOrder settings are not available, and the draw-down order defaults always to Prepayment then Balance order.
Available options:
PREPAYMENT,
BALANCE
daysBeforeBillDue
integer<int32>

Enter the number of days after the Bill generation date that you want to show on Bills as the due date.

Note: If you define daysBeforeBillDue at individual Account level, this will take precedence over any daysBeforeBillDue setting defined at Organization level.

Required range: x > 0

Response

Returns the updated Account

Response containing an AccountResponse entity.

id
string
required

The UUID of the entity.

version
integer<int64>

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.
customFields
object

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 in the m3ter documentation for more information.

name
string

Name of the Account.

code
string

Code of the Account. This is a unique short code used for the Account.

address
object

Contact address for the Account.

emailAddress
string

Contact email for the Account.

parentAccountId
string

Parent Account ID, or null if this account does not have a parent.

billEpoch
string<date>

Defines first bill date for Account Bills. For example, if the Plan attached to the Account is set for monthly billing frequency and you set the first bill date to be January 1st, Bills are created every month starting on that date.

Optional attribute - if not defined, then first bill date is determined by the Epoch settings at Organizational level.

purchaseOrderNumber
string

Purchase Order Number of the Account.

Optional attribute - allows you to set a purchase order number that comes through into invoicing. For example, your financial systems might require this as a reference for clearing payments.

currency
string

Account level billing currency, such as USD or GBP. Optional attribute:

  • If you define an Account currency, this will be used for bills.
  • If you do not define a currency, the billing currency defined at Organizational will be used.

Note: If you've attached a Plan to the Account that uses a different currency to the billing currency, then you must add the relevant currency conversion rate at Organization level to ensure the billing process can convert line items calculated using the Plan currency into the selected billing currency. If you don't add these conversion rates, then bills will fail for the Account.

Example:

"USD"

statementDefinitionId
string

The UUID of the statement definition used when Bill statements are generated for the Account. If no statement definition is specified for the Account, the statement definition specified at Organizational level is used.

Bill statements can be used as informative backing sheets to invoices. Based on the usage breakdown defined in the statement definition, generated statements give a breakdown of usage charges on Account Bills, which helps customers better understand usage charges incurred over the billing period.

See Working with Bill Statements in the m3ter documentation for more details.

dtCreated
string<date-time>

The DateTime when the Account was created (in ISO 8601 format).

dtLastModified
string<date-time>

The DateTime when the Account was last modified (in ISO 8601 format).

createdBy
string

The ID of the user who created the account.

lastModifiedBy
string

The ID of the user who last modified the Account.

autoGenerateStatementMode
enum<string>

Specify whether to auto-generate statements once Bills are approved or locked.

  • None. Statements will not be auto-generated.
  • JSON. Statements are auto-generated in JSON format.
  • JSON and CSV. Statements are auto-generated in both JSON and CSV formats.
Available options:
NONE,
JSON,
JSON_AND_CSV
creditApplicationOrder
enum<string>[]

The order in which any Prepayment or Balance amounts on the Account are to be drawn-down against for billing. Four options:

  • "PREPAYMENT","BALANCE". Draw-down against Prepayment credit before Balance credit.
  • "BALANCE","PREPAYMENT". Draw-down against Balance credit before Prepayment credit.
  • "PREPAYMENT". Only draw-down against Prepayment credit.
  • "BALANCE". Only draw-down against Balance credit.
Available options:
PREPAYMENT,
BALANCE
daysBeforeBillDue
integer<int32>

The number of days after the Bill generation date shown on Bills as the due date.