Skip to content

Commission routes: update

The Commission Verbs update as api.sb routes, with inputs, result, refusals and an example.

Reference for Commission, one group of Commission routes.

Commission.update

Changes the given properties of a Commission. Verb page.

Text
PATCH /{namespace}/commissions/{id}

Path: id. Body, as JSON: the other inputs. Emits Commission.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Commission.
ratenumberThe share of collected revenue earned, as a percent, such as 20. Never randomized.
termintegerMonths after the first payment over which revenue earns the rate, such as 12. Never randomized.
clawbackDaysintegerDays a payment waits before it earns, so a refund inside the window earns nothing.

Returns

OutputTypeRequiredDescription
commissionCommissionrequiredThe Commission.

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 PATCH https://api.sb/leaseline.app/commissions/commission_oYhMioUeCH \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rate":1}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "commission": {
    "$id": "https://api.sb/leaseline.app/commissions/commission_oYhMioUeCH",
    "$type": "Commission",
    "rate": 1,
    "term": 1,
    "clawbackDays": 1
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Commission.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}