> 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

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

Reference: https://docs.tabs.com/api-reference/commitments/createUsageCommitments

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Tabs External API
  version: 1.0.0
paths:
  /v3/commitments:
    post:
      operationId: integrators-api-commitments-controller-create-usage-commitments
      summary: Create commitments
      tags:
        - commitments
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Usage commitments created successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Commitments_IntegratorsApiCommitmentsController_createUsageCommitments_Response_201
        '400':
          description: Validation error or BT lockdown
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Contract not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUsageCommitmentsV3RequestDto'
servers:
  - url: https://integrators.prod.api.tabsplatform.com
    description: https://integrators.prod.api.tabsplatform.com
components:
  schemas:
    CreateUsageCommitmentV3DtoCommitmentUnitType:
      type: string
      enum:
        - DOLLARS
        - UNITS
      description: 'Unit type: DOLLARS or UNITS'
      title: CreateUsageCommitmentV3DtoCommitmentUnitType
    CreateUsageCommitmentV3DtoCommitmentInterval:
      type: string
      enum:
        - DAILY
        - WEEKLY
        - MONTHLY
        - QUARTERLY
        - YEARLY
      description: Commitment period interval
      title: CreateUsageCommitmentV3DtoCommitmentInterval
    CreateUsageCommitmentV3DtoPrepaymentScheduleType:
      type: string
      enum:
        - FULL_UPFRONT
        - PER_COMMITMENT_PERIOD
        - SPLIT_ACROSS_BILLING_PERIODS
      description: >-
        Prepayment schedule type. Takes precedence over prePaidWholeCommitment.
        Defaults to FULL_UPFRONT when omitted and prepaidEnabled is true.
      title: CreateUsageCommitmentV3DtoPrepaymentScheduleType
    CreateUsageCommitmentV3DtoPricePriority:
      type: string
      enum:
        - LOW
        - HIGH
      description: 'Price priority: LOW or HIGH'
      title: CreateUsageCommitmentV3DtoPricePriority
    CreateUsageCommitmentOveragePricingItemV3DtoCurrency:
      type: string
      enum:
        - 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
      description: ISO 4217 currency code
      title: CreateUsageCommitmentOveragePricingItemV3DtoCurrency
    CreateUsageCommitmentOveragePricingItemV3Dto:
      type: object
      properties:
        name:
          type: string
          description: Pricing name
        mantissa:
          type: string
          description: Mantissa for the price
        exponent:
          type: string
          description: Exponent for the price
        currency:
          $ref: >-
            #/components/schemas/CreateUsageCommitmentOveragePricingItemV3DtoCurrency
          description: ISO 4217 currency code
        tier:
          type: number
          format: double
          description: Tier number
        conditionValue:
          type: number
          format: double
          description: Condition value for tier
        isOverage:
          type: boolean
          description: Whether this pricing is for overage
      required:
        - name
      title: CreateUsageCommitmentOveragePricingItemV3Dto
    CreateUsageCommitmentOverageConfigV3Dto:
      type: object
      properties:
        billingTermId:
          type: string
          description: Billing term ID this overage config applies to
        overagePrice:
          type: number
          format: double
          description: Price per unit for overage
        overageInvoiceLineName:
          type: string
          description: Display name for overage invoice line item
        overageIntegrationItemId:
          type: string
          description: Integration item ID for overage invoice line item
        overagePricings:
          type: array
          items:
            $ref: '#/components/schemas/CreateUsageCommitmentOveragePricingItemV3Dto'
          description: Detailed pricing tiers for overage
      required:
        - billingTermId
        - overagePrice
      title: CreateUsageCommitmentOverageConfigV3Dto
    CreateUsageCommitmentV3Dto:
      type: object
      properties:
        commitmentValue:
          type: number
          format: double
          description: The commitment amount value
        commitmentUnitType:
          $ref: '#/components/schemas/CreateUsageCommitmentV3DtoCommitmentUnitType'
          description: 'Unit type: DOLLARS or UNITS'
        prepaidEnabled:
          type: boolean
          description: Whether prepaid is enabled
        prepaidValue:
          type: number
          format: double
          description: Prepaid amount value (required if prepaidEnabled is true)
        prepaymentInvoiceLineName:
          type: string
          description: Name of prepayment invoice line item
        prepaymentIntegrationItem:
          type: string
          description: Integration item ID for prepayment
        revenueRecognitionPattern:
          type: string
          description: 'Revenue recognition pattern: straight-line or recognize-as-consumed'
        trueUpName:
          type: string
          description: Name of true-up invoice line item (for non-prepaid)
        trueUpIntegrationItem:
          type: string
          description: Integration item ID for true-up invoice line (non-prepaid)
        billingTermIds:
          type: array
          items:
            type: string
          description: Billing term IDs to link to this commitment
        commitmentStartDate:
          type: string
          description: Commitment start date (YYYY-MM-DD)
        commitmentEndDate:
          type: string
          description: Commitment end date, inclusive (YYYY-MM-DD)
        isFullDuration:
          type: boolean
          description: Whether commitment lasts the full duration
        commitmentInterval:
          $ref: '#/components/schemas/CreateUsageCommitmentV3DtoCommitmentInterval'
          description: Commitment period interval
        isSequential:
          type: boolean
          description: Whether this is a sequential commitment
        previousCommitmentId:
          type: string
          description: ID of the previous commitment if sequential
        prePaidWholeCommitment:
          type: boolean
          description: >-
            Whether the whole commitment is prepaid upfront (pay-in-full). False
            means split-payment. Deprecated: use prepaymentScheduleType instead.
        prepaymentScheduleType:
          $ref: >-
            #/components/schemas/CreateUsageCommitmentV3DtoPrepaymentScheduleType
          description: >-
            Prepayment schedule type. Takes precedence over
            prePaidWholeCommitment. Defaults to FULL_UPFRONT when omitted and
            prepaidEnabled is true.
        pricePriority:
          $ref: '#/components/schemas/CreateUsageCommitmentV3DtoPricePriority'
          description: 'Price priority: LOW or HIGH'
        overageConfigs:
          type: array
          items:
            $ref: '#/components/schemas/CreateUsageCommitmentOverageConfigV3Dto'
          description: Overage pricing configuration per billing term
      required:
        - commitmentValue
        - commitmentUnitType
        - prepaidEnabled
        - billingTermIds
      title: CreateUsageCommitmentV3Dto
    CreateUsageCommitmentsV3RequestDto:
      type: object
      properties:
        contractId:
          type: string
          description: The contract ID
        commitments:
          type: array
          items:
            $ref: '#/components/schemas/CreateUsageCommitmentV3Dto'
          description: Array of commitments to create
      required:
        - contractId
        - commitments
      title: CreateUsageCommitmentsV3RequestDto
    V3CommitmentsPostResponsesContentApplicationJsonSchemaPayload:
      type: object
      properties:
        success:
          type: boolean
        commitmentIds:
          type: array
          items:
            type: string
      description: Response payload, will be empty when success is false
      title: V3CommitmentsPostResponsesContentApplicationJsonSchemaPayload
    IntegratorsApiErrorDetails:
      type: object
      properties: {}
      description: Additional details about the error
      title: IntegratorsApiErrorDetails
    IntegratorsApiError:
      type: object
      properties:
        code:
          type: number
          format: double
          description: API response code
        message:
          type: string
          description: API response message
        details:
          $ref: '#/components/schemas/IntegratorsApiErrorDetails'
          description: Additional details about the error
      required:
        - code
        - message
      title: IntegratorsApiError
    Commitments_IntegratorsApiCommitmentsController_createUsageCommitments_Response_201:
      type: object
      properties:
        payload:
          $ref: >-
            #/components/schemas/V3CommitmentsPostResponsesContentApplicationJsonSchemaPayload
          description: Response payload, will be empty when success is false
        success:
          type: boolean
          description: Boolean with true=success, false=failure
        message:
          type: string
          description: Plain-text description of the result
        error:
          $ref: '#/components/schemas/IntegratorsApiError'
          description: json element with any error messages or warnings
      required:
        - payload
        - success
        - message
        - error
      title: >-
        Commitments_IntegratorsApiCommitmentsController_createUsageCommitments_Response_201
  securitySchemes:
    custom-header:
      type: apiKey
      in: header
      name: Authorization

