Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Create a Provider business identity

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/providers

Requires platform administration. Creation grants no membership, qualification, offer or permission to resell supply. Atomically stores the trimmed name, optional description, website and logo URLs with an immutable creation audit. Optional profile fields default to empty strings. Saving URLs does not fetch them.

Operation: createProviderBusiness.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/providers" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

No path, query, or header parameters are declared.

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 100,
"description": "Nonblank after trimming; at most 100 UTF-8 bytes before trimming; no control characters. Saved value is trimmed."
},
"description": {
"type": "string",
"maxLength": 2000,
"description": "Optional business description, trimmed before saving. Newlines and tabs are allowed; other control characters are rejected."
},
"website_url": {
"type": "string",
"maxLength": 2048,
"description": "Optional HTTP or HTTPS website URL without embedded credentials. Trimmed before saving; empty string leaves the website unset."
},
"logo_url": {
"type": "string",
"maxLength": 2048,
"description": "Optional HTTP or HTTPS image URL without embedded credentials. Trimmed before saving; empty string uses the default logo."
}
}
}

Created identity

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"id",
"slug"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"slug": {
"type": "string",
"maxLength": 48,
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
"description": "Stable readable slug for product URLs. Renaming preserves it."
}
}
}
}
}

Invalid Provider name or profile metadata

Missing, expired or revoked administrative credential

Platform administration required

Malformed body or unknown field

Storage unavailable

Requires platform administration. Creation grants no membership, qualification, offer or permission to resell supply. Atomically stores the trimmed name, optional description, website and logo URLs with an immutable creation audit. Optional profile fields default to empty strings. Saving URLs does not fetch them.

Supported scope: implemented