CreditGrant .apply
POST /{namespace}/credit-grants/apply
Apply spends Credit Grants against a finalizing Invoice, promotional first, then by priority and earliest expiry, and settles them through Stripe credit grants.
- Noun
- Credit Grant
- Mode
do- Event
CreditGrant.applied
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
invoice | Invoice | required | The Invoice being finalized. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
applied | money | required | The total the grants paid toward the Invoice. |
creditGrants | list of Credit Grant | required | Each grant drawn, with its new remaining balance. |
Effects
- Emits
CreditGrant.applied. - Performed by the Billing Specialist.
- Two-way: it runs at once, in the
try,sendanddomodes. - Pays only metered lines of the Startup’s own Offers; credits are never cash and never transfer.
- At zero balance, the Offer’s
atBoundbehavior applies: stop, overage through the Meter, or upgrade.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | CreditGrant.apply |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, nothing at stake |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |