Bill methods: approve, pay
The Bill Verbs approve, pay as typed SDK methods, with inputs, result, refusals and an example.
Reference for Bill, one group of Bill methods.
Bill.approve
Approve accepts a coded Bill for payment within the approver’s Mandate and schedules it for its due date. Verb page.
interface BillVerbs {
approve(input: BillApproveInput, options?: SB.CallOptions): SB.Call<Bill>
}Emits Bill.approved.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
bill | Bill | required | The coded Bill. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
bill | Bill | required | The approved Bill, scheduled for its due date. |
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. | None. |
Example
import { $ } from 'startup-builder'
const bill = await $.Bill.approve({ bill: 'bill_Zorj7Zkbtc' })Bill.pay
Pay sends an approved Bill’s amount to its Organization on the due date and reconciles the payment to Entries. Verb page.
interface BillVerbs {
pay(input: BillPayInput, options?: SB.CallOptions): SB.Call<BillPayOutput>
}Emits Bill.paid.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
bill | Bill | required | The approved Bill. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
transaction | Transaction | required | The payment Transaction. |
bill | Bill | required | The Bill, now paid. |
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. | None. |
Example
import { $ } from 'startup-builder'
const { transaction, bill } = await $.Bill.pay({ bill: 'bill_Zorj7Zkbtc' })