Skip to content

SchematicHQ/schematic-php

Repository files navigation

schematic-php

Schematic API

For more information, please visit https://schematichq.com.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Installation

You can install the Schematic PHP SDK via Composer. Run the following command in your project directory:

composer require schematichq/schematic-php

Usage

To initialize the Schematic client, provide a secret API key; you can issue an API key in the API Keys section of settings in the Schematic web app.

<?php

require_once 'vendor/autoload.php';

use Schematic\Schematic;

$schematic = new Schematic('YOUR_SECRET_API_KEY');

Once you have initialized the Schematic client, you can make API calls using the various API classes provided by the SDK.

$companies = $schematic->CompaniesApi->listCompanies();

The SDK throws exceptions in case of API errors. You can catch and handle these exceptions in your code:

try {
    $companies = $schematic->CompaniesApi->listCompanies();
    // Process the companies
} catch (\Exception $e) {
    // Handle the exception
    echo 'Error: ' . $e->getMessage();
}

API Endpoints

The following Schematic API endpoints are accessible via this client library. All URIs are relative to https://api.schematichq.com

Class Method HTTP request Description
AccesstokensApi issueTemporaryAccessToken POST /temporary-access-tokens Issue temporary access token
AccountsApi countAccountMembers GET /account-members/count Count account members
AccountsApi countApiKeys GET /api-keys/count Count api keys
AccountsApi countAuditLogs GET /audit-log/count Count audit logs
AccountsApi createApiKey POST /api-keys Create api key
AccountsApi createEnvironment POST /environments Create environment
AccountsApi deleteApiKey DELETE /api-keys/{api_key_id} Delete api key
AccountsApi deleteEnvironment DELETE /environments/{environment_id} Delete environment
AccountsApi getAccountMember GET /account-members/{account_member_id} Get account member
AccountsApi getApiKey GET /api-keys/{api_key_id} Get api key
AccountsApi getAuditLog GET /audit-log/{audit_log_id} Get audit log
AccountsApi getEnvironment GET /environments/{environment_id} Get environment
AccountsApi getWhoAmI GET /whoami Get who am I
AccountsApi listAccountMembers GET /account-members List account members
AccountsApi listApiKeys GET /api-keys List api keys
AccountsApi listAuditLogs GET /audit-log List audit logs
AccountsApi listEnvironments GET /environments List environments
AccountsApi quickstart POST /quickstart Quickstart
AccountsApi updateApiKey PUT /api-keys/{api_key_id} Update api key
AccountsApi updateEnvironment PUT /environments/{environment_id} Update environment
BillingApi countBillingProducts GET /billing/products/count Count billing products
BillingApi countCustomers GET /billing/customers/count Count customers
BillingApi deleteBillingCoupon DELETE /billing/coupons/{billing_id} Delete billing coupon
BillingApi deleteBillingCustomer DELETE /billing/customer/{billing_id} Delete billing customer
BillingApi deleteBillingInvoice DELETE /billing/invoices/{billing_id} Delete billing invoice
BillingApi deleteBillingProduct DELETE /billing/product/{billing_id} Delete billing product
BillingApi deletePaymentMethodByExternalID DELETE /billing/payment-methods/{billing_id} Delete payment method by external ID
BillingApi deleteProductPrice DELETE /billing/product/prices/{billing_id} Delete product price
BillingApi listBillingPrices GET /billing/price List billing prices
BillingApi listBillingProductPrices GET /billing/product/prices List billing product prices
BillingApi listBillingProducts GET /billing/products List billing products
BillingApi listCoupons GET /billing/coupons List coupons
BillingApi listCustomersWithSubscriptions GET /billing/customers List customers with subscriptions
BillingApi listInvoices GET /billing/invoices List invoices
BillingApi listMeters GET /billing/meter List meters
BillingApi listPaymentMethods GET /billing/payment-methods List payment methods
BillingApi upsertBillingCoupon POST /billing/coupons Upsert billing coupon
BillingApi upsertBillingCustomer POST /billing/customer/upsert Upsert billing customer
BillingApi upsertBillingMeter POST /billing/meter/upsert Upsert billing meter
BillingApi upsertBillingPrice POST /billing/price/upsert Upsert billing price
BillingApi upsertBillingProduct POST /billing/product/upsert Upsert billing product
BillingApi upsertBillingSubscription POST /billing/subscription/upsert Upsert billing subscription
BillingApi upsertInvoice POST /billing/invoices Upsert invoice
BillingApi upsertPaymentMethod POST /billing/payment-methods Upsert payment method
CatalogsApi addCreditBundle POST /catalogs/{catalog_id}/credit-bundles/{credit_bundle_id} Add credit bundle
CatalogsApi addPlan POST /catalogs/{catalog_id}/plans/{plan_id} Add plan
CatalogsApi createCatalog POST /catalogs Create catalog
CatalogsApi deleteCatalog DELETE /catalogs/{catalog_id} Delete catalog
CatalogsApi getCatalog GET /catalogs/{catalog_id} Get catalog
CatalogsApi getConfiguration GET /catalogs/{catalog_id}/configuration Get configuration
CatalogsApi getCreditBundlesInCatalog GET /catalogs/{catalog_id}/credit-bundles Get credit bundles in catalog
CatalogsApi getDerivedFeatures GET /catalogs/{catalog_id}/features Get derived features
CatalogsApi getPlansInCatalog GET /catalogs/{catalog_id}/plans Get plans in catalog
CatalogsApi listCatalogs GET /catalogs List catalogs
CatalogsApi removeCreditBundle DELETE /catalogs/{catalog_id}/credit-bundles/{credit_bundle_id} Remove credit bundle
CatalogsApi removePlan DELETE /catalogs/{catalog_id}/plans/{plan_id} Remove plan
CatalogsApi updateCatalog PUT /catalogs/{catalog_id} Update catalog
CatalogsApi updateConfiguration PUT /catalogs/{catalog_id}/configuration Update configuration
CheckoutApi cancelSubscription POST /manage-plan/subscription/cancel Cancel subscription
CheckoutApi checkoutInternal POST /checkout-internal Checkout internal
CheckoutApi getCheckoutData POST /checkout-internal/data Get checkout data
CheckoutApi getCompanyBillingDetails GET /companies/{company_id}/billing-details Get company billing details
CheckoutApi managePlan POST /manage-plan Manage plan
CheckoutApi previewCheckoutInternal POST /checkout-internal/preview Preview checkout internal
CheckoutApi previewManagePlan POST /manage-plan/preview Preview manage plan
CheckoutApi updateCompanyBillingDetails PUT /companies/{company_id}/billing-details Update company billing details
CheckoutApi updateCustomerSubscriptionTrialEnd PUT /subscription/{subscription_id}/edit-trial-end Update customer subscription trial end
CompaniesApi countCompanies GET /companies/count Count companies
CompaniesApi countEntityKeyDefinitions GET /entity-key-definitions/count Count entity key definitions
CompaniesApi countEntityTraitDefinitions GET /entity-trait-definitions/count Count entity trait definitions
CompaniesApi countPlanTraits GET /plan-traits/count Count plan traits
CompaniesApi countUsers GET /users/count Count users
CompaniesApi createCompany POST /companies/create Create company
CompaniesApi createUser POST /users/create Create user
CompaniesApi deleteCompany DELETE /companies/{company_id} Delete company
CompaniesApi deleteCompanyByKeys POST /companies/delete Delete company by keys
CompaniesApi deleteCompanyMembership DELETE /company-memberships/{company_membership_id} Delete company membership
CompaniesApi deleteUser DELETE /users/{user_id} Delete user
CompaniesApi deleteUserByKeys POST /users/delete Delete user by keys
CompaniesApi getActiveCompanySubscription GET /company-subscriptions Get active company subscription
CompaniesApi getBillingEntityChildSubscriptions GET /company-billing-entity-subscriptions Get billing entity child subscriptions
CompaniesApi getCompany GET /companies/{company_id} Get company
CompaniesApi getCompanyBillingEntity GET /company-billing-entity Get company billing entity
CompaniesApi getEntityTraitDefinition GET /entity-trait-definitions/{entity_trait_definition_id} Get entity trait definition
CompaniesApi getEntityTraitValues GET /entity-trait-values Get entity trait values
CompaniesApi getOrCreateCompanyMembership POST /company-memberships Get or create company membership
CompaniesApi getOrCreateEntityTraitDefinition POST /entity-trait-definitions Get or create entity trait definition
CompaniesApi getPlanChange GET /plan-changes/{plan_change_id} Get plan change
CompaniesApi getPlanTrait GET /plan-traits/{plan_trait_id} Get plan trait
CompaniesApi getUser GET /users/{user_id} Get user
CompaniesApi listCompanies GET /companies List companies
CompaniesApi listCompanyMemberships GET /company-memberships List company memberships
CompaniesApi listEntityKeyDefinitions GET /entity-key-definitions List entity key definitions
CompaniesApi listEntityTraitDefinitions GET /entity-trait-definitions List entity trait definitions
CompaniesApi listPlanChanges GET /plan-changes List plan changes
CompaniesApi listPlanTraits GET /plan-traits List plan traits
CompaniesApi listUsers GET /users List users
CompaniesApi lookupCompany GET /companies/lookup Lookup company
CompaniesApi lookupUser GET /users/lookup Lookup user
CompaniesApi updateEntityTraitDefinition PUT /entity-trait-definitions/{entity_trait_definition_id} Update entity trait definition
CompaniesApi updatePlanTraitsBulk POST /plan-traits/bulk Update plan traits bulk
CompaniesApi upsertCompany POST /companies Upsert company
CompaniesApi upsertCompanyTrait POST /company-traits Upsert company trait
CompaniesApi upsertUser POST /users Upsert user
CompaniesApi upsertUserTrait POST /user-traits Upsert user trait
ComponentsApi bindCatalog PUT /components/{component_id}/catalog Bind catalog
ComponentsApi countComponents GET /components/count Count components
ComponentsApi createComponent POST /components Create component
ComponentsApi deleteComponent DELETE /components/{component_id} Delete component
ComponentsApi getComponent GET /components/{component_id} Get component
ComponentsApi listComponents GET /components List components
ComponentsApi previewComponentData GET /components/preview-data Preview component data
ComponentsApi updateComponent PUT /components/{component_id} Update component
ComponentspublicApi getPublicPlans GET /public/plans Get public plans
CreditsApi acquireCreditLease POST /billing/credits/lease Acquire credit lease
CreditsApi countBillingCredits GET /billing/credits/count Count billing credits
CreditsApi countBillingCreditsGrants GET /billing/credits/grants/count Count billing credits grants
CreditsApi countBillingPlanCreditGrants GET /billing/credits/plan-grants/count Count billing plan credit grants
CreditsApi countCompanyGrants GET /billing/credits/grants/company/count Count company grants
CreditsApi countCreditBundles GET /billing/credits/bundles/count Count credit bundles
CreditsApi countCreditEventLedger GET /v2/billing/credits/ledger/count Count credit event ledger
CreditsApi createBillingCredit POST /billing/credits Create billing credit
CreditsApi createBillingPlanCreditGrant POST /billing/credits/plan-grants Create billing plan credit grant
CreditsApi createCreditBundle POST /billing/credits/bundles Create credit bundle
CreditsApi deleteBillingPlanCreditGrant DELETE /billing/credits/plan-grants/{plan_grant_id} Delete billing plan credit grant
CreditsApi deleteCreditBundle DELETE /billing/credits/bundles/{bundle_id} Delete credit bundle
CreditsApi extendCreditLease PUT /billing/credits/lease/{lease_id}/extend Extend credit lease
CreditsApi getCreditBundle GET /billing/credits/bundles/{bundle_id} Get credit bundle
CreditsApi getSingleBillingCredit GET /billing/credits/{credit_id} Get single billing credit
CreditsApi getSingleBillingPlanCreditGrant GET /billing/credits/plan-grants/{plan_grant_id} Get single billing plan credit grant
CreditsApi grantBillingCreditsToCompany POST /billing/credits/grants/company Grant billing credits to company
CreditsApi listBillingCredits GET /billing/credits List billing credits
CreditsApi listBillingPlanCreditGrants GET /billing/credits/plan-grants List billing plan credit grants
CreditsApi listCompanyCreditBalances GET /billing/credits/balance List company credit balances
CreditsApi listCompanyGrants GET /billing/credits/grants/company/list List company grants
CreditsApi listCreditBundles GET /billing/credits/bundles List credit bundles
CreditsApi listCreditEventLedger GET /v2/billing/credits/ledger List credit event ledger
CreditsApi listGrantsForCredit GET /billing/credits/grants/list List grants for credit
CreditsApi releaseCreditLease PUT /billing/credits/lease/{lease_id}/release Release credit lease
CreditsApi softDeleteBillingCredit DELETE /billing/credits/{credit_id} Soft delete billing credit
CreditsApi updateBillingCredit PUT /billing/credits/{credit_id} Update billing credit
CreditsApi updateBillingPlanCreditGrant PUT /billing/credits/plan-grants/{plan_grant_id} Update billing plan credit grant
CreditsApi updateCreditBundleDetails PUT /billing/credits/bundles/{bundle_id} Update credit bundle details
CreditsApi zeroOutGrant PUT /billing/credits/grants/{grant_id}/zero-out Zero out grant
DataexportsApi createDataExport POST /data-exports Create data export
DataexportsApi getDataExport GET /data-exports/{data_export_id} Get data export
DataexportsApi getDataExportArtifact GET /data-exports/{data_export_id}/artifact Get data export artifact
DataexportsApi listDataExports GET /data-exports List data exports
EntitlementsApi countCompanyOverrides GET /company-overrides/count Count company overrides
EntitlementsApi countFeatureCompanies GET /feature-companies/count Count feature companies
EntitlementsApi countFeatureUsage GET /feature-usage/count Count feature usage
EntitlementsApi countFeatureUsers GET /feature-users/count Count feature users
EntitlementsApi countPlanEntitlements GET /plan-entitlements/count Count plan entitlements
EntitlementsApi createCompanyOverride POST /company-overrides Create company override
EntitlementsApi createPlanEntitlement POST /plan-entitlements Create plan entitlement
EntitlementsApi deleteCompanyOverride DELETE /company-overrides/{company_override_id} Delete company override
EntitlementsApi deletePlanEntitlement DELETE /plan-entitlements/{plan_entitlement_id} Delete plan entitlement
EntitlementsApi duplicatePlanEntitlements POST /plan-entitlements/duplicate Duplicate plan entitlements
EntitlementsApi getCompanyOverride GET /company-overrides/{company_override_id} Get company override
EntitlementsApi getFeatureUsageByCompany GET /usage-by-company Get feature usage by company
EntitlementsApi getFeatureUsageTimeSeries GET /feature-usage-timeseries Get feature usage time series
EntitlementsApi getPlanEntitlement GET /plan-entitlements/{plan_entitlement_id} Get plan entitlement
EntitlementsApi listCompanyOverrides GET /company-overrides List company overrides
EntitlementsApi listFeatureCompanies GET /feature-companies List feature companies
EntitlementsApi listFeatureUsage GET /feature-usage List feature usage
EntitlementsApi listFeatureUsers GET /feature-users List feature users
EntitlementsApi listPlanEntitlements GET /plan-entitlements List plan entitlements
EntitlementsApi updateCompanyOverride PUT /company-overrides/{company_override_id} Update company override
EntitlementsApi updatePlanEntitlement PUT /plan-entitlements/{plan_entitlement_id} Update plan entitlement
EntitlementsApi upsertPlanEntitlementForBillingProduct POST /plan-entitlements/billing-linked Upsert plan entitlement for billing product
EventsApi createEvent POST /events Create event
EventsApi createEventBatch POST /event-batch Create event batch
EventsApi getEvent GET /events/{event_id} Get event
EventsApi getEventSummaries GET /event-types Get event summaries
EventsApi getSegmentIntegrationStatus GET /segment-integration Get segment integration status
EventsApi listEvents GET /events List events
FeaturesApi checkFlag POST /flags/{key}/check Check flag
FeaturesApi checkFlags POST /flags/check Check flags
FeaturesApi checkFlagsBulk POST /flags/check-bulk Check flags bulk
FeaturesApi countFeatures GET /features/count Count features
FeaturesApi countFlags GET /flags/count Count flags
FeaturesApi createFeature POST /features Create feature
FeaturesApi createFlag POST /flags Create flag
FeaturesApi deleteFeature DELETE /features/{feature_id} Delete feature
FeaturesApi deleteFlag DELETE /flags/{flag_id} Delete flag
FeaturesApi getFeature GET /features/{feature_id} Get feature
FeaturesApi getFlag GET /flags/{flag_id} Get flag
FeaturesApi listFeatures GET /features List features
FeaturesApi listFlags GET /flags List flags
FeaturesApi updateFeature PUT /features/{feature_id} Update feature
FeaturesApi updateFlag PUT /flags/{flag_id} Update flag
FeaturesApi updateFlagRules PUT /flags/{flag_id}/rules Update flag rules
FeaturesApi upsertFeatureForBillingProduct POST /features/billing-linked Upsert feature for billing product
InsightsApi getActivity GET /insights/activity Get activity
InsightsApi getEnvironmentFeatureUsageTimeSeries GET /insights/feature-usage-timeseries Get environment feature usage time series
InsightsApi getEnvironmentTraitUsageTimeSeries GET /insights/trait-usage-timeseries Get environment trait usage time series
InsightsApi getPlanGrowth GET /insights/plan-growth Get plan growth
InsightsApi getSummary GET /insights/summary Get summary
InsightsApi getTopFeaturesByUsage GET /insights/top-features Get top features by usage
IntegrationsapiApi assumeStripeInstalled POST /integrations/stripe/v2/assume-installed Assume stripe installed
IntegrationsapiApi getIntegrationWebhookUrl GET /integrations/{type}/webhook-url Get integration webhook url
IntegrationsapiApi installIntegration POST /integrations/install Install integration
IntegrationsapiApi installStripe POST /integrations/stripe/v2/install Install stripe
IntegrationsapiApi listIntegrations GET /integrations List integrations
IntegrationsapiApi loadSampleDataSet GET /integrations/stripe/dataset-sample-v2 Load sample data set
IntegrationsapiApi runIntegration GET /integration/start/{integration_id} Run integration
IntegrationsapiApi startDataImport POST /integrations/start-data-import Start data import
IntegrationsapiApi uninstallIntegration DELETE /integrations/uninstall/{integration_id} Uninstall integration
PlanbundleApi createCustomPlanBundle POST /custom-plan-bundles Create custom plan bundle
PlanbundleApi createPlanBundle POST /plan-bundles Create plan bundle
PlanbundleApi updatePlanBundle PUT /plan-bundles/{plan_bundle_id} Update plan bundle
PlangroupsApi createPlanGroup POST /plan-groups Create plan group
PlangroupsApi getPlanGroup GET /plan-groups Get plan group
PlangroupsApi updatePlanGroup PUT /plan-groups/{plan_group_id} Update plan group
PlanmigrationsApi countCompanyMigrations GET /plan-version-company-migrations/count Count company migrations
PlanmigrationsApi countMigrations GET /plan-version-migrations/count Count migrations
PlanmigrationsApi createMigration POST /plan-version-migrations Create migration
PlanmigrationsApi getMigration GET /plan-version-migrations/{plan_version_migration_id} Get migration
PlanmigrationsApi listCompanyMigrations GET /plan-version-company-migrations List company migrations
PlanmigrationsApi listMigrations GET /plan-version-migrations List migrations
PlanmigrationsApi previewMigration POST /plan-version-migrations/preview Preview migration
PlanmigrationsApi retryCompanyMigration POST /plan-version-company-migrations/{plan_version_company_migration_id}/retry Retry company migration
PlanmigrationsApi retryMigration POST /plan-version-migrations/{plan_version_migration_id}/retry Retry migration
PlansApi countBillingProductMatchCompanies GET /plans/billing-product-match-companies/count Count billing product match companies
PlansApi countPlans GET /plans/count Count plans
PlansApi createCustomPlan POST /custom-plans Create custom plan
PlansApi createPlan POST /plans Create plan
PlansApi deletePlan DELETE /plans/{plan_id} Delete plan
PlansApi deletePlanVersion DELETE /plans/version/{plan_id} Delete plan version
PlansApi getPlan GET /plans/{plan_id} Get plan
PlansApi listBillingProductMatchCompanies GET /plans/billing-product-match-companies List billing product match companies
PlansApi listCustomPlanBillings GET /custom-plan-billings List custom plan billings
PlansApi listPlanIssues GET /plans/issues List plan issues
PlansApi listPlans GET /plans List plans
PlansApi markCustomPlanBillingPaid PUT /custom-plan-billings/{custom_plan_billing_id}/mark-paid Mark custom plan billing paid
PlansApi publishPlanVersion PUT /plans/version/{plan_id}/publish Publish plan version
PlansApi retryCustomPlanBilling PUT /custom-plan-billings/{custom_plan_billing_id}/retry Retry custom plan billing
PlansApi updateCompanyPlans PUT /company-plans/{company_plan_id} Update company plans
PlansApi updatePlan PUT /plans/{plan_id} Update plan
PlansApi upsertBillingProductPlan PUT /plans/{plan_id}/billing_products Upsert billing product plan
PlansApi upsertPlanForBillingProduct POST /plans/billing-linked Upsert plan for billing product
ScheduledcheckoutApi createScheduledCheckout POST /scheduled-checkout Create scheduled checkout
ScheduledcheckoutApi getScheduledCheckout GET /scheduled-checkout/{scheduled_checkout_id} Get scheduled checkout
ScheduledcheckoutApi listScheduledCheckouts GET /scheduled-checkout List scheduled checkouts
ScheduledcheckoutApi updateScheduledCheckout PUT /scheduled-checkout/{scheduled_checkout_id} Update scheduled checkout
WebhooksApi countWebhookEvents GET /webhook-events/count Count webhook events
WebhooksApi countWebhooks GET /webhooks/count Count webhooks
WebhooksApi createWebhook POST /webhooks Create webhook
WebhooksApi deleteWebhook DELETE /webhooks/{webhook_id} Delete webhook
WebhooksApi getWebhook GET /webhooks/{webhook_id} Get webhook
WebhooksApi getWebhookEvent GET /webhook-events/{webhook_event_id} Get webhook event
WebhooksApi listWebhookEvents GET /webhook-events List webhook events
WebhooksApi listWebhooks GET /webhooks List webhooks
WebhooksApi sendTestWebhookAction POST /webhooks/{webhook_id}/test Send test webhook action
WebhooksApi updateWebhook PUT /webhooks/{webhook_id} Update webhook

Models

Author

engineering@schematichq.com

Support

If you encounter any issues or have questions regarding the Schematic PHP SDK, please contact our support team at support@schematic.com.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages