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

Record an already completed external Provider payment

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

POST /api/v1/providers/{provider}/settlements

Platform administration required; Provider membership does not grant this write. Does not transfer funds. Selected earnings must belong to this Provider, share one currency, remain unpaid and have a positive exact total. The server computes the amount. Reuse the supplied idempotency key with the identical reference and entry set for retries; entry order is irrelevant. Changed replay, duplicate payment reference or unavailable selections return 409. No customer balance credit or Provider qualification is created.

Operation: recordExternalProviderPayment.

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/{provider}/settlements" \
-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",
"additionalProperties": false,
"required": [
"idempotency_key",
"payment_reference",
"attempt_ids"
],
"properties": {
"idempotency_key": {
"type": "string",
"format": "uuid"
},
"payment_reference": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Nonblank reference, at most 200 UTF-8 bytes, no control characters. Preserve the exact value on retry."
},
"attempt_ids": {
"type": "array",
"minItems": 1,
"maxItems": 1000,
"uniqueItems": true,
"items": {
"type": "string",
"format": "uuid"
},
"description": "Internal selection IDs from the platform earning history; never display IDs or require users to paste them."
}
}
}

Recorded or replayed settlement identity.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
}
}
}
}
}

Invalid reference, entry set, or currency mix.

Invalid administrative credential.

Platform administration required.

Provider or earnings unavailable, changed replay, or duplicate payment reference.

Storage unavailable.

Platform administration required; Provider membership does not grant this write. Does not transfer funds. Selected earnings must belong to this Provider, share one currency, remain unpaid and have a positive exact total. The server computes the amount. Reuse the supplied idempotency key with the identical reference and entry set for retries; entry order is irrelevant. Changed replay, duplicate payment reference or unavailable selections return 409. No customer balance credit or Provider qualification is created.

Supported scope: implemented