Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Customers

Customers

Customers

Archive a customer
client.v1.customers.archive(CustomerArchiveParamsbody, RequestOptionsoptions?): dataIDCustomerArchiveResponse
post/v1/customers/archive
Create a customer
client.v1.customers.create(CustomerCreateParamsbody, RequestOptionsoptions?): dataCustomerCustomerCreateResponse
post/v1/customers
List customers
client.v1.customers.list(CustomerListParamsquery?, RequestOptionsoptions?): CursorPage<idstringcreated_atstringcustom_fieldsRecord<string, string>customer_configCustomerConfigexternal_idstringingest_aliasesarraynamestringarchived_atunioncurrent_billable_statusCurrentBillableStatusCustomerDetail>
get/v1/customers
Get billable metrics for a customer
client.v1.customers.listBillableMetrics(CustomerListBillableMetricsParamsparams, RequestOptionsoptions?): CursorPage<idstringnamestringaggregatestringaggregate_keysarrayaggregation_keystringaggregation_typeunionarchived_atstringcustom_fieldsRecord<string, string>event_type_filterEventTypeFilterfilterRecord<string, unknown>group_byarraygroup_keysarrayproperty_filtersarraysqlstringCustomerListBillableMetricsResponse>
get/v1/customers/{customer_id}/billable-metrics
Get customer costs
client.v1.customers.listCosts(CustomerListCostsParamsparams, RequestOptionsoptions?): CursorPage<credit_typesRecord<string, CreditTypes>end_timestampstringstart_timestampstringCustomerListCostsResponse>
get/v1/customers/{customer_id}/costs
Preview events
client.v1.customers.previewEvents(CustomerPreviewEventsParamsparams, RequestOptionsoptions?): dataInvoiceCustomerPreviewEventsResponse
post/v1/customers/{customer_id}/previewEvents
Get a customer
client.v1.customers.retrieve(CustomerRetrieveParamsparams, RequestOptionsoptions?): dataCustomerDetailCustomerRetrieveResponse
get/v1/customers/{customer_id}
Create or update customer ingest aliases
client.v1.customers.setIngestAliases(CustomerSetIngestAliasesParamsparams, RequestOptionsoptions?): void
post/v1/customers/{customer_id}/setIngestAliases
Update a customer name
client.v1.customers.setName(CustomerSetNameParamsparams, RequestOptionsoptions?): dataCustomerCustomerSetNameResponse
post/v1/customers/{customer_id}/setName
Update a customer configuration
client.v1.customers.updateConfig(CustomerUpdateConfigParamsparams, RequestOptionsoptions?): void
post/v1/customers/{customer_id}/updateConfig
Customer
Customer
ShowShow
idstring

the Metronome ID of the customer

formatuuid
external_idstring

(deprecated, use ingest_aliases instead) the first ID (Metronome or ingest alias) that can be used in usage events

ingest_aliasesarray
Array<string>

aliases for this customer that can be used instead of the Metronome customer ID in usage events

namestring
custom_fieldsRecord<string, string>
optional
Customer Detail
CustomerDetail
ShowShow
idstring

the Metronome ID of the customer

formatuuid
created_atstring

RFC 3339 timestamp indicating when the customer was created.

formatdate-time
custom_fieldsRecord<string, string>
customer_configsalesforce_account_idunionCustomerConfig
Hide ParametersShow Parameters
salesforce_account_idunion
string | null

The Salesforce account ID for the customer

external_idstring

(deprecated, use ingest_aliases instead) the first ID (Metronome or ingest alias) that can be used in usage events

ingest_aliasesarray
Array<string>

aliases for this customer that can be used instead of the Metronome customer ID in usage events

namestring
archived_atunion
optional
string | null

RFC 3339 timestamp indicating when the customer was archived. Null if the customer is active.

formatdate-time
current_billable_statusvalueunioneffective_atunionCurrentBillableStatus
optional

This field's availability is dependent on your client's configuration.

Hide ParametersShow Parameters
valueunion
"billable" | "unbillable"
Hide ParametersShow Parameters
"billable"
"unbillable"
effective_atunion
optional
string | null
formatdate-time

CustomersAlerts

