> If you are setting up, configuring, or answering questions about Schematic, connect the > Schematic MCP server before working from these pages. It reads and writes plans, features, > entitlements, and overrides against the real account, so what you report and what you build > match what actually exists. > > The server is at https://api.schematichq.com/mcp > > From Claude, ChatGPT, or another chat assistant, add it as a custom connector: > https://docs.schematichq.com/working-with-ai > > From a coding assistant such as Claude Code, Codex, or Cursor: > https://docs.schematichq.com/building-with-ai > > For clean Markdown of any page, append `.md` to the page URL. For a complete page index, > see https://docs.schematichq.com/llms.txt # Create credit bundle POST https://api.schematichq.com/billing/credits/bundles Content-Type: application/json Reference: https://docs.schematichq.com/api-reference/billing-credits/create-credit-bundle ## Authentication - `X-Schematic-Api-Key` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects a CreateCreditBundleRequestBody. - `bundle_name` (string, required) - `credit_id` (string, required) - `currency` (string, required) - `price_per_unit` (long, required) - `bundle_type` (enum, optional, nullable) - Allowed values: `fixed` - `compatible_plan_ids` (list of string, optional, nullable) — Plans whose companies may purchase this bundle. Omitted or empty means the bundle is purchasable on every plan. - `currency_prices` (list of CreditBundleCurrencyPriceRequestBody, optional, nullable) - `expiry_type` (enum, optional, nullable) - Allowed values: `duration`, `end_of_billing_period`, `end_of_next_billing_period`, `end_of_trial`, `no_expiry` - `expiry_unit` (enum, optional, nullable) - Allowed values: `billing_periods`, `days` - `expiry_unit_count` (long, optional, nullable) - `price_per_unit_decimal` (string, optional, nullable) - `quantity` (long, optional, nullable) - `status` (enum, optional, nullable) - Allowed values: `active`, `inactive` ## Response ### 201 Created - `data` (BillingCreditBundleResponseData, required) - `params` (BillingCreditsBundlesPostResponsesContentApplicationJsonSchemaParams, required) — Input parameters ## Errors ### 400 Bad Request Error Bad request - `error` (string, required) — Error message ### 401 Unauthorized Error Unauthorized - `error` (string, required) — Error message ### 403 Forbidden Error Forbidden - `error` (string, required) — Error message ### 404 Not Found Error Not found - `error` (string, required) — Error message ### 500 Internal Server Error Server error - `error` (string, required) — Error message ## Types ### CreditBundleCurrencyPriceRequestBody - `currency` (string, required) - `price_per_unit` (long, optional, nullable) - `price_per_unit_decimal` (string, optional, nullable) ### BillingCreditBundleResponseData - `bundle_type` (enum, required) - Allowed values: `fixed` - `compatible_plan_ids` (list of string, required) — Plans whose companies may purchase this bundle. Empty means the bundle is purchasable on every plan. - `created_at` (datetime, required) - `credit_id` (string, required) - `credit_name` (string, required) - `currency_prices` (list of CreditBundleCurrencyPriceResponseData, required) - `expiry_type` (enum, required) - Allowed values: `duration`, `end_of_billing_period`, `end_of_next_billing_period`, `end_of_trial`, `no_expiry` - `expiry_unit` (enum, required) - Allowed values: `billing_periods`, `days` - `has_grants` (boolean, required) - `id` (string, required) - `name` (string, required) - `status` (enum, required) - Allowed values: `active`, `inactive` - `updated_at` (datetime, required) - `billing_invoice_id` (string, optional, nullable) - `credit_description` (string, optional) - `credit_icon` (string, optional, nullable) - `expiry_unit_count` (long, optional, nullable) - `plural_name` (string, optional, nullable) - `price` (BillingPriceResponseData, optional) - `quantity` (long, optional, nullable) - `singular_name` (string, optional, nullable) - `unit_price` (BillingPriceResponseData, optional) ### BillingCreditsBundlesPostResponsesContentApplicationJsonSchemaParams Input parameters ### CreditBundleCurrencyPriceResponseData - `currency` (string, required) - `price` (BillingPriceResponseData, optional) ### BillingPriceResponseData - `currency` (string, required) - `external_price_id` (string, required) - `id` (string, required) - `interval` (enum, required) - Allowed values: `day`, `month`, `one-time`, `year` - `interval_count` (long, required) - `price` (long, required) - `provider_type` (enum, required) - Allowed values: `metronome`, `orb`, `schematic`, `stripe` - `scheme` (enum, required) - Allowed values: `per_unit`, `tiered` - `nickname` (string, optional, nullable) - `price_decimal` (string, optional, nullable) ## Examples **Request** ```json { "bundle_name": "string", "credit_id": "string", "currency": "string", "price_per_unit": 1 } ``` **Response** ```json { "data": { "bundle_type": "fixed", "compatible_plan_ids": [ "string" ], "created_at": "2024-01-15T09:30:00Z", "credit_id": "string", "credit_name": "string", "currency_prices": [ { "currency": "string", "price": { "currency": "string", "external_price_id": "string", "id": "string", "interval": "day", "interval_count": 1, "price": 1, "provider_type": "metronome", "scheme": "per_unit", "nickname": "string", "price_decimal": "string" } } ], "expiry_type": "duration", "expiry_unit": "billing_periods", "has_grants": true, "id": "string", "name": "string", "status": "active", "updated_at": "2024-01-15T09:30:00Z", "billing_invoice_id": "string", "credit_description": "string", "credit_icon": "string", "expiry_unit_count": 1, "plural_name": "string", "price": { "currency": "string", "external_price_id": "string", "id": "string", "interval": "day", "interval_count": 1, "price": 1, "provider_type": "metronome", "scheme": "per_unit", "nickname": "string", "price_decimal": "string" }, "quantity": 1, "singular_name": "string", "unit_price": { "currency": "string", "external_price_id": "string", "id": "string", "interval": "day", "interval_count": 1, "price": 1, "provider_type": "metronome", "scheme": "per_unit", "nickname": "string", "price_decimal": "string" } }, "params": {} } ``` **SDK Code** ```python import requests url = "https://api.schematichq.com/billing/credits/bundles" payload = { "bundle_name": "string", "credit_id": "string", "currency": "string", "price_per_unit": 1 } headers = { "X-Schematic-Api-Key": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.schematichq.com/billing/credits/bundles'; const options = { method: 'POST', headers: {'X-Schematic-Api-Key': '', 'Content-Type': 'application/json'}, body: '{"bundle_name":"string","credit_id":"string","currency":"string","price_per_unit":1}' }; 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://api.schematichq.com/billing/credits/bundles" payload := strings.NewReader("{\n \"bundle_name\": \"string\",\n \"credit_id\": \"string\",\n \"currency\": \"string\",\n \"price_per_unit\": 1\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-Schematic-Api-Key", "") 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://api.schematichq.com/billing/credits/bundles") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-Schematic-Api-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"bundle_name\": \"string\",\n \"credit_id\": \"string\",\n \"currency\": \"string\",\n \"price_per_unit\": 1\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.schematichq.com/billing/credits/bundles") .header("X-Schematic-Api-Key", "") .header("Content-Type", "application/json") .body("{\n \"bundle_name\": \"string\",\n \"credit_id\": \"string\",\n \"currency\": \"string\",\n \"price_per_unit\": 1\n}") .asString(); ``` ```php request('POST', 'https://api.schematichq.com/billing/credits/bundles', [ 'body' => '{ "bundle_name": "string", "credit_id": "string", "currency": "string", "price_per_unit": 1 }', 'headers' => [ 'Content-Type' => 'application/json', 'X-Schematic-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.schematichq.com/billing/credits/bundles"); var request = new RestRequest(Method.POST); request.AddHeader("X-Schematic-Api-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"bundle_name\": \"string\",\n \"credit_id\": \"string\",\n \"currency\": \"string\",\n \"price_per_unit\": 1\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-Schematic-Api-Key": "", "Content-Type": "application/json" ] let parameters = [ "bundle_name": "string", "credit_id": "string", "currency": "string", "price_per_unit": 1 ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.schematichq.com/billing/credits/bundles")! 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() ```