Skip to content
Console
Menu

Generated Assets

Workflows

Getting Started

Authentication

KV Store

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

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/credit_grants/{credit_grant}.
uidstringcgrt_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
subjectSubjectWho receives it. Required.
kindstringamount (a total) or monthly_cap (up to the amount in each month). Required.
amount_minorstringMinor units, a decimal string. Required.
start_timetimestampWhen it starts applying. Required.
expire_timetimestampWhen it stops applying; required. Not renewing is how charging starts. Required.
approverstringWho approved it. Required.
reasonstringWhy. Required.
supersedesstringThe grant this one replaces.
tax_treatmentstringundecided, price_reduction, or post_tax_settlement; no default. post_tax_settlement is refused while the merchant has automatic tax on. Required.
collection_modestringstandard 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.

MethodCallWhat it does
POSTcreateGives 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.
GETgetGets a credit grant.
GETlistLists 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