> 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 # Grant credits to company POST https://api.schematichq.com/billing/credits/grants/company Content-Type: application/json Reference: https://docs.schematichq.com/api-reference/billing-credits/grant-billing-credits-to-company ## Authentication - `X-Schematic-Api-Key` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects a CreateCompanyCreditGrant. - `company_id` (string, required) - `credit_id` (string, required) - `quantity` (long, required) - `reason` (enum, required) - Allowed values: `adjustment`, `billing_credit_auto_topup`, `free`, `plan`, `postpaid_forgiven`, `postpaid_overdraft`, `postpaid_settlement`, `purchased`, `rollover` - `billing_periods_count` (long, optional, nullable) - `credit_bundle_id` (string, optional, nullable) - `currency` (enum, optional, nullable) - Allowed values: `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, `kyd`, `kzt`, `lak`, `lbp`, `lkr`, `lrd`, `lsl`, `mad`, `mdl`, `mga`, `mkd`, `mmk`, `mnt`, `mop`, `mur`, `mvr`, `mwk`, `mxn`, `myr`, `mzn`, `nad`, `ngn`, `nio`, `nok`, `npr`, `nzd`, `pab`, `pen`, `pgk`, `php`, `pkr`, `pln`, `pyg`, `qar`, `ron`, `rsd`, `rub`, `rwf`, `sar`, `sbd`, `scr`, `sek`, `sgd`, `shp`, `sle`, `sos`, `srd`, `std`, `szl`, `thb`, `tjs`, `top`, `try`, `ttd`, `twd`, `tzs`, `uah`, `ugx`, `usd`, `uyu`, `uzs`, `vnd`, `vuv`, `wst`, `xaf`, `xcd`, `xcg`, `xof`, `xpf`, `yer`, `zar`, `zmw` - `expires_at` (datetime, 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) - `renewal_enabled` (boolean, optional, nullable) - `renewal_period` (enum, optional, nullable) - Allowed values: `billing_period`, `first_of_month` ## Response ### 201 Created - `data` (BillingCreditGrantResponseData, required) - `params` (BillingCreditsGrantsCompanyPostResponsesContentApplicationJsonSchemaParams, 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 ### BillingCreditGrantResponseData - `company_id` (string, required) - `company_name` (string, required) - `created_at` (datetime, required) - `credit_id` (string, required) - `credit_name` (string, required) - `grant_reason` (enum, required) - Allowed values: `adjustment`, `billing_credit_auto_topup`, `free`, `plan`, `postpaid_forgiven`, `postpaid_overdraft`, `postpaid_settlement`, `purchased`, `rollover` - `id` (string, required) - `quantity` (double, required) - `quantity_remaining` (double, required) - `quantity_used` (double, required) - `renewal_enabled` (boolean, required) - `source_label` (string, required) - `updated_at` (datetime, required) - `company_license_id` (string, optional, nullable) — The license instance this grant was issued for. Set only when a per-license plan grant issued it; null on a plan's own grant. - `credit_bundle_id` (string, optional, nullable) — The catalog bundle this grant was issued from, when the company bought one. - `credit_icon` (string, optional, nullable) - `currency` (enum, optional, nullable) - Allowed values: `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, `kyd`, `kzt`, `lak`, `lbp`, `lkr`, `lrd`, `lsl`, `mad`, `mdl`, `mga`, `mkd`, `mmk`, `mnt`, `mop`, `mur`, `mvr`, `mwk`, `mxn`, `myr`, `mzn`, `nad`, `ngn`, `nio`, `nok`, `npr`, `nzd`, `pab`, `pen`, `pgk`, `php`, `pkr`, `pln`, `pyg`, `qar`, `ron`, `rsd`, `rub`, `rwf`, `sar`, `sbd`, `scr`, `sek`, `sgd`, `shp`, `sle`, `sos`, `srd`, `std`, `szl`, `thb`, `tjs`, `top`, `try`, `ttd`, `twd`, `tzs`, `uah`, `ugx`, `usd`, `uyu`, `uzs`, `vnd`, `vuv`, `wst`, `xaf`, `xcd`, `xcg`, `xof`, `xpf`, `yer`, `zar`, `zmw` - `expires_at` (datetime, optional, nullable) - `license_name` (string, optional, nullable) — Name of the license this grant was issued for, when it came from a per-license plan grant. - `plan_id` (string, optional, nullable) - `plan_name` (string, optional, nullable) - `postpaid_charge_amount` (long, optional, nullable) — What the postpaid charges costs, in the currency's minor unit. - `postpaid_charge_currency` (enum, optional, nullable) - Allowed values: `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, `kyd`, `kzt`, `lak`, `lbp`, `lkr`, `lrd`, `lsl`, `mad`, `mdl`, `mga`, `mkd`, `mmk`, `mnt`, `mop`, `mur`, `mvr`, `mwk`, `mxn`, `myr`, `mzn`, `nad`, `ngn`, `nio`, `nok`, `npr`, `nzd`, `pab`, `pen`, `pgk`, `php`, `pkr`, `pln`, `pyg`, `qar`, `ron`, `rsd`, `rub`, `rwf`, `sar`, `sbd`, `scr`, `sek`, `sgd`, `shp`, `sle`, `sos`, `srd`, `std`, `szl`, `thb`, `tjs`, `top`, `try`, `ttd`, `twd`, `tzs`, `uah`, `ugx`, `usd`, `uyu`, `uzs`, `vnd`, `vuv`, `wst`, `xaf`, `xcd`, `xcg`, `xof`, `xpf`, `yer`, `zar`, `zmw` - `postpaid_charged_credits` (double, optional, nullable) — Credits consumed past a zero balance in the window still open. - `price` (BillingPriceResponseData, optional) - `renewal_period` (enum, optional, nullable) - Allowed values: `daily`, `every_6_months`, `monthly`, `quarterly`, `weekly`, `yearly` - `reserved` (double, optional, nullable) - `settled` (double, optional, nullable) - `source_grant_id` (string, optional, nullable) — For rollover grants, the ID of the source grant that this grant rolled from. - `transfers` (list of CreditTransferResponseData, optional) - `valid_from` (datetime, optional, nullable) - `zeroed_out_date` (datetime, optional, nullable) - `zeroed_out_reason` (enum, optional, nullable) - Allowed values: `customer_archived`, `expired`, `integration_uninstalled`, `license_retired`, `manual`, `plan_change`, `plan_period_reset`, `reconciled` ### BillingCreditsGrantsCompanyPostResponsesContentApplicationJsonSchemaParams Input parameters ### BillingPriceResponseData - `currency` (enum, required) - Allowed values: `aed`, `afn`, `all`, `amd`, `ang`, `aoa`, `ars`, `aud`, `awg`, `azn`, `bam`, `bbd`, `bdt`, `bif`, `bmd`, `bnd`, `bob`, `brl`, `bsd`, `bwp`, `byn`, `bzd`, `cad`, `cdf`, `chf`, `clp`, `cny`, `cop`, `crc`, `cve`, `czk`, `djf`, `dkk`, `dop`, `dzd`, `egp`, `etb`, `eur`, `fjd`, `fkp`, `gbp`, `gel`, `gip`, `gmd`, `gnf`, `gtq`, `gyd`, `hkd`, `hnl`, `htg`, `huf`, `idr`, `ils`, `inr`, `isk`, `jmd`, `jpy`, `kes`, `kgs`, `khr`, `kmf`, `krw`, `kyd`, `kzt`, `lak`, `lbp`, `lkr`, `lrd`, `lsl`, `mad`, `mdl`, `mga`, `mkd`, `mmk`, `mnt`, `mop`, `mur`, `mvr`, `mwk`, `mxn`, `myr`, `mzn`, `nad`, `ngn`, `nio`, `nok`, `npr`, `nzd`, `pab`, `pen`, `pgk`, `php`, `pkr`, `pln`, `pyg`, `qar`, `ron`, `rsd`, `rub`, `rwf`, `sar`, `sbd`, `scr`, `sek`, `sgd`, `shp`, `sle`, `sos`, `srd`, `std`, `szl`, `thb`, `tjs`, `top`, `try`, `ttd`, `twd`, `tzs`, `uah`, `ugx`, `usd`, `uyu`, `uzs`, `vnd`, `vuv`, `wst`, `xaf`, `xcd`, `xcg`, `xof`, `xpf`, `yer`, `zar`, `zmw` - `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) ### CreditTransferResponseData - `amount` (double, required) - `created_at` (datetime, required) - `direction` (string, required) - `id` (string, required) - `reason` (string, required) - `related_grant_id` (string, required) ## Examples **Request** ```json { "company_id": "string", "credit_id": "string", "quantity": 1, "reason": "adjustment" } ``` **Response** ```json { "data": { "company_id": "string", "company_name": "string", "created_at": "2024-01-15T09:30:00Z", "credit_id": "string", "credit_name": "string", "grant_reason": "adjustment", "id": "string", "quantity": 1.1, "quantity_remaining": 1.1, "quantity_used": 1.1, "renewal_enabled": true, "source_label": "string", "updated_at": "2024-01-15T09:30:00Z", "company_license_id": "string", "credit_bundle_id": "string", "credit_icon": "string", "currency": "aed", "expires_at": "2024-01-15T09:30:00Z", "license_name": "string", "plan_id": "string", "plan_name": "string", "postpaid_charge_amount": 1, "postpaid_charge_currency": "aed", "postpaid_charged_credits": 1.1, "price": { "currency": "aed", "external_price_id": "string", "id": "string", "interval": "day", "interval_count": 1, "price": 1, "provider_type": "metronome", "scheme": "per_unit", "nickname": "string", "price_decimal": "string" }, "renewal_period": "daily", "reserved": 1.1, "settled": 1.1, "source_grant_id": "string", "transfers": [ { "amount": 1.1, "created_at": "2024-01-15T09:30:00Z", "direction": "string", "id": "string", "reason": "string", "related_grant_id": "string" } ], "valid_from": "2024-01-15T09:30:00Z", "zeroed_out_date": "2024-01-15T09:30:00Z", "zeroed_out_reason": "customer_archived" }, "params": {} } ``` **SDK Code** ```python import requests url = "https://api.schematichq.com/billing/credits/grants/company" payload = { "company_id": "string", "credit_id": "string", "quantity": 1, "reason": "adjustment" } 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/grants/company'; const options = { method: 'POST', headers: {'X-Schematic-Api-Key': '', 'Content-Type': 'application/json'}, body: '{"company_id":"string","credit_id":"string","quantity":1,"reason":"adjustment"}' }; 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/grants/company" payload := strings.NewReader("{\n \"company_id\": \"string\",\n \"credit_id\": \"string\",\n \"quantity\": 1,\n \"reason\": \"adjustment\"\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/grants/company") 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 \"company_id\": \"string\",\n \"credit_id\": \"string\",\n \"quantity\": 1,\n \"reason\": \"adjustment\"\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/grants/company") .header("X-Schematic-Api-Key", "") .header("Content-Type", "application/json") .body("{\n \"company_id\": \"string\",\n \"credit_id\": \"string\",\n \"quantity\": 1,\n \"reason\": \"adjustment\"\n}") .asString(); ``` ```php request('POST', 'https://api.schematichq.com/billing/credits/grants/company', [ 'body' => '{ "company_id": "string", "credit_id": "string", "quantity": 1, "reason": "adjustment" }', '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/grants/company"); var request = new RestRequest(Method.POST); request.AddHeader("X-Schematic-Api-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"company_id\": \"string\",\n \"credit_id\": \"string\",\n \"quantity\": 1,\n \"reason\": \"adjustment\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-Schematic-Api-Key": "", "Content-Type": "application/json" ] let parameters = [ "company_id": "string", "credit_id": "string", "quantity": 1, "reason": "adjustment" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.schematichq.com/billing/credits/grants/company")! 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() ```