List customer alerts
client.v1.customers.alerts.list(AlertListParamsparams, RequestOptionsoptions?): dataarraynext_pageunionAlertListResponse
post/v1/customer-alerts/list
Reset an alert for a customer
client.v1.customers.alerts.reset(AlertResetParamsbody, RequestOptionsoptions?): void
post/v1/customer-alerts/reset
Get an alert
client.v1.customers.alerts.retrieve(AlertRetrieveParamsbody, RequestOptionsoptions?): dataCustomerAlertAlertRetrieveResponse
post/v1/customer-alerts/get
Customer Alert
CustomerAlert
ShowShow
alertidstringnamestringstatusunionthresholdnumbertypeunionupdated_atstringcredit_grant_type_filtersarraycredit_typeunioncustom_field_filtersarraygroup_key_filterGroupKeyFiltergroup_valuesarrayinvoice_types_filterarrayuniqueness_keystringAlert
Hide ParametersShow Parameters
idstring

the Metronome ID of the alert

namestring

Name of the alert

statusunion
"enabled" | "archived" | "disabled"

Status of the alert

Hide ParametersShow Parameters
"enabled"
"archived"
"disabled"
thresholdnumber

Threshold value of the alert policy

typeunion
"low_credit_balance_reached" | "spend_threshold_reached" | "monthly_invoice_total_spend_threshold_reached" | 11 more

Type of the alert

Hide ParametersShow Parameters
"low_credit_balance_reached"
"spend_threshold_reached"
"monthly_invoice_total_spend_threshold_reached"
"low_remaining_days_in_plan_reached"
"low_remaining_credit_percentage_reached"
"usage_threshold_reached"
"low_remaining_days_for_commit_segment_reached"
"low_remaining_commit_balance_reached"
"low_remaining_commit_percentage_reached"
"low_remaining_days_for_contract_credit_segment_reached"
"low_remaining_contract_credit_balance_reached"
"low_remaining_contract_credit_percentage_reached"
"low_remaining_contract_credit_and_commit_balance_reached"
"invoice_total_reached"
updated_atstring

Timestamp for when the alert was last updated

formatdate-time
credit_grant_type_filtersarray
optional
Array<string>

An array of strings, representing a way to filter the credit grant this alert applies to, by looking at the credit_grant_type field on the credit grant. This field is only defined for CreditPercentage and CreditBalance alerts

credit_typeunion
optional
idstringnamestringCreditTypeData | null
custom_field_filtersarray
optional

A list of custom field filters for alert types that support advanced filtering

Hide ParametersShow Parameters
entityunion
"Contract" | "Commit" | "ContractCredit"
Hide ParametersShow Parameters
"Contract"
"Commit"
"ContractCredit"
keystring
valuestring
group_key_filterkeystringvaluestringGroupKeyFilter
optional

Scopes alert evaluation to a specific presentation group key on individual line items. Only present for spend alerts.

Hide ParametersShow Parameters
keystring
valuestring
group_valuesarray
optional
Array<GroupValue>

Only present for spend_threshold_reached alerts. Scope alert to a specific group key on individual line items.

Hide ParametersShow Parameters
keystring
valuestring
invoice_types_filterarray
optional
Array<string>

Only supported for invoice_total_reached alerts. A list of invoice types to evaluate.

uniqueness_keystring
optional

Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.

minLength1
maxLength128
customer_statusunion
"ok" | "in_alarm" | "evaluating" | null

The status of the customer alert. If the alert is archived, null will be returned.

Hide ParametersShow Parameters
"ok"
"in_alarm"
"evaluating"
triggered_byunion
optional
string | null

If present, indicates the reason the alert was triggered.

CustomersBilling Config

Set a customer billing configuration
client.v1.customers.billingConfig.create(BillingConfigCreateParamsparams, RequestOptionsoptions?): void
post/v1/customers/{customer_id}/billing-config/{billing_provider_type}
Delete a customer billing configuration
client.v1.customers.billingConfig.delete(BillingConfigDeleteParamsparams, RequestOptionsoptions?): void
delete/v1/customers/{customer_id}/billing-config/{billing_provider_type}
Get a customer billing configuration
client.v1.customers.billingConfig.retrieve(BillingConfigRetrieveParamsparams, RequestOptionsoptions?): dataDataBillingConfigRetrieveResponse
get/v1/customers/{customer_id}/billing-config/{billing_provider_type}

CustomersCommits

Create a commit
client.v1.customers.commits.create(CommitCreateParamsbody, RequestOptionsoptions?): dataIDCommitCreateResponse
post/v1/contracts/customerCommits/create
List commits
client.v1.customers.commits.list(CommitListParamsbody, RequestOptionsoptions?): dataarraynext_pageunionCommitListResponse
post/v1/contracts/customerCommits/list
Update the commit end date
client.v1.customers.commits.updateEndDate(CommitUpdateEndDateParamsbody, RequestOptionsoptions?): dataIDCommitUpdateEndDateResponse
post/v1/contracts/customerCommits/updateEndDate

