> 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 plan credit grant

POST https://api.schematichq.com/billing/credits/plan-grants
Content-Type: application/json

Reference: https://docs.schematichq.com/api-reference/billing-credits/create-billing-plan-credit-grant

## Authentication

- `X-Schematic-Api-Key` header (required) — API Key authentication via header

## Request

### Body (application/json)

This endpoint expects a CreateBillingPlanCreditGrantRequestBody.

- `credit_amount` (long, required)
- `credit_id` (string, required)
- `plan_id` (string, required)
- `reset_cadence` (enum, required)
  - Allowed values: `daily`, `every_6_months`, `monthly`, `quarterly`, `weekly`, `yearly`
- `reset_start` (enum, required)
  - Allowed values: `billing_period`, `first_of_month`
- `apply_to_existing` (boolean, optional, nullable)
- `arrears_anchor` (enum, optional, nullable) — Which boundary closes a monthly arrears window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Only applies when arrears_cadence is monthly; defaults to billing_period_start.
  - Allowed values: `billing_period_start`, `month_end`
- `arrears_cadence` (enum, optional, nullable) — How often postpaid charges are closed and invoiced: end_of_billing_period (the default) or monthly. Quarterly is not available for postpaid charges.
  - Allowed values: `end_of_billing_period`, `monthly`, `quarterly`
- `auto_topup_amount` (long, optional, nullable)
- `auto_topup_amount_type` (enum, optional, nullable)
  - Allowed values: `credit`
- `auto_topup_availability` (enum, optional, nullable)
  - Allowed values: `off`, `automatic`, `user_controlled`
- `auto_topup_enabled` (boolean, optional, nullable)
- `auto_topup_expiry_type` (enum, optional, nullable)
  - Allowed values: `duration`, `end_of_billing_period`, `end_of_next_billing_period`, `end_of_trial`, `no_expiry`
- `auto_topup_expiry_unit` (enum, optional, nullable)
  - Allowed values: `billing_periods`, `days`
- `auto_topup_expiry_unit_count` (long, optional, nullable)
- `auto_topup_self_service` (boolean, optional, nullable)
- `auto_topup_threshold_credits` (long, optional, nullable)
- `auto_topup_threshold_percent` (long, optional, nullable)
- `billing_mode` (enum, optional, nullable) — Whether the credits are included in the plan price (granted) or billed as their own subscription line at a price per credit (billed). Billed is only available on custom plans. Defaults to granted.
  - Allowed values: `granted`, `billed`
- `company_credit_amount` (long, optional, nullable) — Credits granted once per company on top of the per-license amount. Only valid when scaling is per_license. Defaults to 0.
- `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)
- `license_id` (string, optional, nullable) — The license whose quantity scales this grant. Required when scaling is per_license.
- `overdraft_limit` (double, optional, nullable) — Optional limit on how far the balance may go below zero, in credits. It is a floor on the balance rather than an allowance per invoice window: the balance may run down to minus this figure, and beyond it the flag check denies the same way an exhausted balance does with postpaid off. Nothing resets when an invoice window rolls, so a company that reaches the limit stays denied until a new grant lands or the negative balance is settled. Omit for no limit.
- `plan_version_id` (string, optional, nullable)
- `postpaid_enabled` (boolean, optional, nullable) — Whether consumption may continue past a zero balance. When false (the default) the flag check denies once the balance is exhausted, which is the existing behavior. When true, consumption continues and accrues at postpaid_rate_per_unit, settled on arrears_cadence. Intended for invoice-billed customers on net terms, who have no card for auto top-up to charge.
- `postpaid_rate_per_unit` (long, optional, nullable) — Amount charged per credit consumed past a zero balance, in the currency's minor unit. Optional: defaults to the credit's own cost basis (price_per_unit) when postpaid_enabled is true.
- `postpaid_rate_per_unit_decimal` (string, optional, nullable) — Decimal string form of postpaid_rate_per_unit, for rates finer than one minor unit (for example 0.0002). Takes precedence over postpaid_rate_per_unit when both are set, matching how the credit's own price_per_unit_decimal behaves.
- `price_tiers` (list of CreditGrantPriceTierRequestBody, optional, nullable) — Tier table pricing the credits on this grant, cheapest bound first, the last tier unbounded. Give this instead of unit_price to charge a rate that changes with the number of credits on the invoice. Requires tier_mode.
- `reset_type` (enum, optional, nullable)
  - Allowed values: `no_reset`, `plan_period`
- `rollover_percentage` (long, optional, nullable) — Percentage of unused credits that carry over when this grant resets. Only applies when reset_type is plan_period. Rolled-over credits expire at the next reset and are not rolled again. Defaults to 0.
- `scaling` (enum, optional, nullable) — Whether the grant is a fixed amount per company, or issued once per license the company holds. Defaults to fixed.
  - Allowed values: `fixed`, `per_license`
- `tier_mode` (enum, optional, nullable) — How price_tiers apply: volume prices every credit at the rate of the tier the total lands in, graduated prices each tier's own credits at its own rate. Required with price_tiers.
  - Allowed values: `graduated`, `volume`
- `unit_price` (long, optional, nullable) — Price per credit in the plan currency's smallest unit. Required when billing_mode is billed, unless unit_price_decimal or price_tiers is set.
- `unit_price_decimal` (string, optional, nullable) — Price per credit as a decimal in the plan currency's smallest unit, for prices below one cent.
- `can_buy_bundles` (boolean, optional, nullable, deprecated) — Deprecated: use compatible_plan_ids on credit bundles instead. Still accepted; writes through to the credit's bundle compatibility.

## Response

### 201

Created

- `data` (BillingPlanCreditGrantResponseData, required)
- `params` (BillingCreditsPlanGrantsPostResponsesContentApplicationJsonSchemaParams, 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

### CreditGrantPriceTierRequestBody

- `per_unit_price` (long, optional, nullable) — Price per credit in this tier, in the plan currency's smallest unit.
- `per_unit_price_decimal` (string, optional, nullable) — Price per credit in this tier as a decimal in the plan currency's smallest unit, for prices below one cent.
- `up_to` (long, optional, nullable) — Inclusive upper bound of this tier, counted in credits per invoice. Null marks the final, unbounded tier.

### BillingPlanCreditGrantResponseData

- `auto_topup_availability` (enum, required)
  - Allowed values: `off`, `automatic`, `user_controlled`
- `billing_mode` (enum, required) — Whether the credits are included in the plan price (granted) or billed as their own subscription line at a price per credit (billed).
  - Allowed values: `granted`, `billed`
- `company_credit_amount` (long, required) — Credits granted once per company on top of the per-license amount. Always 0 when scaling is fixed.
- `created_at` (datetime, required)
- `credit_amount` (long, required)
- `credit_id` (string, required)
- `id` (string, required)
- `plan_id` (string, required)
- `postpaid_enabled` (boolean, required) — Whether consumption may continue past a zero balance, accruing at postpaid_rate_per_unit rather than being denied.
- `price_tiers` (list of BillingPlanCreditGrantPriceTierResponseData, required) — Tier table pricing the credits, cheapest bound first. Empty unless billing_mode is billed and the credits are priced on tiers.
- `rollover_percentage` (long, required) — Percentage of unused credits that carry over when this grant resets. Only meaningful when reset_type is plan_period.
- `scaling` (enum, required) — Whether the grant is a fixed amount per company, or issued once per license the company holds.
  - Allowed values: `fixed`, `per_license`
- `updated_at` (datetime, required)
- `auto_topup_enabled` (boolean, required, deprecated) — Derived from auto_topup_availability; use that instead.
- `auto_topup_self_service` (boolean, required, deprecated) — Derived from auto_topup_availability; use that instead.
- `can_buy_bundles` (boolean, required, deprecated) — Deprecated: bundle availability is a per-bundle plan compatibility set now; use compatible_plan_ids on credit bundles instead.
- `credit_name` (string, required, deprecated) — Use credit.name from the nested credit object instead
- `plan_name` (string, required, deprecated) — Use plan.name from the nested plan object instead
- `arrears_anchor` (enum, optional, nullable) — Which boundary closes a monthly arrears window. Only meaningful when arrears_cadence is monthly.
  - Allowed values: `billing_period_start`, `month_end`
- `arrears_cadence` (enum, optional, nullable) — How often postpaid charges are closed and invoiced. Defaults to end_of_billing_period.
  - Allowed values: `end_of_billing_period`, `monthly`, `quarterly`
- `auto_topup_amount` (long, optional, nullable)
- `auto_topup_amount_type` (string, optional, nullable)
- `auto_topup_expiry_type` (enum, optional, nullable)
  - Allowed values: `duration`, `end_of_billing_period`, `end_of_next_billing_period`, `end_of_trial`, `no_expiry`
- `auto_topup_expiry_unit` (enum, optional, nullable)
  - Allowed values: `billing_periods`, `days`
- `auto_topup_expiry_unit_count` (long, optional, nullable)
- `auto_topup_threshold_credits` (long, optional, nullable)
- `auto_topup_threshold_percent` (long, optional, nullable)
- `credit` (BillingCreditResponseData, optional)
- `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)
- `license_id` (string, optional, nullable) — The license whose quantity scales this grant. Set only when scaling is per_license.
- `overdraft_limit` (double, optional, nullable) — Optional limit on how far the balance may go below zero, in credits. A floor on the balance, not an allowance per invoice window: consumption is denied once the balance would fall below minus this figure, and stays denied until a new grant lands or the negative balance is settled. Absent means no limit.
- `plan` (PreviewObjectResponseData, optional)
- `plan_version_id` (string, optional, nullable)
- `postpaid_rate_per_unit` (long, optional, nullable) — Amount charged per credit consumed past zero, in the currency's minor unit. Defaults to the credit's own cost basis when postpaid is enabled without one.
- `postpaid_rate_per_unit_decimal` (string, optional, nullable) — Decimal form of postpaid_rate_per_unit, for rates finer than one minor unit.
- `price` (BillingPriceResponseData, optional) — The Stripe price a billed grant bills through. Minted when the plan version is published.
- `reset_cadence` (enum, optional, nullable)
  - Allowed values: `daily`, `every_6_months`, `monthly`, `quarterly`, `weekly`, `yearly`
