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

Create

Create a commit
post/v1/contracts/customerCommits/create

Create a new commit at the customer level.

Body Parameters
access_scheduleobject

Schedule for distributing the commit to the customer. For "POSTPAID" commits only one schedule item is allowed and amount must match invoice_schedule total.

Hide ParametersShow Parameters
schedule_itemsarray of object
Hide ParametersShow Parameters
amountnumber
ending_beforestring

RFC 3339 timestamp (exclusive)

formatdate-time
starting_atstring

RFC 3339 timestamp (inclusive)

formatdate-time
credit_type_idstring
optional

Defaults to USD (cents) if not passed

formatuuid
customer_idstring
formatuuid
prioritynumber

If multiple credits or commits are applicable, the one with the lower priority will apply first.

product_idstring

ID of the fixed product associated with the commit. This is required because products are used to invoice the commit amount.

formatuuid
typeenum
"PREPAID" OR "POSTPAID"
Hide ParametersShow Parameters
"PREPAID"
"POSTPAID"
applicable_contract_idsarray of string
optional

Which contract the commit applies to. If not provided, the commit applies to all contracts.

applicable_product_idsarray of string
optional

Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products.

applicable_product_tagsarray of string
optional

Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products.

custom_fieldsmap
optional
descriptionstring
optional

Used only in UI/API. It is not exposed to end customers.

invoice_contract_idstring
optional

The contract that this commit will be billed on. This is required for "POSTPAID" commits and for "PREPAID" commits unless there is no invoice schedule above (i.e., the commit is 'free').

formatuuid
invoice_scheduleobject
optional

Required for "POSTPAID" commits: the true up invoice will be generated at this time and only one schedule item is allowed; the total must match accesss_schedule amount. Optional for "PREPAID" commits: if not provided, this will be a "complimentary" commit with no invoice.

Hide ParametersShow Parameters
credit_type_idstring
optional

Defaults to USD (cents) if not passed.

formatuuid
do_not_invoiceboolean
optional

This field is only applicable to commit invoice schedules. If true, this schedule will not generate an invoice.

recurring_scheduleobject
optional

Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1.

Hide ParametersShow Parameters
amount_distributionenum
"DIVIDED" OR "DIVIDED_ROUNDED" OR "EACH"
Hide ParametersShow Parameters
"DIVIDED"
"DIVIDED_ROUNDED"
"EACH"
ending_beforestring

RFC 3339 timestamp (exclusive).

formatdate-time
frequencyenum
"MONTHLY" OR "QUARTERLY" OR "SEMI_ANNUAL" OR "ANNUAL"
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"SEMI_ANNUAL"
"ANNUAL"
starting_atstring

RFC 3339 timestamp (inclusive).

formatdate-time
amountnumber
optional

Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1.

quantitynumber
optional

Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided.

unit_pricenumber
optional

Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided.

schedule_itemsarray of object
optional

Either provide amount or provide both unit_price and quantity.

Hide ParametersShow Parameters
timestampstring

timestamp of the scheduled event

formatdate-time
amountnumber
optional

Amount for the charge. Can be provided instead of unit_price and quantity. If amount is sent, the unit_price is assumed to be the amount and quantity is inferred to be 1.

quantitynumber
optional

Quantity for the charge. Will be multiplied by unit_price to determine the amount and must be specified with unit_price. If specified amount cannot be provided.

unit_pricenumber
optional

Unit price for the charge. Will be multiplied by quantity to determine the amount and must be specified with quantity. If specified amount cannot be provided.

namestring
optional

displayed on invoices

minLength1
netsuite_sales_order_idstring
optional

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

rate_typeenum
optional
"COMMIT_RATE" OR "LIST_RATE"
Hide ParametersShow Parameters
"COMMIT_RATE"
"LIST_RATE"
salesforce_opportunity_idstring
optional

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

specifiersarray of object
optional

List of filters that determine what kind of customer usage draws down a commit or credit. A customer's usage needs to meet the condition of at least one of the specifiers to contribute to a commit's or credit's drawdown. This field cannot be used together with applicable_product_ids or applicable_product_tags.

Hide ParametersShow Parameters
presentation_group_valuesmap
optional
pricing_group_valuesmap
optional
product_idstring
optional

If provided, the specifier will only apply to the product with the specified ID.

formatuuid
product_tagsarray of string
optional

If provided, the specifier will only apply to products with all the specified tags.

uniqueness_keystring
optional

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

minLength1
maxLength128
Returns
dataidstringID
curl https://api.metronome.com/v1/contracts/customerCommits/create \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $METRONOME_BEARER_TOKEN" \
    -d '{
          "access_schedule": {
            "schedule_items": [
              {
                "amount": 1000,
                "ending_before": "2020-02-01T00:00:00.000Z",
                "starting_at": "2020-01-01T00:00:00.000Z"
              }
            ],
            "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2"
          },
          "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
          "priority": 100,
          "product_id": "f14d6729-6a44-4b13-9908-9387f1918790",
          "type": "PREPAID"
        }'
200 Example
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}