Human routes: release, remit, suspend
The Human Verbs release, remit, suspend as api.sb routes, with inputs, result, refusals and an example.
Reference for Human, one group of Human routes.
Human.release
Release frees a held amount for payout once its Dispute closes or its clearance period ends. Verb page.
POST /{namespace}/ humans/ {human}/ releasePath: human. Body, as JSON: the other inputs. Emits Human.released.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
human | Human | required | The payee. |
cause | string | required | The Order or Dispute whose hold ends. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
human | Human | required | The payee, with the hold removed. |
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
curl -X POST https: //api.sb/ leaseline.app/ humans/ human_EeCsrv4AOW/ release \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"cause": "Example cause"}'{
"api": "https: //api.sb/ leaseline.app",
"human": {
"$id": "https: //api.sb/ leaseline.app/ humans/ human_EeCsrv4AOW",
"$type": "Human",
"name": "Dana Okafor",
"email": "dana@leaseline.app"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Human.release",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Human.remit
Remit pays a supplying Human’s earned balance to their bank account through the Startup’s payment account. Verb page.
POST /{namespace}/ humans/ {human}/ remitPath: human. Body, as JSON: the other inputs. Emits Human.remitted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
human | Human | required | The Human to pay. |
amount | money | The amount. Defaults to the full earned balance. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
transaction | Transaction | required | The payout Transaction. |
human | Human | required | The Human paid, with the balance now zero. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The operation is part of an Offer the caller has not accepted or paid for. | payment-required | Accept the Offer named in the response, then retry the call. | Offer.accept |
| 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
curl -X POST https: //api.sb/ leaseline.app/ humans/ human_EeCsrv4AOW/ remit \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"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"
}
},
"human": {
"$id": "https: //api.sb/ leaseline.app/ humans/ human_EeCsrv4AOW",
"$type": "Human",
"name": "Dana Okafor",
"email": "dana@leaseline.app"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Human.remit",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Human.suspend
Suspend stops a supplying Human from taking new Tasks while a Credential lapses or a dispute is open. Verb page.
POST /{namespace}/ humans/ {human}/ suspendPath: human. Body, as JSON: the other inputs. Emits Human.suspended.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
human | Human | required | The Human to suspend. |
reason | text | required | Why the Human stops. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
human | Human | required | The suspended Human. |
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. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
curl -X POST https: //api.sb/ leaseline.app/ humans/ human_EeCsrv4AOW/ suspend \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"reason": "Example reason"}'{
"api": "https: //api.sb/ leaseline.app",
"human": {
"$id": "https: //api.sb/ leaseline.app/ humans/ human_EeCsrv4AOW",
"$type": "Human",
"name": "Dana Okafor",
"email": "dana@leaseline.app"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Human.suspend",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}