- `reset_start` (enum, optional, nullable)
  - Allowed values: `billing_period`, `first_of_month`
- `reset_type` (enum, optional, nullable)
  - Allowed values: `no_reset`, `plan_period`
- `tier_mode` (enum, optional, nullable) — How price_tiers apply: volume prices every credit at the rate of the tier the total lands in, graduated prices each tier's own credits at its own rate. Set only when price_tiers is non-empty.
  - Allowed values: `graduated`, `volume`
- `unit_price` (long, optional, nullable) — Price per credit in the plan currency's smallest unit. Set only when billing_mode is billed and the credits are priced at one rate.
- `unit_price_decimal` (string, optional, nullable) — Price per credit as a decimal in the plan currency's smallest unit. Set only when billing_mode is billed and the rate is below one cent.
- `credit_plural_name` (string, optional, nullable, deprecated) — Use plural_name from the nested credit object instead
- `credit_singular_name` (string, optional, nullable, deprecated) — Use singular_name from the nested credit object instead

### BillingCreditsPlanGrantsPostResponsesContentApplicationJsonSchemaParams

Input parameters

### BillingPlanCreditGrantPriceTierResponseData

- `from` (long, required) — Lower bound of the tier, in credits per invoice (inclusive).
- `per_unit_price` (long, optional, nullable) — Price per credit in this tier, in the plan currency's smallest unit.
- `per_unit_price_decimal` (string, optional, nullable) — Price per credit in this tier as a decimal, for rates below one cent.
- `to` (long, optional, nullable) — Upper bound of the tier, in credits per invoice (inclusive). Null marks the final, unbounded tier.

