For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportDashboard
Getting StartedAPI ReferenceRoadmapBlog
Getting StartedAPI ReferenceRoadmapBlog
    • Resources
    • Authentication
    • Pagination
    • Rate limiting
  • API Keys
    • GETList api keys
    • GETGet api key
    • POSTCreate api key
    • PUTUpdate api key
    • DELDelete api key
  • Environments
    • POSTCreate environment
    • PUTUpdate environment
    • DELDelete environment
  • Plans
    • The Plan object
    • GETList plans
    • GETGet plan
    • POSTCreate plan
    • PUTUpdate plan
    • DELDelete plan
  • Companies
    • The Company object
    • GETList companies
    • POSTUpsert company
    • GETLookup company
    • DELDelete company
    • POSTDelete company by keys
    • GETList company memberships
    • POSTGet or create company membership
    • DELDelete company membership
    • POSTUpsert company trait
  • Users
    • The User object
    • GETList users
    • GETLookup user
    • POSTUpsert user
    • DELDelete user
    • POSTDelete user by keys
    • POSTUpsert user trait
  • Events
    • The Event object
    • GETList events
    • POSTCreate event
    • POSTCreate event batch
    • GETGet event
  • Features
    • The Feature object
    • GETList features
    • GETGet feature
    • POSTCreate feature
    • PUTUpdate feature
    • DELDelete feature
  • Flags
    • The Flag object
    • GETList flags
    • GETGet flag
    • POSTCreate flag
    • PUTUpdate flag
    • DELDelete flag
    • PUTUpdate flag rules
    • POSTCheck flag
    • POSTCheck flags
  • Entitlements
    • GETList company overrides
    • GETGet company override
    • POSTCreate company override
    • PUTUpdate company override
    • DELDelete company override
    • GETList plan entitlements
    • GETGet plan entitlement
    • POSTCreate plan entitlement
    • PUTUpdate plan entitlement
    • DELDelete plan entitlement
  • Feature Usage
    • GETList feature usage
  • Billing Credits
    • GETList credits
    • POSTCreate credit
    • GETGet credit
    • PUTUpdate credit
    • DELDelete credit
    • GETList credit bundles
    • POSTCreate credit bundle
    • GETGet credit bundle
    • PUTUpdate credit bundle
    • DELDelete credit bundle
    • POSTGrant credits to company
    • GETList company credit grants
    • GETList credit grants
    • PUTZero out credit grant
    • GETList plan credit grants
    • POSTCreate plan credit grant
    • DELDelete plan credit grant
    • GETGet credit ledger
  • Account Members
    • GETList account members
    • GETGet account member
LogoLogo
SupportDashboard
Billing Credits

Grant credits to company

POST
https://api.schematichq.com/billing/credits/grants/company
POST
/billing/credits/grants/company
1import { SchematicClient } from "@schematichq/schematic-typescript-node";
2
3async function main() {
4 const client = new SchematicClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.credits.grantBillingCreditsToCompany({
8 companyId: "comp_987654321",
9 creditId: "cred_123456789",
10 quantity: 10,
11 reason: "adjustment",
12 });
13}
14main();
1{
2 "data": {
3 "company_id": "comp_987654321",
4 "company_name": "Acme Corporation",
5 "created_at": "2024-01-15T09:30:00Z",
6 "credit_id": "cred_123456789",
7 "credit_name": "Standard Usage Credit",
8 "grant_reason": "adjustment",
9 "id": "grant_abc123xyz",
10 "quantity": 10,
11 "quantity_remaining": 7.5,
12 "quantity_used": 2.5,
13 "renewal_enabled": true,
14 "source_label": "Initial Grant",
15 "updated_at": "2024-02-01T12:00:00Z",
16 "credit_icon": "https://cdn.schematichq.com/icons/credit_adjustment.png",
17 "currency": "USD",
18 "expires_at": "2024-12-31T23:59:59Z",
19 "plan_id": "plan_premium_001",
20 "plan_name": "Premium Plan",
21 "price": {
22 "currency": "USD",
23 "external_price_id": "price_789xyz",
24 "id": "price_001",
25 "interval": "month",
26 "interval_count": 1,
27 "price": 4999,
28 "provider_type": "metronome",
29 "scheme": "per_unit",
30 "nickname": "Monthly Premium Price",
31 "price_decimal": "49.99"
32 },
33 "renewal_period": "monthly",
34 "reserved": 0,
35 "settled": 2.5,
36 "source_grant_id": "grant_xyz789abc",
37 "transfers": [
38 {
39 "amount": 2.5,
40 "created_at": "2024-01-20T10:00:00Z",
41 "direction": "outbound",
42 "id": "transfer_001",
43 "reason": "usage deduction",
44 "related_grant_id": "grant_abc123xyz"
45 }
46 ],
47 "valid_from": "2024-01-15T09:30:00Z",
48 "zeroed_out_date": "2024-12-31T23:59:59Z",
49 "zeroed_out_reason": "expired"
50 },
51 "params": {}
52}
Was this page helpful?
Previous

List company credit grants

Next
Built with

Authentication

X-Schematic-Api-Keystring
API Key authentication via header

Request

This endpoint expects an object.
company_idstringRequired
credit_idstringRequired
quantitylongRequired>=1
reasonenumRequired
billing_periods_countlong or nullOptional>=1
currencystring or nullOptional<=3 characters
expires_atdatetime or nullOptional
expiry_typeenum or nullOptional
Allowed values:
expiry_unitenum or nullOptional
Allowed values:
expiry_unit_countlong or nullOptional>=1
renewal_enabledboolean or nullOptional
renewal_periodenum or nullOptional
Allowed values:

Response

Created
dataobject
paramsobject
Input parameters

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error