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

Customers

Customers

Customers

Archive a customer
v1.customers.archive(CustomerArchiveParams**kwargs) -> dataIDCustomerArchiveResponse
post/v1/customers/archive
Create a customer
v1.customers.create(CustomerCreateParams**kwargs) -> dataCustomerCustomerCreateResponse
post/v1/customers
List customers
v1.customers.list(CustomerListParams**kwargs) -> SyncCursorPage[idstrcreated_atdatetimecustom_fieldsDict[str, str]customer_configCustomerConfigexternal_idstringest_aliaseslistnamestrarchived_atdatetimecurrent_billable_statusCurrentBillableStatusCustomerDetail]
get/v1/customers
Get billable metrics for a customer
v1.customers.list_billable_metrics(CustomerListBillableMetricsParams**kwargs) -> SyncCursorPage[idstrnamestraggregatestraggregate_keyslistaggregation_keystraggregation_typeliteralarchived_atdatetimecustom_fieldsDict[str, str]event_type_filterEventTypeFilterfilterDict[str, object]group_bylistgroup_keyslistproperty_filterslistsqlstrCustomerListBillableMetricsResponse]
get/v1/customers/{customer_id}/billable-metrics
Get customer costs
v1.customers.list_costs(CustomerListCostsParams**kwargs) -> SyncCursorPage[credit_typesDict[str, CreditTypes]end_timestampdatetimestart_timestampdatetimeCustomerListCostsResponse]
get/v1/customers/{customer_id}/costs
Preview events
v1.customers.preview_events(CustomerPreviewEventsParams**kwargs) -> dataInvoiceCustomerPreviewEventsResponse
post/v1/customers/{customer_id}/previewEvents
Get a customer
get/v1/customers/{customer_id}
Create or update customer ingest aliases
v1.customers.set_ingest_aliases(CustomerSetIngestAliasesParams**kwargs)
post/v1/customers/{customer_id}/setIngestAliases
Update a customer name
v1.customers.set_name(CustomerSetNameParams**kwargs) -> dataCustomerCustomerSetNameResponse
post/v1/customers/{customer_id}/setName
Update a customer configuration
v1.customers.update_config(CustomerUpdateConfigParams**kwargs)
post/v1/customers/{customer_id}/updateConfig
Customer
Customerclass
ShowShow
idstr

the Metronome ID of the customer

formatuuid
external_idstr

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

ingest_aliaseslist
List[str]

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

namestr
custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
Customer Detail
CustomerDetailclass
ShowShow
idstr

the Metronome ID of the customer

formatuuid
created_atdatetime

RFC 3339 timestamp indicating when the customer was created.

formatdate-time
custom_fieldsDict[str, str]
Dict[str, str]
customer_configsalesforce_account_idstrCustomerConfig
Hide ParametersShow Parameters
salesforce_account_idstr

The Salesforce account ID for the customer

external_idstr

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

ingest_aliaseslist
List[str]

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

namestr
archived_atdatetime
optional

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

formatdate-time
current_billable_statusvalueliteraleffective_atdatetimeCurrentBillableStatus
optional

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

Hide ParametersShow Parameters
valueliteral
Literal["billable", "unbillable"]
Hide ParametersShow Parameters
"billable"
"unbillable"
effective_atdatetime
optional
formatdate-time

CustomersAlerts

List customer alerts
v1.customers.alerts.list(AlertListParams**kwargs) -> datalistnext_pagestrAlertListResponse
post/v1/customer-alerts/list
Reset an alert for a customer
v1.customers.alerts.reset(AlertResetParams**kwargs)
post/v1/customer-alerts/reset
Get an alert
v1.customers.alerts.retrieve(AlertRetrieveParams**kwargs) -> dataCustomerAlertAlertRetrieveResponse
post/v1/customer-alerts/get
Customer Alert
CustomerAlertclass
ShowShow
alertidstrnamestrstatusliteralthresholdfloattypeliteralupdated_atdatetimecredit_grant_type_filterslistcredit_typeCreditTypeDatacustom_field_filterslistgroup_key_filterAlertGroupKeyFiltergroup_valueslistinvoice_types_filterlistuniqueness_keystrAlert
Hide ParametersShow Parameters
idstr

the Metronome ID of the alert

namestr

Name of the alert

statusliteral
Literal["enabled", "archived", "disabled"]

Status of the alert

Hide ParametersShow Parameters
"enabled"
"archived"
"disabled"
thresholdfloat

Threshold value of the alert policy