```

## Examples



**Request**

```json
{
  "contractId": "d4e5f6a7-b890-1234-cdef-56789abcdef0",
  "commitments": [
    {
      "commitmentValue": 15000,
      "commitmentUnitType": "DOLLARS",
      "prepaidEnabled": true,
      "billingTermIds": [
        "b1c2d3e4-f567-890a-bcde-f1234567890a"
      ]
    }
  ]
}
```

**Response**

```json
{
  "payload": {
    "success": true,
    "commitmentIds": [
      "c3d4e5f6-a789-0123-bcde-f4567890abcd"
    ]
  },
  "success": true,
  "message": "Usage commitments created successfully",
  "error": {
    "code": 0,
    "message": "",
    "details": {}
  }
}
```

**SDK Code**

```python
import requests

url = "https://integrators.prod.api.tabsplatform.com/v3/commitments"

payload = {
    "contractId": "d4e5f6a7-b890-1234-cdef-56789abcdef0",
    "commitments": [
        {
            "commitmentValue": 15000,
            "commitmentUnitType": "DOLLARS",
            "prepaidEnabled": True,
            "billingTermIds": ["b1c2d3e4-f567-890a-bcde-f1234567890a"]
        }
    ]
}
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/commitments';
const options = {
  method: 'POST',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"contractId":"d4e5f6a7-b890-1234-cdef-56789abcdef0","commitments":[{"commitmentValue":15000,"commitmentUnitType":"DOLLARS","prepaidEnabled":true,"billingTermIds":["b1c2d3e4-f567-890a-bcde-f1234567890a"]}]}'
};

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/commitments"

	payload := strings.NewReader("{\n  \"contractId\": \"d4e5f6a7-b890-1234-cdef-56789abcdef0\",\n  \"commitments\": [\n    {\n      \"commitmentValue\": 15000,\n      \"commitmentUnitType\": \"DOLLARS\",\n      \"prepaidEnabled\": true,\n      \"billingTermIds\": [\n        \"b1c2d3e4-f567-890a-bcde-f1234567890a\"\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/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  \"contractId\": \"d4e5f6a7-b890-1234-cdef-56789abcdef0\",\n  \"commitments\": [\n    {\n      \"commitmentValue\": 15000,\n      \"commitmentUnitType\": \"DOLLARS\",\n      \"prepaidEnabled\": true,\n      \"billingTermIds\": [\n        \"b1c2d3e4-f567-890a-bcde-f1234567890a\"\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/commitments")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contractId\": \"d4e5f6a7-b890-1234-cdef-56789abcdef0\",\n  \"commitments\": [\n    {\n      \"commitmentValue\": 15000,\n      \"commitmentUnitType\": \"DOLLARS\",\n      \"prepaidEnabled\": true,\n      \"billingTermIds\": [\n        \"b1c2d3e4-f567-890a-bcde-f1234567890a\"\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/commitments', [
  'body' => '{
  "contractId": "d4e5f6a7-b890-1234-cdef-56789abcdef0",
  "commitments": [
    {
      "commitmentValue": 15000,
      "commitmentUnitType": "DOLLARS",
      "prepaidEnabled": true,
      "billingTermIds": [
        "b1c2d3e4-f567-890a-bcde-f1234567890a"
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://integrators.prod.api.tabsplatform.com/v3/commitments");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contractId\": \"d4e5f6a7-b890-1234-cdef-56789abcdef0\",\n  \"commitments\": [\n    {\n      \"commitmentValue\": 15000,\n      \"commitmentUnitType\": \"DOLLARS\",\n      \"prepaidEnabled\": true,\n      \"billingTermIds\": [\n        \"b1c2d3e4-f567-890a-bcde-f1234567890a\"\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "contractId": "d4e5f6a7-b890-1234-cdef-56789abcdef0",
  "commitments": [
    [
      "commitmentValue": 15000,
      "commitmentUnitType": "DOLLARS",
      "prepaidEnabled": true,
      "billingTermIds": ["b1c2d3e4-f567-890a-bcde-f1234567890a"]
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://integrators.prod.api.tabsplatform.com/v3/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()
```