Delete Supplier
This endpoint soft-deletes a supplier. The record is marked as deleted but is not removed.
Endpoint
Section titled “Endpoint”DELETE /v1/suppliers/suppliers/:idAuthentication
Section titled “Authentication”Include your API key in the x-api-key header. See Authentication.
Required Scope
Section titled “Required Scope”suppliers:writePath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Supplier ID. |
Request Body
Section titled “Request Body”This endpoint does not accept a request body.
Example Request
Section titled “Example Request”curl -X DELETE "https://api.crewsum.com/v1/suppliers/suppliers/supplier-stu123vwx4567890" \ -H "x-api-key: $CREWSUM_API_KEY"const response = await fetch( "https://api.crewsum.com/v1/suppliers/suppliers/supplier-stu123vwx4567890", { method: "DELETE", headers: { "x-api-key": process.env.CREWSUM_API_KEY }, },);const result = await response.json();DELETE /v1/suppliers/suppliers/supplier-stu123vwx4567890 HTTP/1.1Host: api.crewsum.comx-api-key: <your-api-key>Response
Section titled “Response”On success, the API returns HTTP 200 OK.
Example Response
Section titled “Example Response”{ "message": "Successfully deleted supplier supplier-stu123vwx4567890"}Behavior
Section titled “Behavior”- This is a soft delete. The API sets
isDeletedtotrueand keeps the record. - Deleted suppliers no longer appear in List Suppliers. Get Supplier still returns them, with
"isDeleted": true. - The supplier’s contacts are not deleted.
- The API cannot undo a delete.
- An unknown ID still returns
200, and no webhook is sent. - After an existing supplier is deleted, Crewsum sends the
suppliers.deletedwebhook event. The payload is{ "suppliers": [<supplier>] }, with"isDeleted": true.
Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
400 | The ID path segment was empty (for example, a trailing slash). Message: SupplierID not supplied. |
500 | Crewsum could not delete the supplier. Message: Error deleting supplier <id>. |
Authentication and scope failures are described in Errors.
Related Webhooks
Section titled “Related Webhooks” suppliers.deleted View webhook event details.