typeliteral
Literal["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_atdatetime

Timestamp for when the alert was last updated

formatdate-time
credit_grant_type_filterslist
optional
Optional[List[str]]

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_typeCreditTypeData
optional
custom_field_filterslist
optional
Optional[List[AlertCustomFieldFilter]]

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

Hide ParametersShow Parameters
entityliteral
Literal["Contract", "Commit", "ContractCredit"]
Hide ParametersShow Parameters
"Contract"
"Commit"
"ContractCredit"
keystr
valuestr
group_key_filterkeystrvaluestrAlertGroupKeyFilter
optional

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

Hide ParametersShow Parameters
keystr
valuestr
group_valueslist
optional
Optional[List[AlertGroupValue]]

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

Hide ParametersShow Parameters
keystr
valuestr
invoice_types_filterlist
optional
Optional[List[str]]

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

uniqueness_keystr
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_statusliteral
Optional[Literal["ok", "in_alarm", "evaluating"]]

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

Hide ParametersShow Parameters
"ok"
"in_alarm"
"evaluating"
triggered_bystr
optional

If present, indicates the reason the alert was triggered.

CustomersBilling Config

Set a customer billing configuration
v1.customers.billing_config.create(BillingConfigCreateParams**kwargs)
post/v1/customers/{customer_id}/billing-config/{billing_provider_type}
Delete a customer billing configuration
v1.customers.billing_config.delete(BillingConfigDeleteParams**kwargs)
delete/v1/customers/{customer_id}/billing-config/{billing_provider_type}
Get a customer billing configuration
v1.customers.billing_config.retrieve(BillingConfigRetrieveParams**kwargs) -> dataDataBillingConfigRetrieveResponse
get/v1/customers/{customer_id}/billing-config/{billing_provider_type}

CustomersCommits

Create a commit
v1.customers.commits.create(CommitCreateParams**kwargs) -> dataIDCommitCreateResponse
post/v1/contracts/customerCommits/create
List commits
v1.customers.commits.list(CommitListParams**kwargs) -> datalistnext_pagestrCommitListResponse
post/v1/contracts/customerCommits/list
Update the commit end date
v1.customers.commits.update_end_date(CommitUpdateEndDateParams**kwargs) -> dataIDCommitUpdateEndDateResponse
post/v1/contracts/customerCommits/updateEndDate

CustomersCredits

Create a credit
v1.customers.credits.create(CreditCreateParams**kwargs) -> dataIDCreditCreateResponse
post/v1/contracts/customerCredits/create
List credits
v1.customers.credits.list(CreditListParams**kwargs) -> datalistnext_pagestrCreditListResponse
post/v1/contracts/customerCredits/list
Update the credit end date
v1.customers.credits.update_end_date(CreditUpdateEndDateParams**kwargs) -> dataIDCreditUpdateEndDateResponse
post/v1/contracts/customerCredits/updateEndDate

CustomersInvoices

Add a one time charge
v1.customers.invoices.add_charge(InvoiceAddChargeParams**kwargs) -> InvoiceAddChargeResponse
post/v1/customers/{customer_id}/addCharge
List invoices
v1.customers.invoices.list(InvoiceListParams**kwargs) -> SyncCursorPage[idstrcredit_typeCreditTypeDatacustomer_idstrline_itemsliststatusstrtotalfloattypestramendment_idstrbillable_statusliteralcontract_custom_fieldsDict[str, str]contract_idstrcorrection_recordCorrectionRecordcreated_atdatetimecustom_fieldsDict[str, object]customer_custom_fieldsDict[str, str]end_timestampdatetimeexternal_invoiceExternalInvoiceinvoice_adjustmentslistissued_atdatetimenet_payment_terms_daysfloatnetsuite_sales_order_idstrplan_custom_fieldsDict[str, str]plan_idstrplan_namestrreseller_royaltyResellerRoyaltysalesforce_opportunity_idstrstart_timestampdatetimesubtotalfloatInvoice]
get/v1/customers/{customer_id}/invoices
List invoice breakdowns
v1.customers.invoices.list_breakdowns(InvoiceListBreakdownsParams**kwargs) -> SyncCursorPage[breakdown_end_timestampdatetimebreakdown_start_timestampdatetimeInvoiceListBreakdownsResponse]
get/v1/customers/{customer_id}/invoices/breakdowns
Get an invoice
v1.customers.invoices.retrieve(InvoiceRetrieveParams**kwargs) -> dataInvoiceInvoiceRetrieveResponse
get/v1/customers/{customer_id}/invoices/{invoice_id}
Invoice
Invoiceclass
ShowShow
idstr
formatuuid
credit_typeidstrnamestrCreditTypeData
customer_idstr
formatuuid
line_itemslist
List[LineItem]
Hide ParametersShow Parameters
credit_typeidstrnamestrCreditTypeData
namestr
totalfloat
applied_commit_or_creditidstrtypeliteralLineItemAppliedCommitOrCredit
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
idstr
formatuuid
typeliteral
Literal["PREPAID", "POSTPAID", "CREDIT"]
Hide ParametersShow Parameters
"PREPAID"
"POSTPAID"
"CREDIT"
commit_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
commit_idstr
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_idstr
optional
commit_netsuite_sales_order_idstr
optional
commit_segment_idstr
optional
formatuuid
commit_typestr
optional

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

custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
discount_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
discount_idstr
optional

ID of the discount applied to this line item.

formatuuid
ending_beforedatetime
optional

The line item's end date (exclusive).

formatdate-time
group_keystr
optional
group_valuestr
optional
is_proratedbool
optional

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

list_priceRate
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.

metadatastr
optional
netsuite_invoice_billing_enddatetime
optional

The end date for the billing period on the invoice.

formatdate-time
netsuite_invoice_billing_startdatetime
optional

The start date for the billing period on the invoice.

formatdate-time
netsuite_item_idstr
optional
postpaid_commitidstrLineItemPostpaidCommit
optional

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

Hide ParametersShow Parameters
idstr
formatuuid
presentation_group_valuesDict[str, Optional[str]]
optional
Optional[Dict[str, Optional[str]]]

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

pricing_group_valuesDict[str, str]
optional
Optional[Dict[str, str]]

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

product_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
product_idstr
optional

ID of the product associated with the line item.

formatuuid
product_tagslist
optional
Optional[List[str]]

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

product_typestr
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_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
professional_service_idstr
optional
formatuuid
quantityfloat
optional

The quantity associated with the line item.

reseller_typeliteral
optional
Optional[Literal["AWS", "AWS_PRO_SERVICE", "GCP", "GCP_PRO_SERVICE"]]
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
scheduled_charge_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
scheduled_charge_idstr
optional

ID of scheduled charge.

formatuuid
starting_atdatetime
optional

The line item's start date (inclusive).

formatdate-time
sub_line_itemslist
optional
Optional[List[LineItemSubLineItem]]
Hide ParametersShow Parameters
custom_fieldsDict[str, str]
Dict[str, str]
namestr
quantityfloat
subtotalfloat
charge_idstr
optional
formatuuid
credit_grant_idstr
optional
formatuuid
end_datedatetime
optional

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

formatdate-time
pricefloat
optional

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

start_datedatetime
optional

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

formatdate-time
tier_periodstarting_atdatetimeending_beforedatetimeLineItemSubLineItemTierPeriod
optional

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

Hide ParametersShow Parameters
starting_atdatetime
formatdate-time
ending_beforedatetime
optional
formatdate-time
tierslist
optional
Optional[List[LineItemSubLineItemTier]]
Hide ParametersShow Parameters
pricefloat
quantityfloat
starting_atfloat

at what metric amount this tier begins

subtotalfloat
subscription_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
tierlevelfloatstarting_atstrsizestrLineItemTier
optional

Populated if the line item has a tiered price.

Hide ParametersShow Parameters
levelfloat
starting_atstr
sizestr
optional
unit_pricefloat
optional

The unit price associated with the line item.

statusstr
totalfloat
typestr
amendment_idstr
optional
formatuuid
billable_statusliteral
optional
Optional[Literal["billable", "unbillable"]]

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

Hide ParametersShow Parameters
"billable"
"unbillable"
contract_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
contract_idstr
optional
formatuuid
correction_recordcorrected_invoice_idstrmemostrreasonstrcorrected_external_invoiceCorrectionRecordCorrectedExternalInvoiceCorrectionRecord
optional
Hide ParametersShow Parameters
corrected_invoice_idstr
formatuuid
memostr
reasonstr
corrected_external_invoicebilling_provider_typeliteralexternal_statusliteralinvoice_idstrissued_at_timestampdatetimeCorrectionRecordCorrectedExternalInvoice
optional
Hide ParametersShow Parameters
billing_provider_typeliteral
Literal["aws_marketplace", "stripe", "netsuite", 5 more]
Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
external_statusliteral
optional
Optional[Literal["DRAFT", "FINALIZED", "PAID", 8 more]]
Hide ParametersShow Parameters
"DRAFT"
"FINALIZED"
"PAID"
"UNCOLLECTIBLE"
"VOID"
"DELETED"
"PAYMENT_FAILED"
"INVALID_REQUEST_ERROR"
"SKIPPED"
"SENT"
"QUEUED"
invoice_idstr
optional
issued_at_timestampdatetime
optional
formatdate-time
created_atdatetime
optional

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

formatdate-time
custom_fieldsDict[str, object]
optional
Optional[Dict[str, object]]
customer_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
end_timestampdatetime
optional

End of the usage period this invoice covers (UTC)

formatdate-time
external_invoicebilling_provider_typeliteralexternal_statusliteralinvoice_idstrissued_at_timestampdatetimeExternalInvoice
optional
Hide ParametersShow Parameters
billing_provider_typeliteral
Literal["aws_marketplace", "stripe", "netsuite", 5 more]
Hide ParametersShow Parameters
"aws_marketplace"
"stripe"
"netsuite"
"custom"
"azure_marketplace"
"quickbooks_online"
"workday"
"gcp_marketplace"
external_statusliteral
optional
Optional[Literal["DRAFT", "FINALIZED", "PAID", 8 more]]
Hide ParametersShow Parameters
"DRAFT"
"FINALIZED"
"PAID"
"UNCOLLECTIBLE"
"VOID"
"DELETED"
"PAYMENT_FAILED"
"INVALID_REQUEST_ERROR"
"SKIPPED"
"SENT"
"QUEUED"
invoice_idstr
optional
issued_at_timestampdatetime
optional
formatdate-time
invoice_adjustmentslist
optional
Optional[List[InvoiceAdjustment]]
Hide ParametersShow Parameters
credit_typeidstrnamestrCreditTypeData
namestr
totalfloat
credit_grant_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
credit_grant_idstr
optional
issued_atdatetime
optional

When the invoice was issued (UTC)

formatdate-time
net_payment_terms_daysfloat
optional
netsuite_sales_order_idstr
optional

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

plan_custom_fieldsDict[str, str]
optional
Optional[Dict[str, str]]
plan_idstr
optional
formatuuid
plan_namestr
optional
reseller_royaltyfractionstrnetsuite_reseller_idstrreseller_typeliteralaws_optionsResellerRoyaltyAwsOptionsgcp_optionsResellerRoyaltyGcpOptionsResellerRoyalty
optional

Only present for contract invoices with reseller royalties.

Hide ParametersShow Parameters
fractionstr
netsuite_reseller_idstr
reseller_typeliteral
Literal["AWS", "AWS_PRO_SERVICE", "GCP", "GCP_PRO_SERVICE"]
Hide ParametersShow Parameters
"AWS"
"AWS_PRO_SERVICE"
"GCP"
"GCP_PRO_SERVICE"
aws_optionsaws_account_numberstraws_offer_idstraws_payer_reference_idstrResellerRoyaltyAwsOptions
optional
Hide ParametersShow Parameters
aws_account_numberstr
optional
aws_offer_idstr
optional
aws_payer_reference_idstr
optional
gcp_optionsgcp_account_idstrgcp_offer_idstrResellerRoyaltyGcpOptions
optional
Hide ParametersShow Parameters
gcp_account_idstr
optional
gcp_offer_idstr
optional
salesforce_opportunity_idstr
optional

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

start_timestampdatetime
optional

Beginning of the usage period this invoice covers (UTC)

formatdate-time
subtotalfloat
optional

CustomersNamed Schedules

Get a customer's named schedule
v1.customers.named_schedules.retrieve(NamedScheduleRetrieveParams**kwargs) -> datalistNamedScheduleRetrieveResponse
post/v1/customers/getNamedSchedule
Update a customer's named schedule
v1.customers.named_schedules.update(NamedScheduleUpdateParams**kwargs)
post/v1/customers/updateNamedSchedule

CustomersPlans

Add a plan to a customer
v1.customers.plans.add(PlanAddParams**kwargs) -> dataIDPlanAddResponse
post/v1/customers/{customer_id}/plans/add
End a customer plan
v1.customers.plans.end(PlanEndParams**kwargs) -> PlanEndResponse
post/v1/customers/{customer_id}/plans/{customer_plan_id}/end
List customer plans
v1.customers.plans.list(PlanListParams**kwargs) -> SyncCursorPage[idstrcustom_fieldsDict[str, str]plan_descriptionstrplan_idstrplan_namestrstarting_ondatetimeending_beforedatetimenet_payment_terms_daysfloattrial_infoTrialInfoPlanListResponse]
get/v1/customers/{customer_id}/plans
Get the plan adjustments for a customer
v1.customers.plans.list_price_adjustments(PlanListPriceAdjustmentsParams**kwargs) -> SyncCursorPage[charge_idstrcharge_typeliteralpricesliststart_periodfloatquantityfloatPlanListPriceAdjustmentsResponse]
get/v1/customers/{customer_id}/plans/{customer_plan_id}/priceAdjustments