Skip to content

Supplier routes: update, delete

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

Reference for Supplier, one group of Supplier routes.

Supplier.update

Changes the given properties of a Supplier. Verb page.

Text
PATCH /{namespace}/suppliers/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Supplier.
namestringThe legal or personal name.
payoutAccountstringWhere payouts land, held through Stripe.

Returns

OutputTypeRequiredDescription
supplierSupplierrequiredThe Supplier.

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/tutorloop.com/suppliers/supplier_QTsIMiLqO4 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"payoutAccount":"Example payout account"}'
JSON
{
  "api": "https://api.sb/tutorloop.com",
  "supplier": {
    "$id": "https://api.sb/tutorloop.com/suppliers/supplier_QTsIMiLqO4",
    "$type": "Supplier",
    "name": "TutorLoop",
    "status": "recruited",
    "payoutAccount": "Example payout account"
  },
  "action": {
    "$id": "https://api.sb/tutorloop.com/actions/act_DEVhiF6mF5",
    "operation": "Supplier.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/tutorloop.com/actions/act_DEVhiF6mF5"
  }
}

Supplier.delete

Deletes a Supplier: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/suppliers/{id}

Path: id. Emits Supplier.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Supplier.

Returns

OutputTypeRequiredDescription
supplierSupplierrequiredThe Supplier.

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 DELETE https://api.sb/tutorloop.com/suppliers/supplier_QTsIMiLqO4 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/tutorloop.com",
  "supplier": {
    "$id": "https://api.sb/tutorloop.com/suppliers/supplier_QTsIMiLqO4",
    "$type": "Supplier",
    "name": "TutorLoop",
    "status": "recruited"
  },
  "action": {
    "$id": "https://api.sb/tutorloop.com/actions/act_DEVhiF6mF5",
    "operation": "Supplier.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/tutorloop.com/actions/act_DEVhiF6mF5"
  }
}