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

End a Provider purchase schedule's eligibility

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

POST /api/v1/providers/{provider}/media-rates/{revision}/retire

Installation write permission only. Appends an immutable eligibility cutoff within the original interval; the cutoff is exclusive for original-card selection. Publish the replacement with a matching effective start before the cutoff. Exact replay is idempotent; changed cutoff or missing Provider/revision conflicts. Historical purchase snapshots, earnings and payments are unchanged. Incomplete or overlapping schedules fail closed. Retirement is not cancellation or a refund.

Operation: retireSupplierMediaRate.

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

JSON
[
{
"operatorBearer": []
}
]

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/{provider}/media-rates/{revision}/retire" \
-H "Authorization: Bearer $NIU_MEMBER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

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

Location: path. Required.

JSON
{
"type": "string",
"minLength": 1,
"maxLength": 256
}

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"effective_until"
],
"properties": {
"effective_until": {
"type": "integer",
"format": "int64",
"description": "Unix seconds"
}
}
}

Cutoff saved or exact replay accepted

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"revision",
"effective_until"
],
"properties": {
"revision": {
"type": "string"
},
"effective_until": {
"type": "string",
"pattern": "^-?[0-9]+$"
}
}
}
}
}

Invalid cutoff or revision

Installation authentication required

Installation write permission required

Missing scoped revision or conflicting saved cutoff

Body exceeds 1 KiB

Malformed typed JSON

Durable storage unavailable

Installation write permission only. Appends an immutable eligibility cutoff within the original interval; the cutoff is exclusive for original-card selection. Publish the replacement with a matching effective start before the cutoff. Exact replay is idempotent; changed cutoff or missing Provider/revision conflicts. Historical purchase snapshots, earnings and payments are unchanged. Incomplete or overlapping schedules fail closed. Retirement is not cancellation or a refund.