Skip to content

Create Supplier

This endpoint creates a supplier and returns the generated supplier ID.

POST /v1/suppliers/suppliers

Include your API key in the x-api-key header. See Authentication.

suppliers:write
FieldTypeRequiredDescription
namestringYesSupplier name. If it is missing, the API returns 500.
descriptionstringNoSupplier description. Stored as null when omitted.
{
"name": "Supplier Name",
"description": "A brief description of the supplier"
}
Terminal window
curl -X POST "https://api.crewsum.com/v1/suppliers/suppliers" \
-H "x-api-key: $CREWSUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Supplier Name",
"description": "A brief description of the supplier"
}'

On success, the API returns HTTP 201 Created.

{
"message": "Successfully created supplier: supplier-stu123vwx4567890",
"data": {
"supplierId": "supplier-stu123vwx4567890"
}
}
  • The API generates the supplier ID in the format supplier-<16 hex characters>.
  • New suppliers are active (isArchived: false) and have updatedAt: null.
  • The request body is not validated against a schema. Wrong types are stored as sent or cause a 500.
  • After the supplier is created, Crewsum sends the suppliers.created webhook event. The payload is { "suppliers": [<supplier>] }.
StatusMeaning
500Crewsum could not create the supplier, for example because name was missing. Message: Error creating supplier. If no request body is sent, the API returns a 500 with a generic error body instead.

Authentication and scope failures are described in Errors.