CustomersCredits

Create a credit
client.v1.customers.credits.create(CreditCreateParamsbody, RequestOptionsoptions?): dataIDCreditCreateResponse
post/v1/contracts/customerCredits/create
List credits
client.v1.customers.credits.list(CreditListParamsbody, RequestOptionsoptions?): dataarraynext_pageunionCreditListResponse
post/v1/contracts/customerCredits/list
Update the credit end date
client.v1.customers.credits.updateEndDate(CreditUpdateEndDateParamsbody, RequestOptionsoptions?): dataIDCreditUpdateEndDateResponse
post/v1/contracts/customerCredits/updateEndDate

CustomersInvoices

Add a one time charge
client.v1.customers.invoices.addCharge(InvoiceAddChargeParamsparams, RequestOptionsoptions?): InvoiceAddChargeResponse
post/v1/customers/{customer_id}/addCharge
List invoices
client.v1.customers.invoices.list(InvoiceListParamsparams, RequestOptionsoptions?): CursorPage<idstringcredit_typeCreditTypeDatacustomer_idstringline_itemsarraystatusstringtotalnumbertypestringamendment_idstringbillable_statusunioncontract_custom_fieldsRecord<string, string>contract_idstringcorrection_recordCorrectionRecordcreated_atstringcustom_fieldsRecord<string, unknown>customer_custom_fieldsRecord<string, string>end_timestampstringexternal_invoiceunioninvoice_adjustmentsarrayissued_atstringnet_payment_terms_daysnumbernetsuite_sales_order_idstringplan_custom_fieldsRecord<string, string>plan_idstringplan_namestringreseller_royaltyResellerRoyaltysalesforce_opportunity_idstringstart_timestampstringsubtotalnumberInvoice>
get/v1/customers/{customer_id}/invoices
List invoice breakdowns
client.v1.customers.invoices.listBreakdowns(InvoiceListBreakdownsParamsparams, RequestOptionsoptions?): CursorPage<breakdown_end_timestampstringbreakdown_start_timestampstringInvoiceListBreakdownsResponse>
get/v1/customers/{customer_id}/invoices/breakdowns
Get an invoice
client.v1.customers.invoices.retrieve(InvoiceRetrieveParamsparams, RequestOptionsoptions?): dataInvoiceInvoiceRetrieveResponse
get/v1/customers/{customer_id}/invoices/{invoice_id}
Invoice
Invoice
ShowShow
idstring
formatuuid
credit_typeidstringnamestringCreditTypeData
customer_idstring
formatuuid
line_itemsarray
Array<LineItem>
Hide ParametersShow Parameters
credit_typeidstringnamestringCreditTypeData
namestring
totalnumber
applied_commit_or_creditidstringtypeunionAppliedCommitOrCredit
optional

Details about the credit or commit that was applied to this line item. Only present on line items with product of USAGE, SUBSCRIPTION or COMPOSITE types.

Hide ParametersShow Parameters
idstring
formatuuid
typeunion
"PREPAID" | "POSTPAID" | "CREDIT"
Hide ParametersShow Parameters
"PREPAID"
"POSTPAID"
"CREDIT"
commit_custom_fieldsRecord<string, string>
optional
commit_idstring
optional

For line items with product of USAGE, SUBSCRIPTION, or COMPOSITE types, the ID of the credit or commit that was applied to this line item. For line items with product type of FIXED, the ID of the prepaid or postpaid commit that is being paid for.

formatuuid
commit_netsuite_item_idstring
optional
commit_netsuite_sales_order_idstring
optional
commit_segment_idstring
optional
formatuuid
commit_typestring
optional

PrepaidCommit (for commit types PREPAID and CREDIT) or PostpaidCommit (for commit type POSTPAID).

custom_fieldsRecord<string, string>
optional
discount_custom_fieldsRecord<string, string>
optional
discount_idstring
optional

ID of the discount applied to this line item.

formatuuid
ending_beforestring
optional

The line item's end date (exclusive).

formatdate-time
group_keystring
optional
group_valueunion
optional
string | null
is_proratedboolean
optional

Indicates whether the line item is prorated for SUBSCRIPTION type product.

list_pricerate_typeunioncredit_typeCreditTypeDatacustom_rateRecord<string, unknown>is_proratedbooleanpricenumberpricing_group_valuesRecord<string, string>quantitynumbertiersarrayuse_list_pricesbooleanRate
optional

