Create
Create a commit
Create a new commit at the customer level.
Body Parameters
Schedule for distributing the commit to the customer. For "POSTPAID" commits only one schedule item is allowed and amount must match invoice_schedule total.
If multiple credits or commits are applicable, the one with the lower priority will apply first.
ID of the fixed product associated with the commit. This is required because products are used to invoice the commit amount.
Which contract the commit applies to. If not provided, the commit applies to all contracts.
Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products.
Used only in UI/API. It is not exposed to end customers.
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').
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.
displayed on invoices
This field's availability is dependent on your client's configuration.
This field's availability is dependent on your client's configuration.
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.
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.
Returns
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"
}'
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
}