### BillingCreditResponseData

- `burn_strategy` (enum, required)
  - Allowed values: `expiration_priority`, `first_in_first_out`, `last_in_first_out`, `plan_first_then_credit_bundles_first_in_first_out`
- `cost_editable` (boolean, required)
- `created_at` (datetime, required)
- `currency_prices` (list of CreditCurrencyPriceResponseData, required)
- `default_expiry_unit` (enum, required)
  - Allowed values: `billing_periods`, `days`
- `default_rollover_policy` (enum, required)
  - Allowed values: `expire`, `none`, `rollover`
- `description` (string, required)
- `id` (string, required)
- `ledger_authority` (enum, required)
  - Allowed values: `schematic_authoritative`, `external_mirror`, `external_rated`
- `name` (string, required)
- `updated_at` (datetime, required)
- `default_expiry_unit_count` (long, optional, nullable)
- `icon` (string, optional, nullable)
- `plural_name` (string, optional, nullable)
- `price` (BillingPriceResponseData, optional)
- `product` (BillingProductResponseData, optional)
- `singular_name` (string, optional, nullable)

### PreviewObjectResponseData

- `id` (string, required)
- `name` (string, required)
- `description` (string, optional, nullable)
- `image_url` (string, optional, nullable)

### 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)

### CreditCurrencyPriceResponseData

- `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`
- `price` (BillingPriceResponseData, optional)

### BillingProductResponseData

- `account_id` (string, required)
- `created_at` (datetime, required)
- `environment_id` (string, required)
- `external_id` (string, required)
- `is_active` (boolean, required)
- `name` (string, required)
- `price` (double, required)
- `product_id` (string, required)
- `provider_type` (enum, required)
  - Allowed values: `metronome`, `orb`, `schematic`, `stripe`
- `quantity` (double, required)
- `updated_at` (datetime, required)
- `price_decimal` (string, optional, nullable)
- `currency` (string, optional, nullable, deprecated) — Deprecated; currencies are associated with prices, not products

## Examples

**Request**

```json
{
  "credit_amount": 1,
  "credit_id": "string",
  "plan_id": "string",
  "reset_cadence": "daily",
  "reset_start": "billing_period"
}
```

**Response**

