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

Enroll a workspace model in a platform selling price

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

POST /api/v1/organizations/{organization}/projects/{project}/billing/retail-price-enrollment

Explicit platform administration required. price_id chooses a published text identity with the same model and an existing company/currency balance account; no account, credit, funds, Provider qualification or selling permission is created. Explicit null restores legacy workspace tariff selection for future operations. expected_version zero creates the configuration; updates use immutable version history and an exact company/workspace-scoped idempotency key. Existing operation prices, charges and legacy current tariff pointers are unchanged. Missing price_id is rejected rather than silently disabling enrollment. No automatic retry.

Operation: setRetailTextEnrollment.

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/organizations/{organization}/projects/{project}/billing/retail-price-enrollment" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Required.

JSON
{
"type": "object",
"required": [
"model_alias",
"price_id",
"expected_version",
"idempotency_key",
"reason"
],
"properties": {
"model_alias": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"price_id": {
"type": [
"string",
"null"
],
"format": "uuid"
},
"expected_version": {
"type": "string",
"pattern": "^[0-9]+$"
},
"idempotency_key": {
"type": "string",
"format": "uuid"
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
},
"additionalProperties": false
}

Current configuration or exact committed outcome

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"revision",
"version",
"model_alias",
"price_id"
],
"properties": {
"revision": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "string",
"pattern": "^[0-9]+$"
},
"model_alias": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"price_id": {
"type": [
"string",
"null"
],
"format": "uuid"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}

Invalid model, reason or exact version

Authentication required

Explicit platform administration required

Stale version, conflicting key, unknown workspace, missing balance account or incompatible price identity

Malformed body or missing explicit price_id

Explicit platform administration required. price_id chooses a published text identity with the same model and an existing company/currency balance account; no account, credit, funds, Provider qualification or selling permission is created. Explicit null restores legacy workspace tariff selection for future operations. expected_version zero creates the configuration; updates use immutable version history and an exact company/workspace-scoped idempotency key. Existing operation prices, charges and legacy current tariff pointers are unchanged. Missing price_id is rejected rather than silently disabling enrollment. No automatic retry.

Supported scope: implemented