Skip to content

Bill routes: approve, pay

The Bill Verbs approve, pay as api.sb routes, with inputs, result, refusals and an example.

Reference for Bill, one group of Bill routes.

Bill.approve

Approve accepts a coded Bill for payment within the approver’s Mandate and schedules it for its due date. Verb page.

Text
POST /{namespace}/bills/{bill}/approve

Path: bill. Emits Bill.approved.

Inputs

InputTypeRequiredDescription
billBillrequiredThe coded Bill.

Returns

OutputTypeRequiredDescription
billBillrequiredThe approved Bill, scheduled for its due date.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/bills/bill_Zorj7Zkbtc/approve \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "bill": {
    "$id": "https://api.sb/leaseline.app/bills/bill_Zorj7Zkbtc",
    "$type": "Bill",
    "organization": "organization_v0SkRLrXCN",
    "amount": {
      "amount": 29,
      "currency": "USD"
    },
    "dueOn": "2026-10-22",
    "status": "received"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Bill.approve",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Bill.pay

Pay sends an approved Bill’s amount to its Organization on the due date and reconciles the payment to Entries. Verb page.

Text
POST /{namespace}/bills/{bill}/pay

Path: bill. Emits Bill.paid.

Inputs

InputTypeRequiredDescription
billBillrequiredThe approved Bill.

Returns

OutputTypeRequiredDescription
transactionTransactionrequiredThe payment Transaction.
billBillrequiredThe Bill, now paid.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X POST https://api.sb/leaseline.app/bills/bill_Zorj7Zkbtc/pay \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "transaction": {
    "$id": "https://api.sb/leaseline.app/transactions/txn_XoxtZe3CQI",
    "$type": "Transaction",
    "kind": "charge",
    "amount": {
      "amount": 29,
      "currency": "USD"
    }
  },
  "bill": {
    "$id": "https://api.sb/leaseline.app/bills/bill_Zorj7Zkbtc",
    "$type": "Bill",
    "organization": "organization_v0SkRLrXCN",
    "amount": {
      "amount": 29,
      "currency": "USD"
    },
    "dueOn": "2026-10-22",
    "status": "received"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Bill.pay",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}