```json
{
  "data": {
    "auto_topup_availability": "off",
    "billing_mode": "granted",
    "company_credit_amount": 1,
    "created_at": "2024-01-15T09:30:00Z",
    "credit_amount": 1,
    "credit_id": "string",
    "id": "string",
    "plan_id": "string",
    "postpaid_enabled": true,
    "price_tiers": [
      {
        "from": 1,
        "per_unit_price": 1,
        "per_unit_price_decimal": "string",
        "to": 1
      }
    ],
    "rollover_percentage": 1,
    "scaling": "fixed",
    "updated_at": "2024-01-15T09:30:00Z",
    "auto_topup_enabled": true,
    "auto_topup_self_service": true,
    "can_buy_bundles": true,
    "credit_name": "string",
    "plan_name": "string",
    "arrears_anchor": "billing_period_start",
    "arrears_cadence": "end_of_billing_period",
    "auto_topup_amount": 1,
    "auto_topup_amount_type": "string",
    "auto_topup_expiry_type": "duration",
    "auto_topup_expiry_unit": "billing_periods",
    "auto_topup_expiry_unit_count": 1,
    "auto_topup_threshold_credits": 1,
    "auto_topup_threshold_percent": 1,
    "credit": {
      "burn_strategy": "expiration_priority",
      "cost_editable": true,
      "created_at": "2024-01-15T09:30:00Z",
      "currency_prices": [
        {
          "currency": "aed",
          "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"
          }
        }
      ],
      "default_expiry_unit": "billing_periods",
      "default_rollover_policy": "expire",
      "description": "string",
      "id": "string",
      "ledger_authority": "schematic_authoritative",
      "name": "string",
      "updated_at": "2024-01-15T09:30:00Z",
      "default_expiry_unit_count": 1,
      "icon": "string",
      "plural_name": "string",
      "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"
      },
      "product": {
        "account_id": "string",
        "created_at": "2024-01-15T09:30:00Z",
        "environment_id": "string",
        "external_id": "string",
        "is_active": true,
        "name": "string",
        "price": 1.1,
        "product_id": "string",
        "provider_type": "metronome",
        "quantity": 1.1,
        "updated_at": "2024-01-15T09:30:00Z",
        "price_decimal": "string",
        "currency": "string"
      },
      "singular_name": "string"
    },
    "expiry_type": "duration",
    "expiry_unit": "billing_periods",
    "expiry_unit_count": 1,
    "license_id": "string",
    "overdraft_limit": 1.1,
    "plan": {
      "id": "string",
      "name": "string",
      "description": "string",
      "image_url": "string"
    },
    "plan_version_id": "string",
    "postpaid_rate_per_unit": 1,
    "postpaid_rate_per_unit_decimal": "string",
    "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"
    },
    "reset_cadence": "daily",
    "reset_start": "billing_period",
    "reset_type": "no_reset",
    "tier_mode": "graduated",
    "unit_price": 1,
    "unit_price_decimal": "string",
    "credit_plural_name": "string",
    "credit_singular_name": "string"
  },
  "params": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.schematichq.com/billing/credits/plan-grants"

payload = {
    "credit_amount": 1,
    "credit_id": "string",
    "plan_id": "string",
    "reset_cadence": "daily",
    "reset_start": "billing_period"
}
headers = {
    "X-Schematic-Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.schematichq.com/billing/credits/plan-grants';
const options = {
  method: 'POST',
  headers: {'X-Schematic-Api-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"credit_amount":1,"credit_id":"string","plan_id":"string","reset_cadence":"daily","reset_start":"billing_period"}'
};

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/plan-grants"

	payload := strings.NewReader("{\n  \"credit_amount\": 1,\n  \"credit_id\": \"string\",\n  \"plan_id\": \"string\",\n  \"reset_cadence\": \"daily\",\n  \"reset_start\": \"billing_period\"\n}")

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

	req.Header.Add("X-Schematic-Api-Key", "<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://api.schematichq.com/billing/credits/plan-grants")

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

request = Net::HTTP::Post.new(url)
request["X-Schematic-Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"credit_amount\": 1,\n  \"credit_id\": \"string\",\n  \"plan_id\": \"string\",\n  \"reset_cadence\": \"daily\",\n  \"reset_start\": \"billing_period\"\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://api.schematichq.com/billing/credits/plan-grants")
  .header("X-Schematic-Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"credit_amount\": 1,\n  \"credit_id\": \"string\",\n  \"plan_id\": \"string\",\n  \"reset_cadence\": \"daily\",\n  \"reset_start\": \"billing_period\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.schematichq.com/billing/credits/plan-grants', [
  'body' => '{
  "credit_amount": 1,
  "credit_id": "string",
  "plan_id": "string",
  "reset_cadence": "daily",
  "reset_start": "billing_period"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Schematic-Api-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.schematichq.com/billing/credits/plan-grants");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Schematic-Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"credit_amount\": 1,\n  \"credit_id\": \"string\",\n  \"plan_id\": \"string\",\n  \"reset_cadence\": \"daily\",\n  \"reset_start\": \"billing_period\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Schematic-Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "credit_amount": 1,
  "credit_id": "string",
  "plan_id": "string",
  "reset_cadence": "daily",
  "reset_start": "billing_period"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.schematichq.com/billing/credits/plan-grants")! 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()
```