Menu
Platform
AI
App store purchases
Credits
Database
Flags
Generated Assets
Jobs and cron
Localization
Monitoring
Notifications
Payments
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Credit grants
A Credit Grant is credit a merchant gives a subject: audited, append-only, invoiced at full price and then offset once at invoice issue,…
A Credit Grant is credit a merchant gives a subject: audited, append-only, invoiced at full price and then offset once at invoice issue, soonest expiry first. A change is a new grant that supersedes the old one.
Service Sylphx Money · Resource type money.sylphx.com/CreditGrant · Name pattern orgs/{org}/projects/{project}/envs/{env}/credit_grants/{credit_grant} · Shape record
#Fields
| Field | Type | What it is |
|---|---|---|
name | string | orgs/{org}/projects/{project}/envs/{env}/credit_grants/{credit_grant}. |
uid | string | cgrt_<cell><ulid>; never reused. Output only. |
meta | ResourceMeta | Resource metadata. |
subject | Subject | Who receives it. Required. |
kind | string | amount (a total) or monthly_cap (up to the amount in each month). Required. |
amount_minor | string | Minor units, a decimal string. Required. |
start_time | timestamp | When it starts applying. Required. |
expire_time | timestamp | When it stops applying; required. Not renewing is how charging starts. Required. |
approver | string | Who approved it. Required. |
reason | string | Why. Required. |
supersedes | string | The grant this one replaces. |
tax_treatment | string | undecided, price_reduction, or post_tax_settlement; no default. post_tax_settlement is refused while the merchant has automatic tax on. Required. |
collection_mode | string | standard or hold; no default. Over the credit, a held invoice stays due but is not collected until an explicit audited release. Required. |
#Methods
Every method of the collection, in the registry's order, with the scope it needs. The full request, response and examples are one link away.
| Method | Call | What it does |
|---|---|---|
POST | create | Gives a subject credit. Append-only: a change is a new grant that supersedes the old. Refused with INVALID_STATE (tax_treatment_unsupported) for post_tax_settlement while the merchant has automatic tax on. |
GET | get | Gets a credit grant. |
GET | list | Lists credit grants. |
#create
Gives a subject credit. Append-only: a change is a new grant that supersedes the old. Refused with INVALID_STATE (tax_treatment_unsupported) for post_tax_settlement while the merchant has automatic tax on.
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/credit_grants · scope billing:credits.approve · effect write · Request, response and examples
#get
Gets a credit grant.
GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/credit_grants/credit-grant · scope billing:read · effect read · Request, response and examples
#list
Lists credit grants.
GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/credit_grants · scope billing:read · effect read · paginated · Request, response and examples