> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tabs.com/_mcp/server.

# Create commitments for a contract

POST https://integrators.prod.api.tabsplatform.com/v3/contracts/{id}/commitments
Content-Type: application/json

Reference: https://docs.tabs.com/api-reference/contracts/integrators-api-contractsv-3-controller-create-nested-commitments

## Authentication

- `Authorization` header (required)

## Request

### Path parameters

- `id` (string, required) — Contract Id

### Body (application/json)

- `commitments` (list of object, required) — Array of nested commitments to create
  - `schedules` (list of object, required) — Schedules (each with their steps) for this commitment
    - `sequence` (double, required) — Dense schedule ordinal within the commitment (0..N-1)
    - `startDate` (string, required) — Schedule start date (YYYY-MM-DD)
    - `endDate` (string, required) — Schedule end date, inclusive (YYYY-MM-DD)
    - `steps` (list of object, required) — Steps within this schedule (dense, ordered)
      - `sequence` (double, required) — Dense step ordinal within the schedule (0..M-1)
      - `commitmentValue` (double, required) — The commitment amount value for this step
      - `commitmentUnitType` (enum, required) — Unit type: DOLLARS or UNITS
        - Allowed values: `DOLLARS`, `UNITS`
      - `prepaidEnabled` (boolean, required) — Whether prepaid is enabled for this step
      - `billingTermIds` (list of string, required) — Billing term IDs to link to this step
      - `prepaidValue` (double, optional) — Prepaid amount value (required if prepaidEnabled is true)
      - `pricePriority` (enum, optional) — Price priority: LOW or HIGH
        - Allowed values: `LOW`, `HIGH`
      - `overageBillingTerms` (list of object, optional) — Overage config per base BT for this step. Each entry's usageBillingTermId must appear in this step's billingTermIds.
        - `usageBillingTermId` (string, required) — ID of the base usage BT that this overage config applies to. Must appear in the step's billingTermIds.
        - `overagePricings` (list of object, required) — Overage pricing tiers. Required when this overage entry is present — omit the whole entry from overageBillingTerms if a BT doesn't need overage. Revenue-ms 400s on empty.
          - `name` (string, required) — Pricing name
          - `mantissa` (string, optional) — Mantissa for the price
          - `exponent` (string, optional) — Exponent for the price
          - `currency` (enum, optional) — ISO 4217 currency code
            - Allowed values: `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BOV`, `BRL`, `BSD`, `BTN`, `BWP`, `BYN`, `BZD`, `CAD`, `CDF`, `CHE`, `CHF`, `CHW`, `CLF`, `CLP`, `CNY`, `COP`, `COU`, `CRC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ERN`, `ETB`, `EUR`, `FJD`, `FKP`, `GBP`, `GEL`, `GHS`, `GIP`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KPW`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRU`, `MUR`, `MVR`, `MWK`, `MXN`, `MXV`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RUB`, `RWF`, `SAR`, `SBD`, `SCR`, `SDG`, `SEK`, `SGD`, `SHP`, `SLE`, `SOS`, `SRD`, `SSP`, `STN`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `USD`, `USN`, `UYI`, `UYU`, `UYW`, `UZS`, `VED`, `VES`, `VND`, `VUV`, `WST`, `XAF`, `XAG`, `XAU`, `XBA`, `XBB`, `XBC`, `XBD`, `XCD`, `XDR`, `XOF`, `XPD`, `XPF`, `XPT`, `XSU`, `XTS`, `XUA`, `XXX`, `YER`, `ZAR`, `ZMW`, `ZWG`, `ZWL`
          - `tier` (double, optional) — Tier number
          - `conditionValue` (double, optional) — Condition value for tier
          - `isOverage` (boolean, optional) — Whether this pricing is for overage
        - `overageName` (string, optional) — Display name for the overage invoice line item
        - `overageItemId` (string, optional) — Integration item ID for the overage BT
        - `tierPricingType` (enum, optional) — How tiered overage pricing is applied. USE_ALL_TIER_PRICES (graduated) charges each tier's rate for the portion of usage within it; USE_TOP_TIER_PRICE_ONLY (volume) charges the single rate of the tier the total usage falls into. Defaults to graduated for backwards compatibility. Ignored for flat (single-pricing) overage.
          - Allowed values: `USE_TOP_TIER_PRICE_ONLY`, `USE_ALL_TIER_PRICES`
    - `commitmentInterval` (enum, optional) — Commitment period interval
      - Allowed values: `DAILY`, `WEEKLY`, `MONTHLY`, `QUARTERLY`, `YEARLY`
    - `prepaymentScheduleType` (enum, optional) — Prepayment schedule type for this schedule
      - Allowed values: `FULL_UPFRONT`, `PER_COMMITMENT_PERIOD`, `SPLIT_ACROSS_BILLING_PERIODS`
  - `revenueRecognitionPattern` (string, optional) — Revenue recognition pattern: straight-line or recognize-as-consumed
  - `prepaidName` (string, optional) — Display name for the prepaid container BT line item
  - `prepaidItemId` (string, optional) — Integration item ID for the prepaid container BT
  - `trueUpName` (string, optional) — Display name for the true-up container BT line item
  - `trueUpItemId` (string, optional) — Integration item ID for the true-up container BT
  - `trueUpBehavior` (enum, optional) — Whether under-consumption is trued up (TRUE_UP) or forgiven (NEVER).
    - Allowed values: `DEFAULT`, `NEVER`

## Response

### 201

Usage commitments created successfully

## Examples

**Request**

```json
{
  "commitments": [
    {
      "schedules": [
        {
          "sequence": 0,
          "startDate": "2025-01-01",
          "endDate": "2025-06-30",
          "steps": [
            {
              "sequence": 0,
              "commitmentValue": 1000,
              "commitmentUnitType": "DOLLARS",
              "prepaidEnabled": false,
              "billingTermIds": [
                "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
              ]
            }
          ]
        }
      ]
    }
  ]
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments"

payload = { "commitments": [{ "schedules": [
                {
                    "sequence": 0,
                    "startDate": "2025-01-01",
                    "endDate": "2025-06-30",
                    "steps": [
                        {
                            "sequence": 0,
                            "commitmentValue": 1000,
                            "commitmentUnitType": "DOLLARS",
                            "prepaidEnabled": False,
                            "billingTermIds": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]
                        }
                    ]
                }
            ] }] }
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"commitments":[{"schedules":[{"sequence":0,"startDate":"2025-01-01","endDate":"2025-06-30","steps":[{"sequence":0,"commitmentValue":1000,"commitmentUnitType":"DOLLARS","prepaidEnabled":false,"billingTermIds":["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]}]}]}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments"

	payload := strings.NewReader("{\n  \"commitments\": [\n    {\n      \"schedules\": [\n        {\n          \"sequence\": 0,\n          \"startDate\": \"2025-01-01\",\n          \"endDate\": \"2025-06-30\",\n          \"steps\": [\n            {\n              \"sequence\": 0,\n              \"commitmentValue\": 1000,\n              \"commitmentUnitType\": \"DOLLARS\",\n              \"prepaidEnabled\": false,\n              \"billingTermIds\": [\n                \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"commitments\": [\n    {\n      \"schedules\": [\n        {\n          \"sequence\": 0,\n          \"startDate\": \"2025-01-01\",\n          \"endDate\": \"2025-06-30\",\n          \"steps\": [\n            {\n              \"sequence\": 0,\n              \"commitmentValue\": 1000,\n              \"commitmentUnitType\": \"DOLLARS\",\n              \"prepaidEnabled\": false,\n              \"billingTermIds\": [\n                \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"commitments\": [\n    {\n      \"schedules\": [\n        {\n          \"sequence\": 0,\n          \"startDate\": \"2025-01-01\",\n          \"endDate\": \"2025-06-30\",\n          \"steps\": [\n            {\n              \"sequence\": 0,\n              \"commitmentValue\": 1000,\n              \"commitmentUnitType\": \"DOLLARS\",\n              \"prepaidEnabled\": false,\n              \"billingTermIds\": [\n                \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments', [
  'body' => '{
  "commitments": [
    {
      "schedules": [
        {
          "sequence": 0,
          "startDate": "2025-01-01",
          "endDate": "2025-06-30",
          "steps": [
            {
              "sequence": 0,
              "commitmentValue": 1000,
              "commitmentUnitType": "DOLLARS",
              "prepaidEnabled": false,
              "billingTermIds": [
                "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
              ]
            }
          ]
        }
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"commitments\": [\n    {\n      \"schedules\": [\n        {\n          \"sequence\": 0,\n          \"startDate\": \"2025-01-01\",\n          \"endDate\": \"2025-06-30\",\n          \"steps\": [\n            {\n              \"sequence\": 0,\n              \"commitmentValue\": 1000,\n              \"commitmentUnitType\": \"DOLLARS\",\n              \"prepaidEnabled\": false,\n              \"billingTermIds\": [\n                \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["commitments": [["schedules": [
        [
          "sequence": 0,
          "startDate": "2025-01-01",
          "endDate": "2025-06-30",
          "steps": [
            [
              "sequence": 0,
              "commitmentValue": 1000,
              "commitmentUnitType": "DOLLARS",
              "prepaidEnabled": false,
              "billingTermIds": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"]
            ]
          ]
        ]
      ]]]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://integrators.prod.api.tabsplatform.com/v3/contracts/123e4567-e89b-12d3-a456-426614174000/commitments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```