Skip to main content
The m3ter Connector for Salesforce managed package offers the Generic m3ter API Invocable Action feature that lets admins and developers call any Organization-scoped m3ter API endpoint from Salesforce — Apex or Flow — reusing the package’s existing authentication, retry, and telemetry:
  • Admins. Automate m3ter from Flow without waiting on a developer.
  • System Integrators. Offers a supported, reusable primitive to build customer solutions on, instead of hand-rolling callouts every time.
If there isn’t a dedicated action for what you need yet, you can now do it yourself:
  • Call any m3ter endpoint from Flow/Apex.
  • Pull values out of responses without writing Apex.
  • Ready-to-clone example flows so teams start from something that works, not a blank canvas
This topic introduces and explains how to work with the Generic m3ter API Invocable Action feature:
Important!
  • Check Version. The Generic m3ter API Invocable Action feature described in this topic is only available in v1.2 and above of the m3ter Connector for Salesforce. See m3ter Connector for Salesforce - Changelog for details on how to check your current installed version.

Key Components

Notes:
  • The example classes and Flows are copy-and-adapt templates — one per operation/pattern.
  • To adapt: change the endpoint/operation, and map the fields you need from the response.

Prerequisites

Please ensure the following prerequisites are in place before using the Generic m3ter API Invocable Action feature:
  • The m3 Sync package is installed and configured (Access Key, API Secret, Base URL, Organization Id) in Integration Settings.
  • Users are assigned the m3ter_Admin or m3ter_User permission set.

Organization-Scoped Endpoint Paths

Main points to note:
  • Supply the path relative to your m3ter Organization:
    • The service prefixes https://<baseUrl>/organizations/<orgId>/
    • So for example for accounts: .../organizations/<orgId>/accounts
  • Root-level endpoints - for example: /organizationconfig, /oauth - are not supported.
  • Supported operations: GET, POST, PUT, DELETE.
  • The canonical list of endpoints and payloads can be found in the m3ter API Reference documentation at: https://docs.m3ter.com/

Apex and Flow Examples

This section sets out some Apex and Flow examples using the Generic m3ter API Invocable Action feature:

Apex Usage Example

Apex:
GenericAPIRequest: 
  • operation (required), 
  • endpoint (required), 
  • queryParams (optional JSON object of string values), 
  • requestBody (optional JSON body for POST/PUT).
APITransportResult: 
  • success, 
  • httpStatusCode, 
  • responseBody, 
  • errorMessage, 
  • nextToken, 
  • hasMoreResults.

Apex Usage Complex Example

Apex:

Flow Usage

Two-action pattern:
  1. Call m3ter API (M3terGenericAPIService) — set Operation and Endpoint; outputs Response Body, Success, HTTP Status Code, Next Token, Has More Results.
  2. Extract m3ter JSON Fields (M3terJsonExtractInvocable) — optional; pull values out of the response by Paths (e.g. [“data[0].name”, “data[0].address.locality”]). Object keys and array indexes are supported; an unmatched path returns null.
    • Values — one entry per input path, in order.
    • Element Values — when a path resolves to a JSON array, its elements are returned here so you can loop over the array in Flow.
Branch on {!Call_m3ter_API.success} and surface {!Call_m3ter_API.errorMessage} on failure. See the two shipped example Flows for working patterns: dependent-entity chaining, dynamic-choice-set drop-downs bound to M3terListOptionsExample, product-filtered lists, looping over segmented fields, and assembling a JSON request body from a Formula.

Limits

Note the following limitations:
  • Synchronous callout in the current transaction. Because of Salesforce’s “no callout after DML” rule, do not perform DML before this action in the same transaction/Flow run — do all callouts first and DML last, or split across transactions.
  • Up to 100 callouts per transaction; request/response bodies bounded by the 6 MB heap limit; 120s callout timeout.
  • Errors never throw out of the invocables — you must check success / errorMessage.

Sync Logs and External Mappings

The Generic m3ter API Invocable Action feature is a raw pass-through service — it deliberately does less than the standard sync actions (Sync to m3ter, etc.), and you own the difference:
  • No Sync Logs. Calls do not create SyncLog__c or SubmitSnapshot__c records. If you need an audit trail, you must log it yourself after the call.
  • Not external-mapping aware. Performing a create through this service makes a brand-new m3ter entity with no Salesforce ↔ m3ter link, so the package’s sync features won’t reconcile it and repeat calls create duplicates. If linkage matters, prefer the standard Sync to m3ter action; otherwise keep your own calls idempotent (look up before create) and maintain the link via the externalmappings endpoint yourself. See https://docs.m3ter.com/.