metronome-create-customer
Creates a single customer record in Metronome. Two-step: preview then confirm. Calls the API directly for both the duplicate check and the write.
Base URL: https://api.metronome.com/v1 (prod) or https://staging.api.metronome.com/v1 (sandbox).
Step 1 — Collect fields
Ask the user for anything not already provided:
| Field | Required | Notes |
|---|---|---|
| Legal entity name | Yes | Appears verbatim on invoices — use exact legal name |
| Ingest alias | Yes | The customer's client ID in their own system |
| Salesforce account ID | Yes | Alphanumeric ID from the Salesforce account URL |
| External Slack channel | Yes | The shared channel name (not internal) — used by Pylon for support |
Step 2 — Check for duplicate
GET /v1/customers
Authorization: Bearer $METRONOME_API_TOKEN
Returns all customers — match by name field from the response.
- Match found → show it and ask the user to confirm this is a different entity.
- No match → proceed.
Step 3 — Preview
NEW CUSTOMER PREVIEW
Name: <legal entity name>
Ingest alias: <alias>
Salesforce ID: <id>
Slack channel: <channel>
Reply "confirmed" to create.
Do not call the API until the user confirms.
Step 4 — Create
POST /v1/customers
Authorization: Bearer $METRONOME_API_TOKEN
Content-Type: application/json
{
"name": "<legal entity name>",
"ingest_aliases": ["<ingest_alias>"],
"customer_config": {
"salesforce_account_id": "<salesforce_id>"
},
"custom_fields": {
"slack_channel": "<slack_channel>"
}
}
Return the id from the response — the user will need it for metronome-create-contract.
Note:
custom_fieldskeys must be pre-registered in your Metronome account before use. Ifslack_channelis not registered, the API returns"Invalid custom field keys". Ask your Metronome admin to register it first, or omitcustom_fieldsentirely if not configured.