Only present for contract invoices and when the include_list_prices query parameter is set to true. This will include the list rate for the charge if applicable. Only present for usage and subscription line items.

metadatastring
optional
netsuite_invoice_billing_endstring
optional

The end date for the billing period on the invoice.

formatdate-time
netsuite_invoice_billing_startstring
optional

The start date for the billing period on the invoice.

formatdate-time
netsuite_item_idstring
optional
postpaid_commitidstringPostpaidCommit
optional

Only present for line items paying for a postpaid commit true-up.

Hide ParametersShow Parameters
idstring
formatuuid
presentation_group_valuesRecord<string, string | null>
optional

Includes the presentation group values associated with this line item if presentation group keys are used.

pricing_group_valuesRecord<string, string>
optional

Includes the pricing group values associated with this line item if dimensional pricing is used.

product_custom_fieldsRecord<string, string>
optional
product_idstring
optional

ID of the product associated with the line item.

formatuuid
product_tagsarray
optional
Array<string>

The current product tags associated with the line item's product_id.

product_typestring
optional

The type of the line item's product. Possible values are FixedProductListItem (for FIXED type products), UsageProductListItem (for USAGE type products), SubscriptionProductListItem (for SUBSCRIPTION type products) or CompositeProductListItem (for COMPOSITE type products). For scheduled charges, commit and credit payments, the value is FixedProductListItem.

professional_service_custom_fieldsRecord<string, string>
optional
professional_service_idstring
optional
formatuuid
quantitynumber
optional

The quantity associated with the line item.

reseller_typeunion
optional
"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
scheduled_charge_custom_fieldsRecord<string, string>
optional
scheduled_charge_idstring
optional

ID of scheduled charge.

formatuuid
starting_atstring
optional

The line item's start date (inclusive).

formatdate-time
sub_line_itemsarray
optional
Hide ParametersShow Parameters
custom_fieldsRecord<string, string>
namestring
quantitynumber
subtotalnumber
charge_idstring
optional
formatuuid
credit_grant_idstring
optional
formatuuid
end_datestring
optional

The end date for the charge (for seats charges only).

formatdate-time
pricenumber
optional

the unit price for this charge, present only if the charge is not tiered and the quantity is nonzero

start_datestring
optional

The start date for the charge (for seats charges only).

formatdate-time
tier_periodstarting_atstringending_beforestringTierPeriod
optional

when the current tier started and ends (for tiered charges only)

Hide ParametersShow Parameters
starting_atstring
formatdate-time
ending_beforestring
optional
formatdate-time
tiersarray
optional
Array<Tier>
Hide ParametersShow Parameters
pricenumber
quantitynumber
starting_atnumber

at what metric amount this tier begins

subtotalnumber
subscription_custom_fieldsRecord<string, string>
optional
tierlevelnumberstarting_atstringsizeunionTier
optional

Populated if the line item has a tiered price.

Hide ParametersShow Parameters
levelnumber
starting_atstring
sizeunion
optional
string | null
unit_pricenumber
optional

The unit price associated with the line item.

statusstring
totalnumber
typestring
amendment_idstring
optional
formatuuid
billable_statusunion
optional
"billable" | "unbillable"

This field's availability is dependent on your client's configuration.

Hide ParametersShow Parameters
"billable"
"unbillable"
contract_custom_fieldsRecord<string, string>
optional
contract_idstring
optional
formatuuid
correction_recordcorrected_invoice_idstringmemostringreasonstringcorrected_external_invoiceCorrectedExternalInvoiceCorrectionRecord
optional
Hide ParametersShow Parameters
corrected_invoice_idstring
formatuuid
memostring
reasonstring
corrected_external_invoicebilling_provider_typeunionexternal_statusunioninvoice_idstringissued_at_timestampstringCorrectedExternalInvoice
optional
Hide ParametersShow Parameters
billing_provider_typeunion
"aws_marketplace" | "stripe" | "netsuite" | 5 more
Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
external_statusunion
optional
"DRAFT" | "FINALIZED" | "PAID" | 8 more
Hide ParametersShow Parameters
"DRAFT"
"FINALIZED"
"PAID"
"UNCOLLECTIBLE"
"VOID"
"DELETED"
"PAYMENT_FAILED"
"INVALID_REQUEST_ERROR"
"SKIPPED"
"SENT"
"QUEUED"
invoice_idstring
optional
issued_at_timestampstring
optional
formatdate-time
created_atstring
optional

When the invoice was created (UTC). This field is present for correction invoices only.

formatdate-time
custom_fieldsRecord<string, unknown>
optional
customer_custom_fieldsRecord<string, string>
optional
end_timestampstring
optional

End of the usage period this invoice covers (UTC)

formatdate-time
external_invoiceunion
optional
billing_provider_typeunionexternal_statusunioninvoice_idstringissued_at_timestampstringExternalInvoice | null
Hide ParametersShow Parameters
billing_provider_typeunion
"aws_marketplace" | "stripe" | "netsuite" | 5 more
Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
external_statusunion
optional
"DRAFT" | "FINALIZED" | "PAID" | 8 more
Hide ParametersShow Parameters
"DRAFT"
"FINALIZED"
"PAID"
"UNCOLLECTIBLE"
"VOID"
"DELETED"
"PAYMENT_FAILED"
"INVALID_REQUEST_ERROR"
"SKIPPED"
"SENT"
"QUEUED"
invoice_idstring
optional
issued_at_timestampstring
optional
formatdate-time
invoice_adjustmentsarray
optional
Hide ParametersShow Parameters
credit_typeidstringnamestringCreditTypeData
namestring
totalnumber
credit_grant_custom_fieldsRecord<string, string>
optional
credit_grant_idstring
optional
issued_atstring
optional

When the invoice was issued (UTC)

formatdate-time
net_payment_terms_daysnumber
optional
netsuite_sales_order_idstring
optional

This field's availability is dependent on your client's configuration.

plan_custom_fieldsRecord<string, string>
optional
plan_idstring
optional
formatuuid
plan_namestring
optional
reseller_royaltyfractionstringnetsuite_reseller_idstringreseller_typeunionaws_optionsAwsOptionsgcp_optionsGcpOptionsResellerRoyalty
optional

Only present for contract invoices with reseller royalties.

Hide ParametersShow Parameters
fractionstring
netsuite_reseller_idstring
reseller_typeunion
"AWS" | "AWS_PRO_SERVICE" | "GCP" | "GCP_PRO_SERVICE"
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
aws_optionsaws_account_numberstringaws_offer_idstringaws_payer_reference_idstringAwsOptions
optional
Hide ParametersShow Parameters
aws_account_numberstring
optional
aws_offer_idstring
optional
aws_payer_reference_idstring
optional
gcp_optionsgcp_account_idstringgcp_offer_idstringGcpOptions
optional
Hide ParametersShow Parameters
gcp_account_idstring
optional
gcp_offer_idstring
optional
salesforce_opportunity_idstring
optional

This field's availability is dependent on your client's configuration.

start_timestampstring
optional

Beginning of the usage period this invoice covers (UTC)

formatdate-time
subtotalnumber
optional

CustomersNamed Schedules

Get a customer's named schedule
client.v1.customers.namedSchedules.retrieve(NamedScheduleRetrieveParamsbody, RequestOptionsoptions?): dataarrayNamedScheduleRetrieveResponse
post/v1/customers/getNamedSchedule
Update a customer's named schedule
client.v1.customers.namedSchedules.update(NamedScheduleUpdateParamsbody, RequestOptionsoptions?): void
post/v1/customers/updateNamedSchedule

CustomersPlans

Add a plan to a customer
client.v1.customers.plans.add(PlanAddParamsparams, RequestOptionsoptions?): dataIDPlanAddResponse
post/v1/customers/{customer_id}/plans/add
End a customer plan
client.v1.customers.plans.end(PlanEndParamsparams, RequestOptionsoptions?): PlanEndResponse
post/v1/customers/{customer_id}/plans/{customer_plan_id}/end
List customer plans
client.v1.customers.plans.list(PlanListParamsparams, RequestOptionsoptions?): CursorPage<idstringcustom_fieldsRecord<string, string>plan_descriptionstringplan_idstringplan_namestringstarting_onstringending_beforestringnet_payment_terms_daysnumbertrial_infoTrialInfoPlanListResponse>
get/v1/customers/{customer_id}/plans
Get the plan adjustments for a customer
client.v1.customers.plans.listPriceAdjustments(PlanListPriceAdjustmentsParamsparams, RequestOptionsoptions?): CursorPage<charge_idstringcharge_typeunionpricesarraystart_periodnumberquantitynumberPlanListPriceAdjustmentsResponse>
get/v1/customers/{customer_id}/plans/{customer_plan_id}/priceAdjustments