OpenAPI JSONMarkdown Docs

OpenAPI Explorer

Auto-generated OpenAPI definition for all enabled modules.

Default server: https://dgital-base.kc-trade.cn/api

Authentication & Accounts

Showing 20 of 36 endpoints
GET/auth/admin/nav
Auth required

Resolve backend chrome bootstrap payload

Returns the backend chrome payload available to the authenticated administrator after applying scope, RBAC, role defaults, and personal sidebar preferences.

Responses

200Backend chrome payload
Content-Type: application/json
{
  "brand": null,
  "groups": [
    {
      "name": "string",
      "items": [
        {
          "href": "string",
          "title": "string"
        }
      ]
    }
  ],
  "settingsSections": [
    {
      "id": "string",
      "label": "string",
      "items": [
        {
          "id": "string",
          "label": "string",
          "href": "string"
        }
      ]
    }
  ],
  "settingsPathPrefixes": [
    "string"
  ],
  "profileSections": [
    {
      "id": "string",
      "label": "string",
      "items": [
        {
          "id": "string",
          "label": "string",
          "href": "string"
        }
      ]
    }
  ],
  "profilePathPrefixes": [
    "string"
  ],
  "grantedFeatures": [
    "string"
  ],
  "roles": [
    "string"
  ],
  "currentOrganization": null
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/admin/nav" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/auth/autologin

Auto sign-in using env-configured demo credentials

When OM_AUTOLOGIN_EMAIL / OM_AUTOLOGIN_PASSWORD are configured, signs the visitor in with those credentials and redirects into the app. Intended for single-tenant demo instances only. Falls back to the login page when disabled or misconfigured.

Responses

200Success response
Content-Type: application/json
"string"
307Redirect into the app (or to /login on failure)
Content-Type: text/html
string

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/autologin" \
  -H "Accept: application/json"
POST/auth/feature-check
Auth required

Check feature grants for the current user

Evaluates which of the requested features are available to the signed-in user within the active tenant / organization context.

Request body (application/json)

{
  "features": [
    "string"
  ]
}

Responses

200Evaluation result
Content-Type: application/json
{
  "ok": true,
  "granted": [
    "string"
  ],
  "userId": "string"
}
400Invalid request — features array missing, too large, or contains invalid entries
Content-Type: application/json
{
  "ok": false,
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "ok": false,
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/feature-check" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"features\": [
    \"string\"
  ]
}"
GET/auth/features
Auth required

List declared feature flags

Returns all static features contributed by the enabled modules along with their module source.

Responses

200Aggregated feature catalog
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "title": "string",
      "module": "string"
    }
  ],
  "modules": [
    {
      "id": "string",
      "title": "string"
    }
  ]
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/features" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/auth/locale

Set locale and redirect

Stores the selected locale in a cookie and redirects to a safe local path.

Parameters

NameInRequiredSchemaDescription
localequeryYesanyA locale code this tenant serves — one of the `servable` entries returned by `GET /api/translations/locales`. Codes are canonicalized (`de-AT` → `de`).
redirectqueryNoany—

Responses

200Success response
Content-Type: application/json
"string"
302Locale cookie set and request redirected
Content-Type: application/json
"string"
400Invalid locale
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/locale?locale=string" \
  -H "Accept: application/json"
POST/auth/locale

Set locale

Stores the selected locale in a cookie and returns a JSON success response.

Request body (application/json)

{
  "locale": "string"
}

Responses

200Locale cookie set
Content-Type: application/json
{
  "ok": true
}
400Invalid locale or malformed request body
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/locale" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "{
  \"locale\": \"string\"
}"
POST/auth/login

Authenticate user credentials

Validates the submitted credentials and issues a bearer token cookie for subsequent API calls.

Request body (application/x-www-form-urlencoded)

email=user%40example.com&password=string

Responses

200Authentication succeeded
Content-Type: application/json
{
  "ok": true,
  "token": "string",
  "redirect": null
}
400Validation failed
Content-Type: application/json
{
  "ok": false,
  "error": "string"
}
401Invalid credentials
Content-Type: application/json
{
  "ok": false,
  "error": "string"
}
403User lacks required role
Content-Type: application/json
{
  "ok": false,
  "error": "string"
}
429Too many login attempts
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/login" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "email=user%40example.com&password=string"
POST/auth/logout
Auth required

Invalidate session and redirect

Clears authentication cookies and redirects the browser to the login page.

Responses

201Success response
Content-Type: application/json
"string"
302Redirect to login after successful logout
Content-Type: text/html
string

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/logout" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/auth/profile
Auth required

Get current profile

Returns the email address, display name, and roles for the signed-in user. The display name is null when unset.

Responses

200Profile payload
Content-Type: application/json
{
  "email": "user@example.com",
  "name": null,
  "roles": [
    "string"
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404User not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/profile" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/auth/profile
Auth required

Update current profile

Updates the email address or password for the signed-in user.

Request body (application/json)

{}

Responses

200Profile updated
Content-Type: application/json
{
  "ok": true,
  "email": "user@example.com"
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/auth/profile" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
POST/auth/reset

Send reset email

Requests a password reset email for the given account. The endpoint always returns `ok: true` to avoid leaking account existence.

Request body (application/x-www-form-urlencoded)

email=user%40example.com

Responses

200Reset email dispatched (or ignored for unknown accounts)
Content-Type: application/json
{
  "ok": true
}
400Invalid request origin
Content-Type: application/json
{
  "error": "string"
}
429Too many password reset requests
Content-Type: application/json
{
  "error": "string"
}
500Password reset email origin is not configured
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/reset" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "email=user%40example.com"
POST/auth/reset/confirm

Complete password reset

Validates the reset token and updates the user password.

Request body (application/x-www-form-urlencoded)

token=string&password=string

Responses

200Password reset succeeded
Content-Type: application/json
{
  "ok": true,
  "redirect": "string"
}
400Invalid token or payload
Content-Type: application/json
{
  "ok": false,
  "error": "string"
}
429Too many reset confirmation attempts
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/reset/confirm" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "token=string&password=string"
POST/auth/reset/validate

Check whether a password reset token is still usable

Reports whether a reset token exists, is unused, and has not expired, so the reset page can render a terminal state instead of a form the token can never submit. The token is never consumed and the response never distinguishes unknown, used, and expired tokens.

Request body (application/x-www-form-urlencoded)

token=string

Responses

200Token state resolved
Content-Type: application/json
{
  "ok": true,
  "valid": true
}
429Too many token validation attempts
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/reset/validate" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "token=string"
GET/auth/roles
Auth required

List roles

Returns available roles within the current tenant. Super administrators receive visibility across tenants.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
tenantIdqueryNoany—

Responses

200Role collection
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "usersCount": 1,
      "tenantId": null,
      "tenantName": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/roles?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/auth/roles
Auth required

Create role

Creates a new role anchored to the caller's tenant. Non-superadmins cannot target another tenant; supplying a foreign `tenantId` is rejected.

Request body (application/json)

{
  "name": "string"
}

Responses

201Role created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/auth/roles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"name\": \"string\"
}"
PUT/auth/roles
Auth required

Update role

Updates mutable fields on an existing role.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Role updated
Content-Type: application/json
{
  "ok": true
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Role not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/auth/roles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/auth/roles
Auth required

Delete role

Deletes a role by identifier. Fails when users remain assigned.

Parameters

NameInRequiredSchemaDescription
idqueryYesanyRole identifier

Responses

200Role deleted
Content-Type: application/json
{
  "ok": true
}
400Role cannot be deleted
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Role not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/auth/roles?id=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/auth/roles/acl
Auth required

Fetch role ACL

Returns the feature and organization assignments associated with a role within the current tenant.

Parameters

NameInRequiredSchemaDescription
roleIdqueryYesany—
tenantIdqueryNoany—

Responses

200Role ACL entry
Content-Type: application/json
{
  "isSuperAdmin": true,
  "features": [
    "string"
  ],
  "organizations": null,
  "updatedAt": null
}
400Invalid role id
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Role not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/roles/acl?roleId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/auth/roles/acl
Auth required

Update role ACL

Replaces the feature list, super admin flag, and optional organization assignments for a role.

Request body (application/json)

{
  "roleId": "00000000-0000-4000-8000-000000000000",
  "organizations": null
}

Responses

200Role ACL updated
Content-Type: application/json
{
  "ok": true,
  "sanitized": true
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Insufficient privileges to modify ACL
Content-Type: application/json
{
  "error": "string"
}
404Role not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/auth/roles/acl" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"roleId\": \"00000000-0000-4000-8000-000000000000\",
  \"organizations\": null
}"
GET/auth/session/refresh

Refresh auth cookie from session token (browser)

Exchanges an existing `session_token` cookie for a fresh JWT auth cookie and redirects the browser.

Parameters

NameInRequiredSchemaDescription
redirectqueryNoanyAbsolute or relative URL to redirect after refresh

Responses

200Success response
Content-Type: application/json
"string"
302Redirect to target location when session is valid
Content-Type: text/html
string

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/session/refresh" \
  -H "Accept: application/json"

Directory (Tenants & Organizations)

Showing 2 of 2 endpoints
GET/directory/organizations/lookup

Public organization lookup by slug

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/directory/organizations/lookup" \
  -H "Accept: application/json"
GET/directory/tenants/lookup

Public tenant lookup

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/directory/tenants/lookup" \
  -H "Accept: application/json"

API Documentation

Showing 1 of 1 endpoints
GET/version

Deployed Open Mercato version

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/version" \
  -H "Accept: application/json"

Audit & Action Logs

Showing 5 of 5 endpoints
GET/audit_logs/audit-logs/access
Auth required

Retrieve access logs

Fetches paginated access audit logs scoped to the authenticated user. Tenant administrators can optionally expand the search to other actors or organizations.

Parameters

NameInRequiredSchemaDescription
organizationIdqueryNoanyLimit results to a specific organization
actorUserIdqueryNoanyFilter by actor user id (tenant administrators only)
resourceKindqueryNoanyRestrict to a resource kind such as `order` or `product`
accessTypequeryNoanyAccess type filter, e.g. `read` or `export`
pagequeryNoanyPage number (default 1)
pageSizequeryNoanyPage size (default 50)
limitqueryNoanyExplicit maximum number of records when paginating manually
beforequeryNoanyReturn logs created before this ISO-8601 timestamp
afterqueryNoanyReturn logs created after this ISO-8601 timestamp

Responses

200Access logs returned successfully
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "resourceKind": "string",
      "resourceId": "string",
      "accessType": "string",
      "actorUserId": null,
      "actorUserName": null,
      "tenantId": null,
      "tenantName": null,
      "organizationId": null,
      "organizationName": null,
      "fields": [
        "string"
      ],
      "context": null,
      "createdAt": "string"
    }
  ],
  "canViewTenant": true,
  "page": 1,
  "pageSize": 1,
  "total": 1,
  "totalPages": 1
}
400Invalid filters supplied
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Caller has no resolved tenant scope and is not a superadmin
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/audit_logs/audit-logs/access" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/audit_logs/audit-logs/actions
Auth required

Fetch action logs

Returns recent action audit log entries. Tenant administrators can widen the scope to other actors or organizations, and callers can optionally restrict results to undoable actions.

Parameters

NameInRequiredSchemaDescription
organizationIdqueryNoanyLimit results to a specific organization
actorUserIdqueryNoanyFilter logs created by specific actor IDs (tenant administrators only). Accepts a single UUID or a comma-separated UUID list.
resourceKindqueryNoanyFilter by resource kind (e.g., "order", "product")
resourceIdqueryNoanyFilter by resource ID (UUID of the specific record)
actionTypequeryNoanyFilter by action type (`create`, `edit`, `delete`, `assign`). Accepts a single value or a comma-separated list.
fieldNamequeryNoanyFilter to entries where the given field changed. Accepts a single field name or a comma-separated list.
includeRelatedqueryNoanyWhen `true`, also returns changes to child entities linked via parentResourceKind/parentResourceId
includeTotalqueryNoanyWhen `true`, the response includes the filtered total count.
undoableOnlyqueryNoanyWhen `true`, only undoable actions are returned
limitqueryNoanyMaximum number of records to return (default 50, max 1000)
offsetqueryNoanyZero-based record offset for pagination (legacy — prefer page/pageSize)
pagequeryNoanyPage number (default 1)
pageSizequeryNoanyPage size (default 50, max 200)
sortFieldqueryNoanySort field: `createdAt`, `user`, `action`, `field`, or `source`.
sortDirqueryNoanySort direction: `asc` or `desc`.
beforequeryNoanyReturn actions created before this ISO-8601 timestamp
afterqueryNoanyReturn actions created after this ISO-8601 timestamp

Responses

200Action logs retrieved successfully
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "commandId": "string",
      "actionLabel": null,
      "executionState": "done",
      "actorUserId": null,
      "actorUserName": null,
      "tenantId": null,
      "tenantName": null,
      "organizationId": null,
      "organizationName": null,
      "resourceKind": null,
      "resourceId": null,
      "parentResourceKind": null,
      "parentResourceId": null,
      "undoToken": null,
      "createdAt": "string",
      "updatedAt": "string",
      "snapshotBefore": null,
      "snapshotAfter": null,
      "changes": null,
      "context": null
    }
  ],
  "canViewTenant": true,
  "page": 1,
  "pageSize": 1,
  "total": 1,
  "totalPages": 1
}
400Invalid filter values
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Caller has no resolved tenant scope and is not a superadmin
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/audit_logs/audit-logs/actions?includeRelated=false&includeTotal=false&undoableOnly=false" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/audit_logs/audit-logs/actions/export
Auth required

Export action logs as CSV

Returns a CSV attachment containing filtered action audit log entries. Tenant administrators can widen the scope to other actors or organizations.

Parameters

NameInRequiredSchemaDescription
organizationIdqueryNoanyLimit results to a specific organization
actorUserIdqueryNoanyFilter logs created by specific actor IDs (tenant administrators only). Accepts a single UUID or a comma-separated UUID list.
resourceKindqueryNoanyFilter by resource kind (e.g., "order", "product")
resourceIdqueryNoanyFilter by resource ID (UUID of the specific record)
actionTypequeryNoanyFilter by action type (`create`, `edit`, `delete`, `assign`). Accepts a single value or a comma-separated list.
fieldNamequeryNoanyFilter to entries where the given field changed. Accepts a single field name or a comma-separated list.
includeRelatedqueryNoanyWhen `true`, also returns changes to child entities linked via parentResourceKind/parentResourceId
undoableOnlyqueryNoanyWhen `true`, only undoable actions are returned
limitqueryNoanyMaximum number of records to export (default 1000, capped at 1000)
sortFieldqueryNoanySort field: `createdAt`, `user`, `action`, `field`, or `source`.
sortDirqueryNoanySort direction: `asc` or `desc`.
beforequeryNoanyReturn actions created before this ISO-8601 timestamp
afterqueryNoanyReturn actions created after this ISO-8601 timestamp

Responses

200CSV export generated successfully
Content-Type: application/json
{
  "file": "csv"
}
400Invalid filter values
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Caller has no resolved tenant scope and is not a superadmin
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/audit_logs/audit-logs/actions/export?includeRelated=false&undoableOnly=false" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/audit_logs/audit-logs/actions/redo
Auth required

Redo by action log id

Redoes the latest undone command owned by the caller. Requires the action to still be eligible for redo within tenant and organization scope.

Request body (application/json)

{
  "logId": "string"
}

Responses

200Redo executed successfully
Content-Type: application/json
{
  "ok": true,
  "logId": null,
  "undoToken": null
}
400Log not eligible for redo
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Redo blocked by scope checks
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/audit_logs/audit-logs/actions/redo" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"logId\": \"string\"
}"
POST/audit_logs/audit-logs/actions/undo
Auth required

Undo action by token

Replays the undo handler registered for a command. The provided undo token must match the latest undoable log entry accessible to the caller.

Request body (application/json)

{
  "undoToken": "string"
}

Responses

200Undo applied successfully
Content-Type: application/json
{
  "ok": true,
  "logId": "string"
}
400Invalid or unavailable undo token
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Undo blocked by organization or tenant scope
Content-Type: application/json
{
  "error": "string"
}
422Undo deliberately blocked by a beforeUndo command interceptor. The interceptor chooses the status (any 4xx/5xx) and may replace the body.
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/audit_logs/audit-logs/actions/undo" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"undoToken\": \"string\"
}"

Notifications

Showing 20 of 22 endpoints
GET/notifications
Auth required

List notifications

Returns a paginated collection of notifications.

Parameters

NameInRequiredSchemaDescription
statusqueryNoany—
typequeryNoany—
severityqueryNoany—
sourceEntityTypequeryNoany—
sourceEntityIdqueryNoany—
sincequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated notifications
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "type": "string",
      "title": "string",
      "body": null,
      "titleKey": null,
      "bodyKey": null,
      "titleVariables": null,
      "bodyVariables": null,
      "icon": null,
      "severity": "string",
      "status": "string",
      "actions": [
        {
          "id": "string",
          "label": "string"
        }
      ],
      "sourceModule": null,
      "sourceEntityType": null,
      "sourceEntityId": null,
      "linkHref": null,
      "createdAt": "string",
      "readAt": null,
      "actionTaken": null
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}
403Request could not be resolved to a tenant scope (code: tenant_scope_required)
Content-Type: application/json
{
  "error": "string",
  "code": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/notifications?page=1&pageSize=20" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/notifications
Auth required

Create notification

Creates a notification for a user.

Request body (application/json)

{
  "type": "string",
  "severity": "info",
  "recipientUserId": "00000000-0000-4000-8000-000000000000"
}

Responses

201Notification created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/notifications" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"type\": \"string\",
  \"severity\": \"info\",
  \"recipientUserId\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/notifications/{id}/action
Auth required

POST /notifications/{id}/action

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/notifications/:id/action" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/{id}/dismiss
Auth required

PUT /notifications/{id}/dismiss

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/:id/dismiss" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/{id}/read
Auth required

PUT /notifications/{id}/read

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/:id/read" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/{id}/restore
Auth required

PUT /notifications/{id}/restore

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/:id/restore" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/notifications/admin/preferences
Auth required

GET /notifications/admin/preferences

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/notifications/admin/preferences" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/admin/preferences
Auth required

PUT /notifications/admin/preferences

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/admin/preferences" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/notifications/batch
Auth required

POST /notifications/batch

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/notifications/batch" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/notifications/channels
Auth required

GET /notifications/channels

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/notifications/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/notifications/feature
Auth required

POST /notifications/feature

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/notifications/feature" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/mark-all-read
Auth required

PUT /notifications/mark-all-read

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/mark-all-read" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/notifications/preferences
Auth required

GET /notifications/preferences

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/notifications/preferences" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/preferences
Auth required

PUT /notifications/preferences

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/preferences" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/notifications/role
Auth required

POST /notifications/role

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/notifications/role" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/notifications/settings
Auth required

GET /notifications/settings

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/notifications/settings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/notifications/settings
Auth required

POST /notifications/settings

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/notifications/settings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/notifications/types
Auth required

GET /notifications/types

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/notifications/types" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PATCH/notifications/types
Auth required

PATCH /notifications/types

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PATCH "https://dgital-base.kc-trade.cn/api/notifications/types" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/notifications/types/{id}/channels/{channel}
Auth required

PUT /notifications/types/{id}/channels/{channel}

Parameters

NameInRequiredSchemaDescription
idpathYesany—
channelpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/notifications/types/:id/channels/:channel" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Events

Showing 2 of 2 endpoints
GET/events
Auth required

List declared events

Returns every declared event, including its declared payloadSchema when the module (or the generated CRUD default) provides one. Filters: category, module, excludeTriggerExcluded (default true).

Responses

200Declared events
Content-Type: application/json
{
  "data": [
    {
      "id": "string",
      "label": "string"
    }
  ],
  "total": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/events" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/events/stream
Auth required

GET /events/stream

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/events/stream" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Search

Showing 15 of 15 endpoints
GET/search/embeddings
Auth required

Get embeddings configuration

Returns current embedding provider and model configuration.

Responses

200Embeddings settings
Content-Type: application/json
{
  "settings": {
    "openaiConfigured": true,
    "autoIndexingEnabled": true,
    "autoIndexingLocked": true,
    "lockReason": null,
    "embeddingConfig": null,
    "configuredProviders": [
      "openai"
    ],
    "indexedDimension": null,
    "reindexRequired": true,
    "documentCount": null
  }
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/search/embeddings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/search/embeddings
Auth required

Update embeddings configuration

Updates the embedding provider and model settings.

Request body (application/json)

{}

Responses

200Updated settings
Content-Type: application/json
{
  "settings": {
    "openaiConfigured": true,
    "autoIndexingEnabled": true,
    "autoIndexingLocked": true,
    "lockReason": null,
    "embeddingConfig": null,
    "configuredProviders": [
      "openai"
    ],
    "indexedDimension": null,
    "reindexRequired": true,
    "documentCount": null
  }
}
400Invalid request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Auto-indexing disabled via environment
Content-Type: application/json
{
  "error": "string"
}
500Update failed
Content-Type: application/json
{
  "error": "string"
}
503Configuration service unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/search/embeddings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
POST/search/embeddings/reindex
Auth required

Trigger vector reindex

Starts a vector embedding reindex operation.

Request body (application/json)

{}

Responses

200Reindex result
Content-Type: application/json
{
  "ok": true
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Reindex already in progress
Content-Type: application/json
{
  "error": "string",
  "lock": {
    "type": "fulltext",
    "action": "string",
    "startedAt": "string",
    "elapsedMinutes": 1,
    "processedCount": null,
    "totalCount": null
  }
}
500Reindex failed
Content-Type: application/json
{
  "error": "string"
}
503Search indexer unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/search/embeddings/reindex" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
POST/search/embeddings/reindex/cancel
Auth required

Cancel vector reindex

Cancels an in-progress vector reindex operation.

Responses

200Cancel result
Content-Type: application/json
{
  "ok": true,
  "jobsRemoved": 1
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/search/embeddings/reindex/cancel" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/search/index
Auth required

List vector index entries

Returns paginated list of entries in the vector search index.

Parameters

NameInRequiredSchemaDescription
entityIdqueryNoanyFilter by entity ID (e.g., "customers:customer_person_profile", "catalog:catalog_product")
limitqueryNoanyMaximum entries to return (default: 50, max: 200)
offsetqueryNoanyOffset for pagination (default: 0)

Responses

200Index entries
Content-Type: application/json
{
  "entries": [
    {
      "id": "string",
      "entityId": "string",
      "recordId": "string",
      "tenantId": "string",
      "organizationId": null
    }
  ],
  "limit": 1,
  "offset": 1
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Failed to fetch index
Content-Type: application/json
{
  "error": "string"
}
503Vector strategy unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/search/index" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
DELETE/search/index
Auth required

Purge vector index

Purges entries from the vector search index. Requires confirmAll=true when purging all entities.

Parameters

NameInRequiredSchemaDescription
entityIdqueryNoanySpecific entity ID to purge (e.g., "customers:customer_person_profile", "catalog:catalog_product")
confirmAllqueryNoanyRequired when purging all entities

Responses

200Purge result
Content-Type: application/json
{
  "ok": true
}
400Missing confirmAll parameter
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Purge failed
Content-Type: application/json
{
  "error": "string"
}
503Search indexer unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/search/index" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/search/reindex
Auth required

Trigger fulltext reindex

Starts a fulltext (Meilisearch) reindex operation. Can clear, recreate, or fully reindex.

Request body (application/json)

{}

Responses

200Reindex result
Content-Type: application/json
{
  "ok": true,
  "action": "clear",
  "entityId": null
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Reindex already in progress
Content-Type: application/json
{
  "error": "string",
  "lock": {
    "type": "fulltext",
    "action": "string",
    "startedAt": "string",
    "elapsedMinutes": 1,
    "processedCount": null,
    "totalCount": null
  }
}
500Reindex failed
Content-Type: application/json
{
  "error": "string"
}
503Search service unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/search/reindex" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
POST/search/reindex/cancel
Auth required

Cancel fulltext reindex

Cancels an in-progress fulltext reindex operation.

Responses

200Cancel result
Content-Type: application/json
{
  "ok": true,
  "jobsRemoved": 1
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/search/reindex/cancel" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/search/search/global
Auth required

Global search (Cmd+K)

Performs a global search using saved tenant strategies. Does NOT accept strategies from URL.

Parameters

NameInRequiredSchemaDescription
qqueryYesanySearch query (required)
limitqueryNoanyMaximum results to return (default: 50, max: 100)
entityTypesqueryNoanyComma-separated entity types to filter results (e.g., "customers:customer_person_profile,catalog:catalog_product,sales:sales_order")

Responses

200Search results
Content-Type: application/json
{
  "results": [
    {
      "entityId": "string",
      "recordId": "string",
      "score": 1,
      "source": "fulltext"
    }
  ],
  "strategiesUsed": [
    "fulltext"
  ],
  "strategiesEnabled": [
    "fulltext"
  ],
  "timing": 1,
  "query": "string",
  "limit": 1
}
400Missing query parameter
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Search failed
Content-Type: application/json
{
  "error": "string"
}
503Search service unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/search/search/global?q=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/search/settings
Auth required

Get search settings and status

Returns search module configuration, available strategies, and reindex lock status.

Responses

200Search settings
Content-Type: application/json
{
  "settings": {
    "strategies": [
      {
        "id": "string",
        "name": "string",
        "priority": 1,
        "available": true
      }
    ],
    "fulltextConfigured": true,
    "fulltextStats": null,
    "vectorConfigured": true,
    "tokensEnabled": true,
    "defaultStrategies": [
      "string"
    ],
    "reindexLock": null,
    "fulltextReindexLock": null,
    "vectorReindexLock": null
  }
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/search/settings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/search/settings/fulltext
Auth required

Get fulltext search configuration

Returns Meilisearch configuration status and index statistics.

Responses

200Fulltext settings
Content-Type: application/json
{
  "driver": null,
  "configured": true,
  "envVars": {
    "MEILISEARCH_HOST": {
      "set": true,
      "hint": "string"
    },
    "MEILISEARCH_API_KEY": {
      "set": true,
      "hint": "string"
    }
  },
  "optionalEnvVars": {
    "MEILISEARCH_INDEX_PREFIX": {
      "set": true,
      "hint": "string"
    },
    "SEARCH_EXCLUDE_ENCRYPTED_FIELDS": {
      "set": true,
      "hint": "string"
    }
  }
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/search/settings/fulltext" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/search/settings/global-search
Auth required

Update global search strategies

Sets which strategies are enabled for Cmd+K global search.

Request body (application/json)

{
  "enabledStrategies": [
    "fulltext"
  ]
}

Responses

200Updated settings
Content-Type: application/json
{
  "ok": true,
  "enabledStrategies": [
    "fulltext"
  ]
}
400Invalid request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Internal error
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/search/settings/global-search" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"enabledStrategies\": [
    \"fulltext\"
  ]
}"
GET/search/settings/vector-store
Auth required

Get vector store configuration

Returns vector store configuration status.

Responses

200Vector store settings
Content-Type: application/json
{
  "currentDriver": "pgvector",
  "configured": true,
  "drivers": [
    {
      "id": "pgvector",
      "name": "string",
      "configured": true,
      "implemented": true,
      "available": null,
      "unavailableReason": null,
      "envVars": [
        {
          "name": "string",
          "set": true,
          "hint": "string"
        }
      ]
    }
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/search/settings/vector-store" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Attachments

Showing 14 of 14 endpoints
GET/attachments
Auth required

List attachments for a record

Returns uploaded attachments for the given entity record, ordered by newest first.

Parameters

NameInRequiredSchemaDescription
entityIdqueryYesanyEntity identifier that owns the attachments
recordIdqueryYesanyRecord identifier within the entity
pagequeryNoany—
pageSizequeryNoany—

Responses

200Attachments found for the record
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "url": "string",
      "fileName": "string",
      "fileSize": 1,
      "createdAt": "string",
      "mimeType": null,
      "content": null
    }
  ]
}
400Missing entity or record identifiers
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/attachments?entityId=string&recordId=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/attachments
Auth required

Upload attachment

Uploads a new attachment using multipart form-data and stores metadata for later retrieval.

Request body (multipart/form-data)

entityId=string
recordId=string
file=string

Responses

200Attachment stored successfully
Content-Type: application/json
{
  "ok": true,
  "item": {
    "id": "string",
    "url": "string",
    "fileName": "string",
    "fileSize": 1,
    "content": null
  }
}
400Payload validation error
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Attachment violates field constraints
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/attachments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: multipart/form-data" \
  -d "{
  \"entityId\": \"string\",
  \"recordId\": \"string\",
  \"file\": \"string\"
}"
DELETE/attachments
Auth required

Delete attachment

Removes an uploaded attachment and deletes the stored asset.

Parameters

NameInRequiredSchemaDescription
idqueryYesany—

Responses

200Attachment deleted
Content-Type: application/json
{
  "ok": true
}
400Missing attachment identifier
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Attachment not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/attachments?id=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/attachments/file/{id}

Download or serve attachment file

Returns the raw file content for an attachment. Path parameter: {id} - Attachment UUID. Query parameter: ?download=1 - Force file download with Content-Disposition header. Access control is enforced based on partition settings.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200File content with appropriate MIME type
Content-Type: application/json
"string"
400Missing attachment ID
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized - authentication required for private partitions
Content-Type: application/json
{
  "error": "string"
}
403Forbidden - insufficient permissions
Content-Type: application/json
{
  "error": "string"
}
404Attachment or file not found
Content-Type: application/json
{
  "error": "string"
}
500Partition misconfigured
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/attachments/file/:id" \
  -H "Accept: application/json"
GET/attachments/image/{id}/{slug}

Serve image with optional resizing

Returns an image attachment with optional on-the-fly resizing and cropping. Resized images are cached for performance. Only works with image MIME types. Path parameter: {id} - Attachment UUID. Query parameters: ?width=N (1-4000 pixels), ?height=N (1-4000 pixels), ?cropType=cover|contain (resize behavior).

Parameters

NameInRequiredSchemaDescription
idpathYesany—
slugpathNoany—

Responses

200Binary image content (Content-Type: image/jpeg, image/png, etc.)
Content-Type: application/json
"string"
400Invalid parameters, missing ID, or non-image attachment
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized - authentication required for private partitions
Content-Type: application/json
{
  "error": "string"
}
403Forbidden - insufficient permissions
Content-Type: application/json
{
  "error": "string"
}
404Image not found
Content-Type: application/json
{
  "error": "string"
}
500Partition misconfigured or image rendering failed
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/attachments/image/:id/:slug" \
  -H "Accept: application/json"
GET/attachments/library
Auth required

List attachments

Returns paginated list of attachments with optional filtering by search term, partition, and tags. Includes available tags and partitions.

Parameters

NameInRequiredSchemaDescription
pagequeryNoanyPage number for pagination
pageSizequeryNoanyNumber of items per page (max 100)
searchqueryNoanySearch by file name (case-insensitive)
partitionqueryNoanyFilter by partition code
tagsqueryNoanyFilter by tags (comma-separated)
sortFieldqueryNoanyField to sort by
sortDirqueryNoanySort direction

Responses

200Attachments list with pagination and metadata
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "fileName": "string",
      "fileSize": 1,
      "mimeType": "string",
      "partitionCode": "string",
      "partitionTitle": null,
      "url": null,
      "createdAt": "string",
      "tags": [
        "string"
      ],
      "assignments": [],
      "content": null
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1,
  "availableTags": [
    "string"
  ],
  "partitions": [
    {
      "code": "string",
      "title": "string",
      "description": null,
      "isPublic": true
    }
  ]
}
400Invalid query parameters
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/attachments/library?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/attachments/library/{id}
Auth required

Get attachment details

Returns complete details of an attachment including metadata, tags, assignments, and custom fields.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Attachment details
Content-Type: application/json
{
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "fileName": "string",
    "fileSize": 1,
    "mimeType": "string",
    "partitionCode": "string",
    "partitionTitle": null,
    "tags": [
      "string"
    ],
    "assignments": [],
    "content": null,
    "customFields": null
  }
}
400Invalid attachment ID
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Attachment not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/attachments/library/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PATCH/attachments/library/{id}
Auth required

Update attachment metadata

Updates attachment tags, assignments, and custom fields. Emits CRUD side effects for indexing and events.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Request body (application/json)

{}

Responses

200Attachment updated successfully
Content-Type: application/json
{
  "ok": true
}
400Invalid payload or attachment ID
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Attachment not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to save attributes
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PATCH "https://dgital-base.kc-trade.cn/api/attachments/library/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
DELETE/attachments/library/{id}
Auth required

Delete attachment

Permanently deletes an attachment file from storage and database. Emits CRUD side effects.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Attachment deleted successfully
Content-Type: application/json
{
  "ok": true
}
400Invalid attachment ID
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Attachment not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/attachments/library/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/attachments/partitions
Auth required

List all attachment partitions

Returns all configured attachment partitions with storage settings, OCR configuration, and access control settings.

Responses

200List of partitions
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "code": "string",
      "title": "string",
      "description": null,
      "isPublic": true,
      "requiresOcr": true,
      "ocrModel": null,
      "configJson": null,
      "createdAt": null,
      "updatedAt": null,
      "envKey": "string"
    }
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/attachments/partitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/attachments/partitions
Auth required

Create new partition

Creates a new attachment partition with specified storage and OCR settings. Requires unique partition code.

Request body (application/json)

{
  "code": "string",
  "title": "string",
  "description": null,
  "ocrModel": null,
  "storageDriver": "local",
  "configJson": null
}

Responses

201Partition created successfully
Content-Type: application/json
{
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "code": "string",
    "title": "string",
    "description": null,
    "isPublic": true,
    "requiresOcr": true,
    "ocrModel": null,
    "configJson": null,
    "createdAt": null,
    "updatedAt": null,
    "envKey": "string"
  }
}
400Invalid payload or partition code
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Partitions locked in demo mode
Content-Type: application/json
{
  "error": "string"
}
409Partition code already exists
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/attachments/partitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"code\": \"string\",
  \"title\": \"string\",
  \"description\": null,
  \"ocrModel\": null,
  \"storageDriver\": \"local\",
  \"configJson\": null
}"
PUT/attachments/partitions
Auth required

Update partition

Updates an existing partition. Partition code cannot be changed. Title, description, OCR settings, and access control can be modified.

Request body (application/json)

{
  "code": "string",
  "title": "string",
  "description": null,
  "ocrModel": null,
  "storageDriver": "local",
  "configJson": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Partition updated successfully
Content-Type: application/json
{
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "code": "string",
    "title": "string",
    "description": null,
    "isPublic": true,
    "requiresOcr": true,
    "ocrModel": null,
    "configJson": null,
    "createdAt": null,
    "updatedAt": null,
    "envKey": "string"
  }
}
400Invalid payload or code change attempt
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Partitions locked in demo mode
Content-Type: application/json
{
  "error": "string"
}
404Partition not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/attachments/partitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"code\": \"string\",
  \"title\": \"string\",
  \"description\": null,
  \"ocrModel\": null,
  \"storageDriver\": \"local\",
  \"configJson\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/attachments/partitions
Auth required

Delete partition

Deletes a partition. Default partitions cannot be deleted. Partitions with existing attachments cannot be deleted.

Responses

200Partition deleted successfully
Content-Type: application/json
{
  "ok": true
}
400Invalid ID or default partition deletion attempt
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Partitions locked in demo mode
Content-Type: application/json
{
  "error": "string"
}
404Partition not found
Content-Type: application/json
{
  "error": "string"
}
409Partition in use
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/attachments/partitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/attachments/transfer
Auth required

Transfer attachments to different record

Transfers one or more attachments from one record to another within the same entity type. Updates attachment assignments and metadata to reflect the new record.

Request body (application/json)

{
  "entityId": "string",
  "attachmentIds": [
    "00000000-0000-4000-8000-000000000000"
  ],
  "toRecordId": "string"
}

Responses

200Attachments transferred successfully
Content-Type: application/json
{
  "ok": true,
  "updated": 1
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Attachments not found
Content-Type: application/json
{
  "error": "string"
}
500Attachment model missing
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/attachments/transfer" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"attachmentIds\": [
    \"00000000-0000-4000-8000-000000000000\"
  ],
  \"toRecordId\": \"string\"
}"

Product Catalog

Showing 1 of 1 endpoints
POST/catalog/bulk-delete
Auth required

Start bulk deleting catalog products

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/catalog/bulk-delete" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Customer Relationship Management

Showing 2 of 2 endpoints
POST/customers/deals/bulk-update-owner
Auth required

Bulk reassign deal owner

Queues a background job that reassigns the listed deals to a new owner (or clears the owner when null).

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/customers/deals/bulk-update-owner" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/customers/deals/bulk-update-stage
Auth required

Bulk update deal pipeline stage

Queues a background job that moves the listed deals to the same pipeline stage. Returns a progress job id to poll for completion.

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/customers/deals/bulk-update-stage" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Currencies

Showing 14 of 14 endpoints
GET/currencies/currencies
Auth required

List currencies

Returns a paginated collection of currencies scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
isBasequeryNoany—
isActivequeryNoany—
codequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated currencies
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "code": "string",
      "name": "string",
      "symbol": null,
      "decimalPlaces": 1,
      "thousandsSeparator": null,
      "decimalSeparator": null,
      "isBase": true,
      "isActive": true,
      "createdAt": null,
      "updatedAt": null,
      "organizationId": "string",
      "tenantId": "string"
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/currencies/currencies?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/currencies/currencies
Auth required

Create currency

Creates a new currency.

Request body (application/json)

{
  "organizationId": "string",
  "tenantId": "string",
  "code": "string",
  "name": "string",
  "symbol": null,
  "thousandsSeparator": null,
  "decimalSeparator": null
}

Responses

201Currency created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/currencies/currencies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"string\",
  \"tenantId\": \"string\",
  \"code\": \"string\",
  \"name\": \"string\",
  \"symbol\": null,
  \"thousandsSeparator\": null,
  \"decimalSeparator\": null
}"
PUT/currencies/currencies
Auth required

Update currency

Updates an existing currency by id.

Request body (application/json)

{
  "id": "string",
  "symbol": null,
  "thousandsSeparator": null,
  "decimalSeparator": null
}

Responses

200Currency updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/currencies/currencies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"string\",
  \"symbol\": null,
  \"thousandsSeparator\": null,
  \"decimalSeparator\": null
}"
DELETE/currencies/currencies
Auth required

Delete currency

Deletes a currency by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Currency deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/currencies/currencies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/currencies/currencies/options
Auth required

List currency options

Returns currencies formatted for select inputs.

Parameters

NameInRequiredSchemaDescription
qqueryNoany—
queryqueryNoany—
searchqueryNoany—
includeInactivequeryNoany—
limitqueryNoany—

Responses

200Option list
Content-Type: application/json
{
  "items": [
    {
      "value": "string",
      "label": "string"
    }
  ]
}
400Invalid query
Content-Type: application/json
{
  "items": []
}
401Unauthorized
Content-Type: application/json
{
  "items": []
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/currencies/currencies/options?limit=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/currencies/exchange-rates
Auth required

List exchangerates

Returns a paginated collection of exchangerates scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
fromCurrencyCodequeryNoany—
toCurrencyCodequeryNoany—
isActivequeryNoany—
sourcequeryNoany—
typequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated exchangerates
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "fromCurrencyCode": "string",
      "toCurrencyCode": "string",
      "rate": "string",
      "date": "string",
      "source": "string",
      "type": null,
      "isActive": true,
      "createdAt": null,
      "updatedAt": null,
      "organizationId": "00000000-0000-4000-8000-000000000000",
      "tenantId": "00000000-0000-4000-8000-000000000000"
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/currencies/exchange-rates?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/currencies/exchange-rates
Auth required

Create exchangerate

Creates a new exchange rate.

Request body (application/json)

{
  "organizationId": "string",
  "tenantId": "string",
  "fromCurrencyCode": "string",
  "toCurrencyCode": "string",
  "rate": "string",
  "type": null
}

Responses

201ExchangeRate created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/currencies/exchange-rates" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"string\",
  \"tenantId\": \"string\",
  \"fromCurrencyCode\": \"string\",
  \"toCurrencyCode\": \"string\",
  \"rate\": \"string\",
  \"type\": null
}"
PUT/currencies/exchange-rates
Auth required

Update exchangerate

Updates an existing exchange rate by id.

Request body (application/json)

{
  "id": "string",
  "type": null
}

Responses

200ExchangeRate updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/currencies/exchange-rates" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"string\",
  \"type\": null
}"
DELETE/currencies/exchange-rates
Auth required

Delete exchangerate

Deletes an exchange rate by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200ExchangeRate deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/currencies/exchange-rates" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/currencies/fetch-configs
Auth required

List currency fetch configurations

Returns all currency fetch configurations scoped to the authenticated organization.

Responses

200A list of currency fetch configurations
Content-Type: application/json
{
  "configs": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "organizationId": "00000000-0000-4000-8000-000000000000",
      "tenantId": "00000000-0000-4000-8000-000000000000",
      "provider": "string",
      "isEnabled": true,
      "syncTime": null,
      "lastSyncAt": null,
      "lastSyncStatus": null,
      "lastSyncMessage": null,
      "lastSyncCount": null,
      "config": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/currencies/fetch-configs" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/currencies/fetch-configs
Auth required

Create currency fetch configuration

Creates a new currency fetch configuration.

Request body (application/json)

{
  "provider": "NBP",
  "isEnabled": false,
  "syncTime": null,
  "config": null
}

Responses

201Currency fetch configuration created successfully
Content-Type: application/json
{
  "config": {
    "id": "00000000-0000-4000-8000-000000000000",
    "organizationId": "00000000-0000-4000-8000-000000000000",
    "tenantId": "00000000-0000-4000-8000-000000000000",
    "provider": "string",
    "isEnabled": true,
    "syncTime": null,
    "lastSyncAt": null,
    "lastSyncStatus": null,
    "lastSyncMessage": null,
    "lastSyncCount": null,
    "config": null,
    "createdAt": "string",
    "updatedAt": "string"
  }
}
400Bad request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/currencies/fetch-configs" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"provider\": \"NBP\",
  \"isEnabled\": false,
  \"syncTime\": null,
  \"config\": null
}"
PUT/currencies/fetch-configs
Auth required

Update currency fetch configuration

Updates an existing currency fetch configuration by id.

Request body (application/json)

{
  "syncTime": null,
  "config": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Currency fetch configuration updated successfully
Content-Type: application/json
{
  "config": {
    "id": "00000000-0000-4000-8000-000000000000",
    "organizationId": "00000000-0000-4000-8000-000000000000",
    "tenantId": "00000000-0000-4000-8000-000000000000",
    "provider": "string",
    "isEnabled": true,
    "syncTime": null,
    "lastSyncAt": null,
    "lastSyncStatus": null,
    "lastSyncMessage": null,
    "lastSyncCount": null,
    "config": null,
    "createdAt": "string",
    "updatedAt": "string"
  }
}
400Bad request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/currencies/fetch-configs" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"syncTime\": null,
  \"config\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/currencies/fetch-configs
Auth required

Delete currency fetch configuration

Deletes a currency fetch configuration by id.

Parameters

NameInRequiredSchemaDescription
idqueryYesanyCurrency fetch configuration identifier to delete

Responses

200Currency fetch configuration deleted successfully
Content-Type: application/json
{
  "success": true
}
400Bad request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/currencies/fetch-configs?id=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/currencies/fetch-rates

Fetch currency rates

Fetches currency exchange rates from configured providers for a specific date.

Request body (application/json)

{}

Responses

200Currency rates fetched successfully
Content-Type: application/json
{
  "totalFetched": 1,
  "byProvider": {
    "key": {
      "count": 1
    }
  },
  "errors": [
    "string"
  ]
}
400Bad request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Internal server error
Content-Type: application/json
{
  "totalFetched": 1,
  "byProvider": {
    "key": {
      "count": 1
    }
  },
  "errors": [
    "string"
  ]
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/currencies/fetch-rates" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d "{}"

Feature Toggles

Showing 12 of 12 endpoints
GET/feature_toggles/check/boolean
Auth required

Check if feature is enabled

Checks if a feature toggle is enabled for the current context.

Parameters

NameInRequiredSchemaDescription
identifierqueryYesanyFeature toggle identifier

Responses

200Feature status
Content-Type: application/json
{
  "enabled": true,
  "source": "override",
  "toggleId": "string",
  "identifier": "string",
  "tenantId": "string"
}
400Bad Request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Tenant not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/check/boolean?identifier=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/check/json
Auth required

Get json config

Gets the json configuration for a feature toggle.

Parameters

NameInRequiredSchemaDescription
identifierqueryYesanyFeature toggle identifier

Responses

200Json config
Content-Type: application/json
{
  "valueType": "json",
  "source": "override",
  "toggleId": "string",
  "identifier": "string",
  "tenantId": "string"
}
400Bad Request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Tenant not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/check/json?identifier=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/check/number
Auth required

Get number config

Gets the number configuration for a feature toggle.

Parameters

NameInRequiredSchemaDescription
identifierqueryYesanyFeature toggle identifier

Responses

200Number config
Content-Type: application/json
{
  "valueType": "number",
  "value": 1,
  "source": "override",
  "toggleId": "string",
  "identifier": "string",
  "tenantId": "string"
}
400Bad Request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Tenant not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/check/number?identifier=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/check/string
Auth required

Get string config

Gets the string configuration for a feature toggle.

Parameters

NameInRequiredSchemaDescription
identifierqueryYesanyFeature toggle identifier

Responses

200String config
Content-Type: application/json
{
  "valueType": "string",
  "value": "string",
  "source": "override",
  "toggleId": "string",
  "identifier": "string",
  "tenantId": "string"
}
400Bad Request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Tenant not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/check/string?identifier=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/global
Auth required

List global feature toggles

Returns all global feature toggles with filtering and pagination. Requires superadmin role.

Parameters

NameInRequiredSchemaDescription
pagequeryNoanyPage number for pagination
pageSizequeryNoanyNumber of items per page (max 200)
searchqueryNoanyCase-insensitive search across identifier, name, description, and category
typequeryNoanyFilter by toggle type (boolean, string, number, json)
categoryqueryNoanyFilter by category (case-insensitive partial match)
namequeryNoanyFilter by name (case-insensitive partial match)
identifierqueryNoanyFilter by identifier (case-insensitive partial match)
sortFieldqueryNoanyField to sort by
sortDirqueryNoanySort direction (ascending or descending)

Responses

200Feature toggles collection
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "identifier": "string",
      "name": "string",
      "description": null,
      "category": null,
      "type": "boolean",
      "defaultValue": null,
      "createdAt": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}
400Invalid query parameters
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden - superadmin role required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/global?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/feature_toggles/global
Auth required

Create global feature toggle

Creates a new global feature toggle. Requires superadmin role.

Request body (application/json)

{
  "identifier": "string",
  "name": "string",
  "description": null,
  "category": null,
  "type": "boolean",
  "defaultValue": null
}

Responses

201Feature toggle created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden - superadmin role required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/feature_toggles/global" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"identifier\": \"string\",
  \"name\": \"string\",
  \"description\": null,
  \"category\": null,
  \"type\": \"boolean\",
  \"defaultValue\": null
}"
PUT/feature_toggles/global
Auth required

Update global feature toggle

Updates an existing global feature toggle. Requires superadmin role.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "description": null,
  "category": null,
  "defaultValue": null
}

Responses

200Feature toggle updated
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden - superadmin role required
Content-Type: application/json
{
  "error": "string"
}
404Feature toggle not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/feature_toggles/global" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"description\": null,
  \"category\": null,
  \"defaultValue\": null
}"
DELETE/feature_toggles/global
Auth required

Delete global feature toggle

Soft deletes a global feature toggle by ID. Requires superadmin role.

Parameters

NameInRequiredSchemaDescription
idqueryYesanyFeature toggle identifier

Responses

200Feature toggle deleted
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Invalid identifier
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden - superadmin role required
Content-Type: application/json
{
  "error": "string"
}
404Feature toggle not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/feature_toggles/global?id=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/global/{id}
Auth required

Fetch feature toggle by ID

Returns complete details of a feature toggle.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Feature toggle detail
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "identifier": "string",
  "name": "string",
  "description": null,
  "category": null,
  "type": "boolean",
  "defaultValue": null,
  "createdAt": null,
  "updatedAt": null
}
400Invalid identifier
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Feature toggle not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/global/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/global/{id}/override
Auth required

Fetch feature toggle override

Returns feature toggle override.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Feature toggle overrides
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "tenantName": "string",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "toggleType": "boolean",
  "updatedAt": null
}
400Invalid request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Feature toggle not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/global/:id/override" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/feature_toggles/overrides
Auth required

List overrides

Returns list of feature toggle overrides.

Parameters

NameInRequiredSchemaDescription
categoryqueryNoany—
namequeryNoany—
identifierqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
pagequeryNoany—
pageSizequeryNoany—

Responses

200List of overrides
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "toggleId": "00000000-0000-4000-8000-000000000000",
      "tenantName": "string",
      "tenantId": "00000000-0000-4000-8000-000000000000",
      "identifier": "string",
      "name": "string",
      "category": "string",
      "isOverride": true
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1,
  "isSuperAdmin": true
}
400Invalid query parameters
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/feature_toggles/overrides?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/feature_toggles/overrides
Auth required

Change override state

Enable, disable or inherit a feature toggle for a specific tenant.

Request body (application/json)

{
  "toggleId": "00000000-0000-4000-8000-000000000000",
  "isOverride": true
}

Responses

200Override updated
Content-Type: application/json
{
  "ok": true,
  "overrideToggleId": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Not found
Content-Type: application/json
{
  "error": "string"
}
500Internal server error
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/feature_toggles/overrides" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"toggleId\": \"00000000-0000-4000-8000-000000000000\",
  \"isOverride\": true
}"

Purchasing

Showing 20 of 30 endpoints
GET/purchasing/purchase-orders
Auth required

List purchase orders

Returns a paginated collection of purchase orders in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
searchqueryNoany—
statusqueryNoany—
supplierIdqueryNoany—
businessNumberqueryNoany—
ownerUserIdqueryNoany—
customerIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated purchase orders
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "number": null,
      "businessNumber": null,
      "productCategory": null,
      "supplierId": "00000000-0000-4000-8000-000000000000",
      "supplierName": null,
      "ownerUserId": null,
      "ownerName": null,
      "customerId": null,
      "customerName": null,
      "status": "draft",
      "currencyCode": "string",
      "subtotal": "string",
      "taxTotal": "string",
      "total": "string",
      "depositPercent": null,
      "depositAmount": null,
      "expectedShipAt": null,
      "placedAt": null,
      "notes": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/purchasing/purchase-orders
Auth required

Create purchase order

Creates a draft purchase order with its lines in the caller’s organization.

Request body (application/json)

{
  "supplierId": "00000000-0000-4000-8000-000000000000",
  "businessNumber": null,
  "productCategory": null,
  "ownerUserId": null,
  "ownerSnapshot": null,
  "customerId": null,
  "customerSnapshot": null,
  "depositPercent": null,
  "depositAmount": null,
  "expectedShipAt": null,
  "notes": null,
  "lines": [
    {
      "productId": null,
      "catalogProductId": null,
      "supplierProductId": null,
      "quantity": 1,
      "unitPrice": 1,
      "taxRate": 0,
      "priceIncludesTax": true,
      "note": null
    }
  ]
}

Responses

201Purchase Order created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"supplierId\": \"00000000-0000-4000-8000-000000000000\",
  \"businessNumber\": null,
  \"productCategory\": null,
  \"ownerUserId\": null,
  \"ownerSnapshot\": null,
  \"customerId\": null,
  \"customerSnapshot\": null,
  \"depositPercent\": null,
  \"depositAmount\": null,
  \"expectedShipAt\": null,
  \"notes\": null,
  \"lines\": [
    {
      \"productId\": null,
      \"catalogProductId\": null,
      \"supplierProductId\": null,
      \"quantity\": 1,
      \"unitPrice\": 1,
      \"taxRate\": 0,
      \"priceIncludesTax\": true,
      \"note\": null
    }
  ]
}"
PUT/purchasing/purchase-orders
Auth required

Update purchase order

Updates a draft purchase order; requires the expected version for optimistic locking.

Request body (application/json)

{
  "businessNumber": null,
  "productCategory": null,
  "ownerUserId": null,
  "ownerSnapshot": null,
  "customerId": null,
  "customerSnapshot": null,
  "depositPercent": null,
  "depositAmount": null,
  "expectedShipAt": null,
  "notes": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Purchase Order updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"businessNumber\": null,
  \"productCategory\": null,
  \"ownerUserId\": null,
  \"ownerSnapshot\": null,
  \"customerId\": null,
  \"customerSnapshot\": null,
  \"depositPercent\": null,
  \"depositAmount\": null,
  \"expectedShipAt\": null,
  \"notes\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/purchasing/purchase-orders
Auth required

Delete purchase order

Soft-deletes a draft or cancelled purchase order.

Responses

200Purchase Order deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/purchasing/purchase-orders/documents
Auth required

List purchase order documents

Returns a paginated collection of purchase order documents in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
orderIdqueryNoany—
docTypequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated purchase order documents
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "orderId": "00000000-0000-4000-8000-000000000000",
      "docType": "supplier_invoice",
      "documentNumber": null,
      "issuedAt": null,
      "attachmentId": null,
      "note": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/documents?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/purchasing/purchase-orders/documents
Auth required

Create purchase order document

Records a document on a purchase order; the file itself lives in attachments.

Request body (application/json)

{
  "orderId": "00000000-0000-4000-8000-000000000000",
  "docType": "supplier_invoice",
  "documentNumber": null,
  "issuedAt": null,
  "attachmentId": null,
  "note": null
}

Responses

201Purchase Order Document created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"orderId\": \"00000000-0000-4000-8000-000000000000\",
  \"docType\": \"supplier_invoice\",
  \"documentNumber\": null,
  \"issuedAt\": null,
  \"attachmentId\": null,
  \"note\": null
}"
PUT/purchasing/purchase-orders/documents
Auth required

Update purchase order document

Updates a purchase order document.

Request body (application/json)

{
  "documentNumber": null,
  "issuedAt": null,
  "attachmentId": null,
  "note": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Purchase Order Document updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"documentNumber\": null,
  \"issuedAt\": null,
  \"attachmentId\": null,
  \"note\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/purchasing/purchase-orders/documents
Auth required

Delete purchase order document

Soft-deletes a purchase order document.

Responses

200Purchase Order Document deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/purchasing/purchase-orders/lines
Auth required

List purchase order lines

Returns a paginated collection of purchase order lines in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
orderIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated purchase order lines
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "orderId": "00000000-0000-4000-8000-000000000000",
      "lineNumber": 1,
      "productId": null,
      "catalogProductId": null,
      "supplierProductId": null,
      "productTitle": null,
      "productSku": null,
      "productUnit": null,
      "supplierSku": null,
      "quantity": "string",
      "receivedQuantity": "string",
      "unitPrice": "string",
      "taxRate": "string",
      "priceIncludesTax": true,
      "netTotal": "string",
      "taxAmount": "string",
      "lineTotal": "string",
      "note": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/lines?page=1&pageSize=100&sortField=line_number&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/purchasing/purchase-orders/payments
Auth required

List purchase payments

Returns a paginated collection of purchase payments in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
orderIdqueryNoany—
stagequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated purchase payments
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "orderId": "00000000-0000-4000-8000-000000000000",
      "stage": "deposit",
      "amount": "string",
      "currencyCode": "string",
      "paidAt": null,
      "reference": null,
      "methodNote": null,
      "created_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/payments?page=1&pageSize=50&sortField=paid_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/purchasing/purchase-orders/payments
Auth required

Create purchase payment

Records a stage payment (deposit/balance/other) against a purchase order.

Request body (application/json)

{
  "orderId": "00000000-0000-4000-8000-000000000000",
  "stage": "deposit",
  "amount": 1,
  "paidAt": "string",
  "reference": null,
  "methodNote": null,
  "attachmentId": null
}

Responses

201Purchase Payment created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/payments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"orderId\": \"00000000-0000-4000-8000-000000000000\",
  \"stage\": \"deposit\",
  \"amount\": 1,
  \"paidAt\": \"string\",
  \"reference\": null,
  \"methodNote\": null,
  \"attachmentId\": null
}"
PUT/purchasing/purchase-orders/payments
Auth required

Purchase Payment management

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/payments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
DELETE/purchasing/purchase-orders/payments
Auth required

Delete purchase payment

Removes a recorded payment while the order is not closed.

Responses

200Purchase Payment deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/payments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/purchasing/purchase-orders/transitions

List purchase order transitions

Returns a paginated collection of purchase order transitions in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated purchase order transitions
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "status": "string"
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/transitions?page=1&pageSize=50" \
  -H "Accept: application/json"
POST/purchasing/purchase-orders/transitions
Auth required

Create purchase order transition

Applies one allowed status transition to a purchase order.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "action": "place"
}

Responses

201Purchase Order Transition created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/purchasing/purchase-orders/transitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"action\": \"place\"
}"
GET/purchasing/supplier-products
Auth required

List supplier products

Returns a paginated collection of supplier products in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
supplierIdqueryNoany—
linkedqueryNoany—
searchqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated supplier products
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "supplierId": "00000000-0000-4000-8000-000000000000",
      "supplierName": null,
      "supplierSku": "string",
      "itemNo": null,
      "brandValue": null,
      "name": "string",
      "nameZh": null,
      "nameEn": null,
      "description": null,
      "declarationElements": null,
      "unit": "string",
      "hsCode": null,
      "supplierCostPrice": null,
      "companyOfferPrice": null,
      "companyOfferSource": null,
      "discountPercent": null,
      "moqQuantity": null,
      "cartonQuantity": null,
      "unitNetWeight": null,
      "unitGrossWeight": null,
      "unitVolume": null,
      "innerPacking": null,
      "productId": null,
      "productSku": null,
      "productName": null,
      "status": "string",
      "source": "string",
      "lastQuoteId": null,
      "notes": null,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/purchasing/supplier-products?linked=all&status=active&page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/purchasing/supplier-products
Auth required

Create supplier product

Adds one item to a supplier’s product library in the caller’s organization. The supplier code is unique per supplier including soft-deleted rows, so a duplicate answers 409 `supplier_product_sku_taken`.

Request body (application/json)

{
  "supplierId": "00000000-0000-4000-8000-000000000000",
  "supplierSku": "string",
  "itemNo": null,
  "brandValue": null,
  "name": "string",
  "nameZh": null,
  "nameEn": null,
  "description": null,
  "declarationElements": null,
  "unit": "PCS",
  "hsCode": null,
  "unitNetWeight": "string",
  "unitGrossWeight": "string",
  "unitVolume": "string",
  "discountPercent": "string",
  "status": "active",
  "notes": null
}

Responses

201Supplier Product created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/purchasing/supplier-products" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"supplierId\": \"00000000-0000-4000-8000-000000000000\",
  \"supplierSku\": \"string\",
  \"itemNo\": null,
  \"brandValue\": null,
  \"name\": \"string\",
  \"nameZh\": null,
  \"nameEn\": null,
  \"description\": null,
  \"declarationElements\": null,
  \"unit\": \"PCS\",
  \"hsCode\": null,
  \"unitNetWeight\": \"string\",
  \"unitGrossWeight\": \"string\",
  \"unitVolume\": \"string\",
  \"discountPercent\": \"string\",
  \"status\": \"active\",
  \"notes\": null
}"
PUT/purchasing/supplier-products
Auth required

Update supplier product

Updates a library row; requires the expected version for optimistic locking. The supplier cannot be changed — a code is only unique per supplier.

Request body (application/json)

{
  "supplierSku": "string",
  "itemNo": null,
  "brandValue": null,
  "name": "string",
  "nameZh": null,
  "nameEn": null,
  "description": null,
  "declarationElements": null,
  "unit": "PCS",
  "hsCode": null,
  "unitNetWeight": "string",
  "unitGrossWeight": "string",
  "unitVolume": "string",
  "discountPercent": "string",
  "status": "active",
  "notes": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Supplier Product updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/purchasing/supplier-products" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"supplierSku\": \"string\",
  \"itemNo\": null,
  \"brandValue\": null,
  \"name\": \"string\",
  \"nameZh\": null,
  \"nameEn\": null,
  \"description\": null,
  \"declarationElements\": null,
  \"unit\": \"PCS\",
  \"hsCode\": null,
  \"unitNetWeight\": \"string\",
  \"unitGrossWeight\": \"string\",
  \"unitVolume\": \"string\",
  \"discountPercent\": \"string\",
  \"status\": \"active\",
  \"notes\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/purchasing/supplier-products
Auth required

Delete supplier product

Soft-deletes a library row. Purchase order lines that reference it keep their frozen snapshot, and the code stays owned until the row is restored.

Responses

200Supplier Product deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/purchasing/supplier-products" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/purchasing/supplier-products/import
Auth required

Add quotation lines to a supplier’s product library

Creates or refreshes one library row per selected quotation line, keyed by `derived_sku ?? item_no` inside the quotation’s supplier. Only non-empty, changed values are written, so re-importing the same quotation reports `skipped` and changes nothing. Per-line failures (a line with no item number, or a code owned by a soft-deleted row) are reported without stopping the other lines.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "lineIds": [
    "00000000-0000-4000-8000-000000000000"
  ]
}

Responses

200Import finished
Content-Type: application/json
{
  "created": 1,
  "updated": 1,
  "skipped": 1,
  "failed": [
    {
      "lineId": "00000000-0000-4000-8000-000000000000",
      "lineNumber": 1,
      "message": "string"
    }
  ]
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Record not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409Concurrent change or illegal state
Content-Type: application/json
{
  "error": "string"
}
422The referenced record or state cannot be used
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/purchasing/supplier-products/import" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"lineIds\": [
    \"00000000-0000-4000-8000-000000000000\"
  ]
}"

Integrations

Showing 8 of 8 endpoints
GET/integrations
Auth required

List integrations

Returns a paginated collection of integrations.

Parameters

NameInRequiredSchemaDescription
qqueryNoany—
categoryqueryNoany—
bundleIdqueryNoany—
isEnabledqueryNoany—
healthStatusqueryNoany—
sortqueryNoany—
orderqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated integrations
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "title": "string",
      "description": null,
      "category": null,
      "tags": [
        "string"
      ],
      "hub": null,
      "providerKey": null,
      "bundleId": null,
      "author": null,
      "company": null,
      "version": null,
      "hasCredentials": true,
      "isEnabled": true,
      "apiVersion": null,
      "healthStatus": "healthy",
      "lastHealthCheckedAt": null,
      "lastHealthLatencyMs": null,
      "enabledAt": null,
      "analytics": {
        "lastActivityAt": null,
        "totalCount": 1,
        "errorCount": 1,
        "errorRate": 1,
        "dailyCounts": [
          1
        ]
      }
    }
  ],
  "total": 1,
  "totalPages": 1,
  "bundles": [
    {
      "id": "string",
      "title": "string",
      "description": "string",
      "icon": null,
      "integrationCount": 1,
      "enabledCount": 1
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/integrations?order=asc&page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/integrations/{id}
Auth required

Get integration detail

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/integrations/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/integrations/{id}/credentials
Auth required

Get or save integration credentials

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/integrations/:id/credentials" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/integrations/{id}/credentials
Auth required

Get or save integration credentials

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/integrations/:id/credentials" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/integrations/{id}/health
Auth required

Run health check for an integration

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/integrations/:id/health" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/integrations/{id}/state
Auth required

Update integration state

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/integrations/:id/state" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/integrations/{id}/version
Auth required

Change integration API version

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/integrations/:id/version" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/integrations/logs
Auth required

List integration logs

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/integrations/logs" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Data Sync

Showing 17 of 17 endpoints
GET/data_sync/mappings
Auth required

List or create field mappings

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/mappings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/data_sync/mappings
Auth required

List or create field mappings

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/data_sync/mappings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/data_sync/mappings/{id}
Auth required

Get, update, or delete a field mapping

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/mappings/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/data_sync/mappings/{id}
Auth required

Get, update, or delete a field mapping

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/data_sync/mappings/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
DELETE/data_sync/mappings/{id}
Auth required

Get, update, or delete a field mapping

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

204Success

No response body.

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/data_sync/mappings/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/data_sync/options
Auth required

List data sync integration options

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/options" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/data_sync/run
Auth required

Start a data sync run

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/data_sync/run" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/data_sync/runs
Auth required

List sync runs

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/runs" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/data_sync/runs/{id}
Auth required

Get sync run detail

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/runs/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/data_sync/runs/{id}/cancel
Auth required

Cancel a running sync

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/data_sync/runs/:id/cancel" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/data_sync/runs/{id}/retry
Auth required

Retry a failed sync run

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/data_sync/runs/:id/retry" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/data_sync/schedules
Auth required

List or create sync schedules

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/schedules" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/data_sync/schedules
Auth required

List or create sync schedules

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/data_sync/schedules" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/data_sync/schedules/{id}
Auth required

Manage a sync schedule

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/data_sync/schedules/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/data_sync/schedules/{id}
Auth required

Manage a sync schedule

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/data_sync/schedules/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
DELETE/data_sync/schedules/{id}
Auth required

Manage a sync schedule

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

204Success

No response body.

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/data_sync/schedules/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/data_sync/validate
Auth required

Validate sync connection

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/data_sync/validate" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Platform Ops

Showing 12 of 12 endpoints
GET/platform_ops/channels
Auth required

List channels

Returns a paginated collection of channels in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
searchqueryNoany—
platformqueryNoany—
isActivequeryYesany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated channels
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "code": "string",
      "platform": "string",
      "externalAccountId": null,
      "currencyCode": "string",
      "isActive": true,
      "notes": null,
      "tenant_id": null,
      "organization_id": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/platform_ops/channels?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/platform_ops/channels
Auth required

Create channel

Creates a storefront binding in the caller’s organization; the code is unique per organization.

Request body (application/json)

{
  "name": "string",
  "code": "string",
  "platform": "string",
  "externalAccountId": null,
  "notes": null
}

Responses

201Channel created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/platform_ops/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"name\": \"string\",
  \"code\": \"string\",
  \"platform\": \"string\",
  \"externalAccountId\": null,
  \"notes\": null
}"
PUT/platform_ops/channels
Auth required

Update channel

Updates a storefront binding; renaming the code to one already in use is rejected with 409.

Request body (application/json)

{
  "externalAccountId": null,
  "notes": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Channel updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/platform_ops/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"externalAccountId\": null,
  \"notes\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/platform_ops/channels
Auth required

Delete channel

Soft-deletes a storefront binding; its orders, settlements and reconciliation items stay in the database.

Responses

200Channel deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/platform_ops/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/platform_ops/orders
Auth required

List order mirrors

The platform’s own view of its orders, stored verbatim. Amounts and status are reported, not recomputed, so a mismatch stays visible to reconciliation.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
channelIdqueryNoany—
searchqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated order mirrors
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "channelId": "00000000-0000-4000-8000-000000000000",
      "externalOrderId": "string",
      "status": null,
      "currencyCode": "string",
      "grossAmount": "string",
      "feeAmount": "string",
      "netAmount": "string",
      "placedAt": null,
      "shipmentNumber": null,
      "syncedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/platform_ops/orders?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/platform_ops/orders/ingest
Auth required

Ingest a batch of platform orders

Upserts each order by `(channel, external order id)`. A re-posted batch reports `unchanged` and writes nothing. Amounts and statuses are stored verbatim as the platform reported them.

Request body (application/json)

{
  "channelId": "00000000-0000-4000-8000-000000000000",
  "orders": [
    {
      "externalOrderId": "string",
      "status": null,
      "placedAt": null,
      "shipmentId": null,
      "shipmentNumber": null
    }
  ]
}

Responses

200Per-batch counts: rows created, rows updated, rows already current.
Content-Type: application/json
{
  "ok": true,
  "created": 1,
  "updated": 1,
  "unchanged": 1
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing the channels.manage feature
Content-Type: application/json
{
  "error": "string"
}
404Unknown channel in this organization
Content-Type: application/json
{
  "error": "string"
}
422Malformed payload or a duplicated external order id in the batch
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/platform_ops/orders/ingest" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"channelId\": \"00000000-0000-4000-8000-000000000000\",
  \"orders\": [
    {
      \"externalOrderId\": \"string\",
      \"status\": null,
      \"placedAt\": null,
      \"shipmentId\": null,
      \"shipmentNumber\": null
    }
  ]
}"
GET/platform_ops/reconciliation
Auth required

List reconciliation items

One disagreement per `(channel, external ref, kind)`, awaiting an operator decision. A resolved item never reopens: a problem that comes back raises a fresh item, so the original problem and its resolution both stay in the trail.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
channelIdqueryNoany—
kindqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated reconciliation items
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "channelId": "00000000-0000-4000-8000-000000000000",
      "kind": "missing_in_erp",
      "externalRef": "string",
      "settlementId": null,
      "orderMirrorId": null,
      "expectedAmount": null,
      "actualAmount": null,
      "currencyCode": null,
      "status": "open",
      "note": null,
      "resolvedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/platform_ops/reconciliation?status=open&page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/platform_ops/reconciliation/ignore
Auth required

Ignore a reconciliation item

Closes an open item as ignored and records the note as its justification. Ignored items stay in the trail and their problem does not raise a new item until it is resolved or a fresh mismatch is found.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "note": "string"
}

Responses

200The item is ignored.
Content-Type: application/json
{
  "ok": true,
  "status": "ignored"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing the reconciliation.manage feature
Content-Type: application/json
{
  "error": "string"
}
404Unknown item in this organization
Content-Type: application/json
{
  "error": "string"
}
422Missing note, or the item is already resolved or ignored
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/platform_ops/reconciliation/ignore" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"note\": \"string\"
}"
POST/platform_ops/reconciliation/resolve
Auth required

Resolve a reconciliation item

Closes an open item as resolved and records the note as its justification. The item keeps its evidence and never reopens; a problem that comes back raises a new item.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "note": "string"
}

Responses

200The item is resolved.
Content-Type: application/json
{
  "ok": true,
  "status": "resolved"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing the reconciliation.manage feature
Content-Type: application/json
{
  "error": "string"
}
404Unknown item in this organization
Content-Type: application/json
{
  "error": "string"
}
422Missing note, or the item is already resolved or ignored
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/platform_ops/reconciliation/resolve" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"note\": \"string\"
}"
GET/platform_ops/settlements
Auth required

List settlements

The platform’s payout statements. `imported` until the settlement has been reconciled; amounts are what the platform paid out, not a recomputation of our books.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
channelIdqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated settlements
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "channelId": "00000000-0000-4000-8000-000000000000",
      "externalSettlementId": "string",
      "periodStart": null,
      "periodEnd": null,
      "currencyCode": "string",
      "grossAmount": "string",
      "feeAmount": "string",
      "netAmount": "string",
      "status": "string",
      "receivedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/platform_ops/settlements?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/platform_ops/settlements/import
Auth required

Import a platform settlement with its lines

Upserts the settlement by `(channel, external settlement id)` and stores its lines. Each line is matched against the order mirror; a missing order, an amount mismatch and a duplicated line each raise at most one open reconciliation item, and re-importing the same statement raises nothing new.

Request body (application/json)

{
  "channelId": "00000000-0000-4000-8000-000000000000",
  "settlement": {
    "externalSettlementId": "string",
    "periodStart": null,
    "periodEnd": null,
    "receivedAt": null
  },
  "lines": [
    {
      "externalOrderId": "string"
    }
  ]
}

Responses

200The stored settlement id, the number of lines written, how many reconciliation items were raised, and how many lines matched an order mirror.
Content-Type: application/json
{
  "ok": true,
  "settlementId": "00000000-0000-4000-8000-000000000000",
  "lines": 1,
  "raised": 1,
  "linked": 1
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing the settlements.manage feature
Content-Type: application/json
{
  "error": "string"
}
404Unknown channel in this organization
Content-Type: application/json
{
  "error": "string"
}
422Malformed payload
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/platform_ops/settlements/import" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"channelId\": \"00000000-0000-4000-8000-000000000000\",
  \"settlement\": {
    \"externalSettlementId\": \"string\",
    \"periodStart\": null,
    \"periodEnd\": null,
    \"receivedAt\": null
  },
  \"lines\": [
    {
      \"externalOrderId\": \"string\"
    }
  ]
}"
GET/platform_ops/settlements/lines
Auth required

List settlement lines

One order’s contribution to a payout. A line whose `orderMirrorId` is null never matched an order mirror — that is what raises a `missing_in_erp` reconciliation item.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
settlementIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated settlement lines
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "settlementId": "00000000-0000-4000-8000-000000000000",
      "externalOrderId": "string",
      "orderMirrorId": null,
      "grossAmount": "string",
      "feeAmount": "string",
      "netAmount": "string"
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/platform_ops/settlements/lines?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Products

Showing 17 of 17 endpoints
GET/products/categories
Auth required

List product categories

Returns a paginated collection of product categories in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
organizationIdqueryNoany—
searchqueryNoany—
parentIdqueryNoany—
rootIdqueryNoany—
isActivequeryYesany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated product categories
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "code": "string",
      "name": "string",
      "nameEn": null,
      "parentId": null,
      "rootId": null,
      "treePath": null,
      "depth": 1,
      "ancestorIds": [
        "string"
      ],
      "childIds": [
        "string"
      ],
      "descendantIds": [
        "string"
      ],
      "sortOrder": 1,
      "isActive": true,
      "organizationId": null,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/products/categories?page=1&pageSize=50&sortField=tree_path&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/products/categories
Auth required

Create product category

Creates a category and rebuilds the organization’s category hierarchy.

Request body (application/json)

{
  "code": "string",
  "name": "string",
  "nameEn": null,
  "parentId": null,
  "sortOrder": 0,
  "isActive": true
}

Responses

201Product Category created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/products/categories" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"code\": \"string\",
  \"name\": \"string\",
  \"nameEn\": null,
  \"parentId\": null,
  \"sortOrder\": 0,
  \"isActive\": true
}"
PUT/products/categories
Auth required

Update product category

Updates a category; a move under itself or a descendant is rejected with 422.

Request body (application/json)

{
  "nameEn": null,
  "parentId": null,
  "sortOrder": 0,
  "isActive": true,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Product Category updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/products/categories" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"nameEn\": null,
  \"parentId\": null,
  \"sortOrder\": 0,
  \"isActive\": true,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/products/categories
Auth required

Delete product category

Soft-deletes an empty, unreferenced category and rebuilds the hierarchy.

Responses

200Product Category deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/products/categories" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/products/items
Auth required

List products

Returns a paginated collection of products in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
organizationIdqueryNoany—
searchqueryNoany—
typeIdqueryNoany—
categoryIdqueryNoany—
statusqueryNoany—
containsLithiumBatteryqueryYesany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated products
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "sku": "string",
      "name": "string",
      "nameEn": null,
      "brand": "string",
      "manufacturerModel": null,
      "typeId": null,
      "categoryId": null,
      "unit": "string",
      "status": "active",
      "containsLithiumBattery": true,
      "hsCode": null,
      "countryOfOriginCode": null,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/products/items?status=active&page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/products/items
Auth required

Create product

Creates a product in the caller’s organization.

Request body (application/json)

{
  "sku": "string",
  "name": "string",
  "nameEn": null,
  "brand": "",
  "series": null,
  "manufacturerModel": null,
  "typeId": null,
  "categoryId": null,
  "specSummary": null,
  "barcode": null,
  "unit": "PCS",
  "hsCode": null,
  "cnCode": null,
  "countryOfOriginCode": null,
  "containsLithiumBattery": false,
  "certifications": null,
  "status": "active",
  "catalogProductId": null,
  "notes": null
}

Responses

201Product created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/products/items" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"sku\": \"string\",
  \"name\": \"string\",
  \"nameEn\": null,
  \"brand\": \"\",
  \"series\": null,
  \"manufacturerModel\": null,
  \"typeId\": null,
  \"categoryId\": null,
  \"specSummary\": null,
  \"barcode\": null,
  \"unit\": \"PCS\",
  \"hsCode\": null,
  \"cnCode\": null,
  \"countryOfOriginCode\": null,
  \"containsLithiumBattery\": false,
  \"certifications\": null,
  \"status\": \"active\",
  \"catalogProductId\": null,
  \"notes\": null
}"
PUT/products/items
Auth required

Update product

Updates a product; requires the expected version for optimistic locking.

Request body (application/json)

{
  "nameEn": null,
  "brand": "",
  "series": null,
  "manufacturerModel": null,
  "typeId": null,
  "categoryId": null,
  "specSummary": null,
  "barcode": null,
  "unit": "PCS",
  "hsCode": null,
  "cnCode": null,
  "countryOfOriginCode": null,
  "containsLithiumBattery": false,
  "certifications": null,
  "status": "active",
  "catalogProductId": null,
  "notes": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Product updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/products/items" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"nameEn\": null,
  \"brand\": \"\",
  \"series\": null,
  \"manufacturerModel\": null,
  \"typeId\": null,
  \"categoryId\": null,
  \"specSummary\": null,
  \"barcode\": null,
  \"unit\": \"PCS\",
  \"hsCode\": null,
  \"cnCode\": null,
  \"countryOfOriginCode\": null,
  \"containsLithiumBattery\": false,
  \"certifications\": null,
  \"status\": \"active\",
  \"catalogProductId\": null,
  \"notes\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/products/items
Auth required

Delete product

Soft-deletes a product. Contracts keep their own snapshots.

Responses

200Product deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/products/items" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/products/items/{id}
Auth required

Get one product with its variants

Scoped read: the product header plus every live variant (SKU) it carries.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200The product aggregate.
Content-Type: application/json
{
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "sku": "string",
    "name": "string",
    "status": "string",
    "catalogProductId": null,
    "variants": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "code": "string",
        "name": "string",
        "barcode": null,
        "status": "active",
        "isDefault": true,
        "attributes": null,
        "sortOrder": 1
      }
    ],
    "updatedAt": null
  }
}
400Malformed id or missing organization scope
Content-Type: application/json
{
  "error": "string"
}
404Product not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/products/items/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/products/prices
Auth required

List product prices

Returns a paginated collection of product prices in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
productIdqueryNoany—
priceTierqueryNoany—
currencyCodequeryNoany—
isActivequeryYesany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated product prices
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "productId": "00000000-0000-4000-8000-000000000000",
      "priceTier": "purchase",
      "currencyCode": "string",
      "minQuantity": 1,
      "unitPrice": "string",
      "startsAt": null,
      "endsAt": null,
      "isActive": true,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/products/prices?page=1&pageSize=50&sortField=price_tier&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/products/prices
Auth required

Create product price

Replaces a product’s whole price set (upsert by tier/currency/min quantity, missing rows deactivated).

Request body (application/json)

{
  "productId": "00000000-0000-4000-8000-000000000000",
  "rows": [
    {
      "id": null,
      "priceTier": "purchase",
      "currencyCode": "string",
      "minQuantity": 1,
      "startsAt": null,
      "endsAt": null,
      "isActive": true
    }
  ]
}

Responses

201Product Price created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/products/prices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"productId\": \"00000000-0000-4000-8000-000000000000\",
  \"rows\": [
    {
      \"id\": null,
      \"priceTier\": \"purchase\",
      \"currencyCode\": \"string\",
      \"minQuantity\": 1,
      \"startsAt\": null,
      \"endsAt\": null,
      \"isActive\": true
    }
  ]
}"
PUT/products/prices
Auth required

Update product price

Replaces a product’s whole price set (upsert by tier/currency/min quantity, missing rows deactivated).

Request body (application/json)

{
  "productId": "00000000-0000-4000-8000-000000000000",
  "rows": [
    {
      "id": null,
      "priceTier": "purchase",
      "currencyCode": "string",
      "minQuantity": 1,
      "startsAt": null,
      "endsAt": null,
      "isActive": true
    }
  ]
}

Responses

200Product Price updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/products/prices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"productId\": \"00000000-0000-4000-8000-000000000000\",
  \"rows\": [
    {
      \"id\": null,
      \"priceTier\": \"purchase\",
      \"currencyCode\": \"string\",
      \"minQuantity\": 1,
      \"startsAt\": null,
      \"endsAt\": null,
      \"isActive\": true
    }
  ]
}"
GET/products/types
Auth required

List product types

Returns a paginated collection of product types in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
organizationIdqueryNoany—
searchqueryNoany—
isActivequeryYesany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated product types
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "code": "string",
      "name": "string",
      "nameEn": null,
      "sortOrder": 1,
      "isActive": true,
      "organizationId": null,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/products/types?page=1&pageSize=50&sortField=sort_order&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/products/types
Auth required

Create product type

Creates a product type in the caller’s organization.

Request body (application/json)

{
  "code": "string",
  "name": "string",
  "nameEn": null,
  "sortOrder": 0,
  "isActive": true
}

Responses

201Product Type created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/products/types" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"code\": \"string\",
  \"name\": \"string\",
  \"nameEn\": null,
  \"sortOrder\": 0,
  \"isActive\": true
}"
PUT/products/types
Auth required

Update product type

Updates a product type; requires the expected version for optimistic locking.

Request body (application/json)

{
  "nameEn": null,
  "sortOrder": 0,
  "isActive": true,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Product Type updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/products/types" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"nameEn\": null,
  \"sortOrder\": 0,
  \"isActive\": true,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/products/types
Auth required

Delete product type

Soft-deletes a product type that no product references.

Responses

200Product Type deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/products/types" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/products/variants/options
Auth required

List product variant options

Scoped SKU option source for pickers: `<product name> · <variant code> — <variant name>`, filtered by code/name/barcode, by ids or by product.

Responses

200Available product variant options.
Content-Type: application/json
{
  "items": [
    {
      "value": "string",
      "label": "string"
    }
  ]
}
400Malformed product id or missing organization scope
Content-Type: application/json
{
  "error": "string"
}
403Missing products.items.view
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/products/variants/options" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Product codes

Showing 8 of 8 endpoints
POST/product_codes/aliases
Auth required

Record a retired product code

Stores the mapping from a code an operator retired to the record it belonged to. The target is checked for existence and scope inside the writing transaction (the id is a cross-module scalar with no foreign key). Requires `product_codes.rules.manage`.

Request body (application/json)

{
  "aliasCode": "string",
  "targetKind": "product",
  "targetId": "00000000-0000-4000-8000-000000000000",
  "note": null
}

Responses

201Alias recorded
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Invalid input, unknown code-list value, or no organization selected
Content-Type: application/json
{
  "error": "string"
}
403The caller lacks the required feature
Content-Type: application/json
{
  "error": "string"
}
404The rule or record was not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409A stale version was submitted, or the name is already taken
Content-Type: application/json
{
  "error": "string"
}
422The rule cannot produce a valid product code
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/product_codes/aliases" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"aliasCode\": \"string\",
  \"targetKind\": \"product\",
  \"targetId\": \"00000000-0000-4000-8000-000000000000\",
  \"note\": null
}"
POST/product_codes/generate
Auth required

Generate a product code

Formats the next code for the rule and code-list values given. `dryRun: true` returns the code the next serial would produce without consuming it; `dryRun: false` writes the number into the issuance ledger, where it stays spent even if the row is never saved — a serial is never reused. The rule is the explicit `ruleId`, else the single active `generate` rule (several active rules are a 400 `rule_ambiguous`, none a 404 `rule_not_found`).

Request body (application/json)

{
  "brandValue": "string",
  "dryRun": false
}

Responses

200Code issued (or previewed)
Content-Type: application/json
{
  "code": "string",
  "ruleId": "00000000-0000-4000-8000-000000000000",
  "ruleName": "string",
  "dryRun": true,
  "ledgerId": null,
  "nextSerial": 1,
  "parts": [
    {
      "key": "string",
      "kind": "string",
      "value": "string",
      "label": null,
      "known": true
    }
  ]
}
400Invalid input, unknown code-list value, or no organization selected
Content-Type: application/json
{
  "error": "string"
}
403The caller lacks the required feature
Content-Type: application/json
{
  "error": "string"
}
404The rule or record was not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409A stale version was submitted, or the name is already taken
Content-Type: application/json
{
  "error": "string"
}
422The rule cannot produce a valid product code
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/product_codes/generate" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"brandValue\": \"string\",
  \"dryRun\": false
}"
GET/product_codes/parse
Auth required

GET /product_codes/parse

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/product_codes/parse" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/product_codes/rules
Auth required

List code rules

Returns a paginated collection of code rules in the current organization scope.

Parameters

NameInRequiredSchemaDescription
searchqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated code rules
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "mode": "string",
      "segments": [
        {}
      ],
      "separator": "string",
      "serialLength": 1,
      "serialScope": "string",
      "enforce": "string",
      "isActive": true,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/product_codes/rules?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/product_codes/rules
Auth required

Create code rule

Stores a rule after checking its worst case against the current brand and category code lists: a rule that could emit a code outside the product SKU charset is refused with the offending problem code.

Request body (application/json)

{
  "name": "string",
  "mode": "generate",
  "segments": [
    {
      "kind": "dictionary",
      "key": "string",
      "dictionaryKey": "string",
      "length": 1,
      "upper": true,
      "join": false
    }
  ],
  "separator": "-",
  "serialLength": 3,
  "serialScope": "brand_category",
  "enforce": "warn",
  "isActive": true
}

Responses

201Code rule created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/product_codes/rules" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"name\": \"string\",
  \"mode\": \"generate\",
  \"segments\": [
    {
      \"kind\": \"dictionary\",
      \"key\": \"string\",
      \"dictionaryKey\": \"string\",
      \"length\": 1,
      \"upper\": true,
      \"join\": false
    }
  ],
  \"separator\": \"-\",
  \"serialLength\": 3,
  \"serialScope\": \"brand_category\",
  \"enforce\": \"warn\",
  \"isActive\": true
}"
PUT/product_codes/rules
Auth required

Update code rule

Updates a rule; requires the rule’s expected version for optimistic locking.

Request body (application/json)

{
  "mode": "generate",
  "separator": "-",
  "serialLength": 3,
  "serialScope": "brand_category",
  "enforce": "warn",
  "isActive": true,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Code rule updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/product_codes/rules" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"mode\": \"generate\",
  \"separator\": \"-\",
  \"serialLength\": 3,
  \"serialScope\": \"brand_category\",
  \"enforce\": \"warn\",
  \"isActive\": true,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/product_codes/rules
Auth required

Delete code rule

Soft-deletes a rule. Codes already issued under it keep working, and its name stays owned.

Responses

200Code rule deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/product_codes/rules" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/product_codes/sequences
Auth required

GET /product_codes/sequences

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/product_codes/sequences" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Sourcing

Showing 19 of 19 endpoints
GET/sourcing/ai-status
Auth required

AI mapping availability

Reports whether a model provider is configured for this deployment, and which provider and model the AI mapping assist would use. No credential is ever returned.

Responses

200Availability
Content-Type: application/json
{
  "available": true,
  "provider": null,
  "model": null
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sourcing/ai-status" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/sourcing/import-profiles
Auth required

List import profiles

Returns a paginated collection of import profiles in the current organization scope.

Parameters

NameInRequiredSchemaDescription
searchqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated import profiles
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "supplierId": null,
      "layoutSignature": "string",
      "sheetName": null,
      "headerRowIndex": 1,
      "usageCount": 1,
      "lastUsedAt": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sourcing/import-profiles?page=1&pageSize=50&sortField=updated_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
DELETE/sourcing/import-profiles
Auth required

Delete import profile

Deletes a saved column mapping. The next workbook with that layout is mapped by the alias dictionary again.

Responses

200Import Profile deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sourcing/import-profiles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/sourcing/quote-lines
Auth required

List quotation lines

Returns a paginated collection of quotation lines in the current organization scope.

Parameters

NameInRequiredSchemaDescription
quoteIdqueryYesany—
rowStatusqueryNoany—
selectedqueryYesany—
searchqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated quotation lines
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "quoteId": "00000000-0000-4000-8000-000000000000",
      "lineNumber": 1,
      "sourceRowNumber": null,
      "sectionLabel": null,
      "itemNo": null,
      "productName": null,
      "variantLabel": null,
      "derivedSku": null,
      "hsCode": null,
      "unit": "string",
      "unitCost": null,
      "currencyCode": null,
      "suggestedRsp": null,
      "moqRaw": null,
      "moqQuantity": null,
      "cartonQuantity": null,
      "unitNetWeight": null,
      "innerPacking": null,
      "raw": null,
      "warnings": [
        "string"
      ],
      "rowStatus": "string",
      "selected": true,
      "promotedProductId": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sourcing/quote-lines?quoteId=00000000-0000-4000-8000-000000000000&page=1&pageSize=50&sortField=line_number&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sourcing/quote-lines
Auth required

Create quotation line

Adds one hand-typed line to a draft quotation.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "sectionLabel": null,
  "itemNo": null,
  "productName": null,
  "derivedSku": null,
  "hsCode": null,
  "description": null,
  "unit": "PCS",
  "unitCost": "string",
  "suggestedRsp": "string",
  "moqRaw": null,
  "unitNetWeight": "string",
  "selected": true
}

Responses

201Quotation Line created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quote-lines" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"sectionLabel\": null,
  \"itemNo\": null,
  \"productName\": null,
  \"derivedSku\": null,
  \"hsCode\": null,
  \"description\": null,
  \"unit\": \"PCS\",
  \"unitCost\": \"string\",
  \"suggestedRsp\": \"string\",
  \"moqRaw\": null,
  \"unitNetWeight\": \"string\",
  \"selected\": true
}"
PUT/sourcing/quote-lines
Auth required

Update quotation line

Saves the review grid in one request (1..200 rows). Every row is version-checked before anything is written; a conflict returns 409 with the row ids to reload.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "rows": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "updatedAt": "string",
      "productName": null,
      "unitCost": "string",
      "sectionLabel": null
    }
  ]
}

Responses

200Quotation Line updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/sourcing/quote-lines" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"rows\": [
    {
      \"id\": \"00000000-0000-4000-8000-000000000000\",
      \"updatedAt\": \"string\",
      \"productName\": null,
      \"unitCost\": \"string\",
      \"sectionLabel\": null
    }
  ]
}"
DELETE/sourcing/quote-lines
Auth required

Delete quotation line

Removes a line from a draft quotation. A promoted line cannot be deleted.

Responses

200Quotation Line deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sourcing/quote-lines" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/sourcing/quotes
Auth required

List supplier quotations

Returns a paginated collection of supplier quotations in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
searchqueryNoany—
statusqueryNoany—
supplierIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated supplier quotations
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "number": null,
      "supplierId": null,
      "supplierNameSnapshot": null,
      "quoteDate": null,
      "validUntil": null,
      "currencyCode": "string",
      "status": "string",
      "sourceKind": "string",
      "sourceFileName": null,
      "sourceSheetName": null,
      "lineCount": 1,
      "promotedCount": 1,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sourcing/quotes?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sourcing/quotes
Auth required

Create supplier quotation

Creates a draft supplier quotation in the caller’s organization.

Request body (application/json)

{
  "supplierId": null,
  "supplierNameSnapshot": null,
  "currencyCode": "CNY",
  "sourceKind": "manual",
  "sourceFileName": null,
  "notes": null
}

Responses

201Supplier Quotation created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"supplierId\": null,
  \"supplierNameSnapshot\": null,
  \"currencyCode\": \"CNY\",
  \"sourceKind\": \"manual\",
  \"sourceFileName\": null,
  \"notes\": null
}"
PUT/sourcing/quotes
Auth required

Update supplier quotation

Updates a draft quotation header; requires the expected version for optimistic locking.

Request body (application/json)

{
  "supplierId": null,
  "supplierNameSnapshot": null,
  "currencyCode": "CNY",
  "sourceKind": "manual",
  "sourceFileName": null,
  "notes": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Supplier Quotation updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/sourcing/quotes" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"supplierId\": null,
  \"supplierNameSnapshot\": null,
  \"currencyCode\": \"CNY\",
  \"sourceKind\": \"manual\",
  \"sourceFileName\": null,
  \"notes\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/sourcing/quotes
Auth required

Delete supplier quotation

Soft-deletes a draft or cancelled quotation. Approved quotations are archived instead.

Responses

200Supplier Quotation deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sourcing/quotes" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/sourcing/quotes/{id}
Auth required

Supplier quotation detail

Returns one quotation in the caller’s organization scope together with its line and promotion counters.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200The quotation
Content-Type: application/json
{
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "number": null,
    "status": "string",
    "currencyCode": "string",
    "supplierId": null,
    "sourceAttachmentId": null,
    "sourceSheetName": null,
    "headerRowIndex": null,
    "lineCount": 1,
    "promotedCount": 1,
    "updatedAt": null
  }
}
400Invalid id or missing organization scope
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Not found in this organization
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sourcing/quotes/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sourcing/quotes/ai-mapping
Auth required

Suggest a column mapping with AI

Sends the header row (and optionally the first three data rows) of the quotation’s stored workbook to the configured model and returns a proposed mapping. Read-only: the suggestion is applied by the operator through the remap endpoint. Returns 503 when no model provider is configured.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "includeSampleRows": true
}

Responses

200Suggestion
Content-Type: application/json
{
  "columns": [],
  "notes": null,
  "provider": null,
  "model": null,
  "sent": {
    "headers": 1,
    "sampleRows": 1
  }
}
400Invalid request
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Quotation not found
Content-Type: application/json
{
  "error": "string"
}
422No workbook or no detectable header row
Content-Type: application/json
{
  "error": "string"
}
502The model call failed
Content-Type: application/json
{
  "error": "string"
}
503No model provider configured
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes/ai-mapping" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"includeSampleRows\": true
}"
POST/sourcing/quotes/approve
Auth required

Approve a supplier quotation

Freezes the quotation: assigns the organization-unique number `SQ-<year>-<4 digits>`, snapshots the supplier name, and requires at least one selected ready line and a currency present in the currency dictionary. Only a draft can be approved, and only once.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Quotation approved
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "number": null,
  "status": "string",
  "approvedAt": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Record not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409Concurrent change or illegal state
Content-Type: application/json
{
  "error": "string"
}
422The workbook or the quotation state cannot be used
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes/approve" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/sourcing/quotes/archive
Auth required

Archive a supplier quotation

Retires an approved quotation from the working list without deleting it or its promoted lines. A draft is deleted rather than archived.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Quotation archived
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "status": "string"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Record not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409Concurrent change or illegal state
Content-Type: application/json
{
  "error": "string"
}
422The workbook or the quotation state cannot be used
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes/archive" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/sourcing/quotes/parse
Auth required

Parse an uploaded quotation workbook

Reads the attachment bound to the quotation, detects its header row, section banners and footer, maps every column (saved profile → standard template → alias dictionary) and replaces the quotation’s staged lines. Refused once any line has been promoted.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "attachmentId": "00000000-0000-4000-8000-000000000000"
}

Responses

200Workbook parsed
Content-Type: application/json
{
  "quote": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "string"
  },
  "sheetName": "string",
  "headerRowIndex": 1,
  "unitRowIndex": null,
  "headerCells": [
    "string"
  ],
  "dataRowCount": 1,
  "lineCount": 1,
  "templateMatched": true,
  "matchedProfileId": null,
  "layoutSignature": "string",
  "detectedCurrency": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Record not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409Concurrent change or illegal state
Content-Type: application/json
{
  "error": "string"
}
422The workbook or the quotation state cannot be used
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes/parse" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"attachmentId\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/sourcing/quotes/promote
Auth required

Promote quotation lines into the product master

Creates or updates products by SKU for the selected lines and merges their `purchase` price row (currency and MOQ from the line) without touching the other price tiers. Missing product categories are created from the line’s section banner. Per-line failures are reported and do not stop the remaining lines; a second run skips what it already promoted.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "force": false
}

Responses

200Promotion finished
Content-Type: application/json
{
  "created": 1,
  "updated": 1,
  "skipped": 1,
  "failed": [
    {
      "lineId": "00000000-0000-4000-8000-000000000000",
      "lineNumber": 1,
      "message": "string"
    }
  ]
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Record not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409Concurrent change or illegal state
Content-Type: application/json
{
  "error": "string"
}
422The workbook or the quotation state cannot be used
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes/promote" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"force\": false
}"
POST/sourcing/quotes/remap
Auth required

Re-map a parsed quotation workbook

Re-reads the stored workbook with the mapping the operator confirmed in the wizard (header row, per-column target fields, section rules) and rebuilds the staged lines. Optionally saves the mapping as a reusable profile for this layout.

Request body (application/json)

{
  "quoteId": "00000000-0000-4000-8000-000000000000",
  "sheetName": "string",
  "headerRowIndex": 1,
  "columnMap": {
    "key": {
      "sourceIndex": 1,
      "sourceHeader": "string"
    }
  },
  "sectionRules": {
    "useSections": true,
    "categoryFromSection": true
  },
  "saveProfile": false
}

Responses

200Lines rebuilt
Content-Type: application/json
{
  "quote": {
    "id": "00000000-0000-4000-8000-000000000000",
    "status": "string"
  },
  "sheetName": "string",
  "headerRowIndex": 1,
  "columns": [],
  "lineCount": 1,
  "matchedProfileId": null,
  "layoutSignature": "string"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}
404Record not found in this organization
Content-Type: application/json
{
  "error": "string"
}
409Concurrent change or illegal state
Content-Type: application/json
{
  "error": "string"
}
422The workbook or the quotation state cannot be used
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sourcing/quotes/remap" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"quoteId\": \"00000000-0000-4000-8000-000000000000\",
  \"sheetName\": \"string\",
  \"headerRowIndex\": 1,
  \"columnMap\": {
    \"key\": {
      \"sourceIndex\": 1,
      \"sourceHeader\": \"string\"
    }
  },
  \"sectionRules\": {
    \"useSections\": true,
    \"categoryFromSection\": true
  },
  \"saveProfile\": false
}"
GET/sourcing/template
Auth required

Download the standard quotation template

Returns an XLSX with the canonical bilingual header row and three example lines. A workbook returned with this header row imports without a manual column mapping.

Responses

200XLSX template
Content-Type: application/json
"string"
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sourcing/template" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Trade Documents

Showing 20 of 20 endpoints
GET/trade_docs/contracts
Auth required

List contracts

Returns a paginated collection of contracts in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
organizationIdqueryNoany—
searchqueryNoany—
directionqueryNoany—
statusqueryNoany—
counterpartyIdqueryNoany—
priceTierqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated contracts
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "number": null,
      "direction": "purchase",
      "status": "draft",
      "counterpartyKind": "string",
      "counterpartyId": null,
      "counterpartyName": null,
      "priceTier": null,
      "currencyCode": "string",
      "contractTotal": "string",
      "financeTotal": "string",
      "differenceTotal": "string",
      "currencyScale": null,
      "signedAt": null,
      "deliveryDate": null,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/contracts?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/trade_docs/contracts
Auth required

Create contract

Creates a draft purchase/sales contract with its lines in the caller’s organization.

Request body (application/json)

{
  "direction": "purchase",
  "counterpartyKind": "supplier",
  "counterpartyId": null,
  "priceTier": null,
  "currencyCode": "CNY",
  "sourceKind": null,
  "sourceId": null,
  "paymentTerms": null,
  "shippingMethod": null,
  "destination": null,
  "marks": null,
  "notes": null,
  "lines": []
}

Responses

201Contract created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/trade_docs/contracts" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"direction\": \"purchase\",
  \"counterpartyKind\": \"supplier\",
  \"counterpartyId\": null,
  \"priceTier\": null,
  \"currencyCode\": \"CNY\",
  \"sourceKind\": null,
  \"sourceId\": null,
  \"paymentTerms\": null,
  \"shippingMethod\": null,
  \"destination\": null,
  \"marks\": null,
  \"notes\": null,
  \"lines\": []
}"
PUT/trade_docs/contracts
Auth required

Update contract

Updates a draft contract (and replaces its lines when provided); requires the expected version.

Request body (application/json)

{
  "direction": "purchase",
  "counterpartyKind": "supplier",
  "counterpartyId": null,
  "priceTier": null,
  "currencyCode": "CNY",
  "sourceKind": null,
  "sourceId": null,
  "paymentTerms": null,
  "shippingMethod": null,
  "destination": null,
  "marks": null,
  "notes": null,
  "lines": [],
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Contract updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/trade_docs/contracts" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"direction\": \"purchase\",
  \"counterpartyKind\": \"supplier\",
  \"counterpartyId\": null,
  \"priceTier\": null,
  \"currencyCode\": \"CNY\",
  \"sourceKind\": null,
  \"sourceId\": null,
  \"paymentTerms\": null,
  \"shippingMethod\": null,
  \"destination\": null,
  \"marks\": null,
  \"notes\": null,
  \"lines\": [],
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/trade_docs/contracts
Auth required

Delete contract

Soft-deletes a draft or cancelled contract.

Responses

200Contract deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/trade_docs/contracts" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/trade_docs/contracts/{id}/document
Auth required

Download contract document

Streams the XLSX document generated for a contract. The contract must be visible to the caller, and the file must have been generated first.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200XLSX document
Content-Type: application/json
"string"
400Invalid contract id or no organization selected
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Contract not found, or no document generated yet
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/:id/document" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/trade_docs/contracts/{id}/document
Auth required

Generate the contract document

Renders the contract to XLSX, stores it as an attachment on the contract and points the contract at it. An issued, signed or closed contract can produce a document.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Generated document reference
Content-Type: application/json
{
  "ok": true,
  "attachmentId": "00000000-0000-4000-8000-000000000000",
  "fileName": "string"
}
400Invalid contract id or no organization selected
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Contract not found
Content-Type: application/json
{
  "error": "string"
}
422The contract is a draft or was cancelled
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/:id/document" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/trade_docs/contracts/attach
Auth required

List contract attachments

Returns a paginated collection of contract attachments in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated contract attachments
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "attachmentId": null
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/attach?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/trade_docs/contracts/attach
Auth required

Update contract attachment

Binds an uploaded stamped/signed scan to the contract, or clears it with `attachmentId: null` (archive + download only; the generated XLSX is untouched).

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "attachmentId": null
}

Responses

200Contract Attachment updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/attach" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"attachmentId\": null
}"
GET/trade_docs/contracts/lines
Auth required

List contract lines

Returns a paginated collection of contract lines in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
contractIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated contract lines
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "contractId": "00000000-0000-4000-8000-000000000000",
      "lineNumber": 1,
      "productId": null,
      "name": null,
      "sku": null,
      "model": null,
      "spec": null,
      "unit": null,
      "quantity": "string",
      "unitPrice": "string",
      "contractAmount": "string",
      "financeAmount": "string",
      "financeSource": "invoice",
      "note": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/lines?page=1&pageSize=200&sortField=line_number&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/trade_docs/contracts/transitions

List contract transitions

Returns a paginated collection of contract transitions in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated contract transitions
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "status": "string"
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/transitions?page=1&pageSize=50" \
  -H "Accept: application/json"
POST/trade_docs/contracts/transitions
Auth required

Create contract transition

Applies one allowed status transition (issue/sign/close/cancel) to a contract.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "action": "issue"
}

Responses

201Contract Transition created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/trade_docs/contracts/transitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"action\": \"issue\"
}"
GET/trade_docs/invoices
Auth required

List invoices

Returns a paginated collection of invoices in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
organizationIdqueryNoany—
searchqueryNoany—
directionqueryNoany—
statusqueryNoany—
contractIdqueryNoany—
counterpartyIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated invoices
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "number": null,
      "direction": "inbound",
      "status": "draft",
      "counterpartyKind": "string",
      "counterpartyId": null,
      "counterpartyName": null,
      "contractId": null,
      "contractNumber": null,
      "currencyCode": "string",
      "subtotal": "string",
      "total": "string",
      "issuedAt": null,
      "attachmentId": null,
      "created_at": null,
      "updated_at": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/invoices?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/trade_docs/invoices
Auth required

Create invoice

Creates a draft invoice (optionally bound to a contract) with its lines.

Request body (application/json)

{
  "number": null,
  "direction": "inbound",
  "counterpartyKind": "supplier",
  "counterpartyId": null,
  "contractId": null,
  "sourceKind": null,
  "sourceId": null,
  "currencyCode": "CNY",
  "notes": null,
  "lines": []
}

Responses

201Invoice created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/trade_docs/invoices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"number\": null,
  \"direction\": \"inbound\",
  \"counterpartyKind\": \"supplier\",
  \"counterpartyId\": null,
  \"contractId\": null,
  \"sourceKind\": null,
  \"sourceId\": null,
  \"currencyCode\": \"CNY\",
  \"notes\": null,
  \"lines\": []
}"
PUT/trade_docs/invoices
Auth required

Update invoice

Updates a draft invoice and replaces its lines when provided; requires the expected version.

Request body (application/json)

{
  "number": null,
  "direction": "inbound",
  "counterpartyKind": "supplier",
  "counterpartyId": null,
  "contractId": null,
  "sourceKind": null,
  "sourceId": null,
  "currencyCode": "CNY",
  "notes": null,
  "lines": [],
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Invoice updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/trade_docs/invoices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"number\": null,
  \"direction\": \"inbound\",
  \"counterpartyKind\": \"supplier\",
  \"counterpartyId\": null,
  \"contractId\": null,
  \"sourceKind\": null,
  \"sourceId\": null,
  \"currencyCode\": \"CNY\",
  \"notes\": null,
  \"lines\": [],
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/trade_docs/invoices
Auth required

Delete invoice

Soft-deletes a draft or void invoice and releases its influence on the contract head.

Responses

200Invoice deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/trade_docs/invoices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/trade_docs/invoices/attach
Auth required

List invoice attachments

Returns a paginated collection of invoice attachments in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated invoice attachments
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "attachmentId": null
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/invoices/attach?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/trade_docs/invoices/attach
Auth required

Update invoice attachment

Binds an uploaded attachment to the invoice (archive + download only).

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "attachmentId": null
}

Responses

200Invoice Attachment updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/trade_docs/invoices/attach" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"attachmentId\": null
}"
GET/trade_docs/invoices/lines
Auth required

List invoice lines

Returns a paginated collection of invoice lines in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
invoiceIdqueryNoany—
contractLineIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated invoice lines
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "invoiceId": "00000000-0000-4000-8000-000000000000",
      "lineNumber": 1,
      "productId": null,
      "description": null,
      "sku": null,
      "unit": null,
      "quantity": "string",
      "unitPrice": "string",
      "amount": "string",
      "contractLineId": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/invoices/lines?page=1&pageSize=200&sortField=line_number&sortDir=asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/trade_docs/invoices/transitions

List invoice transitions

Returns a paginated collection of invoice transitions in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated invoice transitions
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "status": "string"
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/trade_docs/invoices/transitions?page=1&pageSize=50" \
  -H "Accept: application/json"
POST/trade_docs/invoices/transitions
Auth required

Create invoice transition

Confirms or voids an invoice and recomputes the bound contract’s totals.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "action": "confirm"
}

Responses

201Invoice Transition created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/trade_docs/invoices/transitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"action\": \"confirm\"
}"

Export Finance

Showing 14 of 14 endpoints
GET/export_finance/collection-documents
Auth required

List collection documents

Returns a paginated collection of collection documents in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
collectionIdqueryNoany—
docTypequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated collection documents
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "collectionId": "00000000-0000-4000-8000-000000000000",
      "docType": "foreign_income_certificate",
      "issuedAt": null,
      "attachmentId": null,
      "note": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/export_finance/collection-documents?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/export_finance/collection-documents
Auth required

Create collection document

Records one 涉外收入证明 (or other file) on an order-level collection record.

Request body (application/json)

{
  "collectionId": "00000000-0000-4000-8000-000000000000",
  "docType": "foreign_income_certificate",
  "issuedAt": null,
  "attachmentId": null,
  "note": null
}

Responses

201Collection Document created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/export_finance/collection-documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"collectionId\": \"00000000-0000-4000-8000-000000000000\",
  \"docType\": \"foreign_income_certificate\",
  \"issuedAt\": null,
  \"attachmentId\": null,
  \"note\": null
}"
PUT/export_finance/collection-documents
Auth required

Update collection document

Updates a collection document.

Request body (application/json)

{
  "issuedAt": null,
  "attachmentId": null,
  "note": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Collection Document updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/export_finance/collection-documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"issuedAt\": null,
  \"attachmentId\": null,
  \"note\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/export_finance/collection-documents
Auth required

Delete collection document

Soft-deletes a collection document.

Responses

200Collection Document deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/export_finance/collection-documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/export_finance/collections
Auth required

List collection records

Returns a paginated collection of collection records in the current organization scope.

Parameters

NameInRequiredSchemaDescription
purchaseOrderIdqueryYesany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated collection records
Content-Type: application/json
{
  "item": null
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/export_finance/collections?purchaseOrderId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/export_finance/collections
Auth required

Update collection record

Upserts the 收汇档案 of one purchase order; the record is created on first save and updated afterwards.

Request body (application/json)

{
  "purchaseOrderId": "00000000-0000-4000-8000-000000000000",
  "purchaseOrderNumber": null,
  "currencyCode": "CNY",
  "collectionStatus": "received",
  "updatedAt": null
}

Responses

200Collection Record updated
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/export_finance/collections" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"purchaseOrderId\": \"00000000-0000-4000-8000-000000000000\",
  \"purchaseOrderNumber\": null,
  \"currencyCode\": \"CNY\",
  \"collectionStatus\": \"received\",
  \"updatedAt\": null
}"
GET/export_finance/container-files

List the 柜档案 (container file): container facts, orders with allocated refunds, and the refund application

Parameters

NameInRequiredSchemaDescription
shipmentIdqueryNoany—
statusqueryNoany—
taxRefundStatusqueryNoany—
searchqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
formatqueryNoany—

Responses

200Container file rows, or a CSV export when `format=csv`
Content-Type: application/json
{
  "items": [
    {
      "shipmentId": "00000000-0000-4000-8000-000000000000",
      "shipmentNumber": null,
      "shipmentStatus": "draft",
      "currentMilestone": null,
      "carrierName": null,
      "departurePort": null,
      "departedAt": null,
      "receivedAt": null,
      "etd": null,
      "eta": null,
      "containerType": null,
      "containerNumber": null,
      "sealNumber": null,
      "bookingNumber": null,
      "orders": [
        {
          "purchaseOrderId": "00000000-0000-4000-8000-000000000000",
          "number": null,
          "businessNumber": null,
          "ownerName": null,
          "customerName": null,
          "total": "string",
          "allocatedRefundAmount": null,
          "sharePercent": null
        }
      ],
      "taxRefundStatus": "completed",
      "taxRefundAmount": null,
      "taxRefundNote": null,
      "checklist": {
        "so": true,
        "telexRelease": true,
        "customsDeclaration": true,
        "domesticFreight": true,
        "bookingCharges": true,
        "taxRefundPackage": true,
        "reportDraft": true
      },
      "checklistMissing": [
        "string"
      ]
    }
  ],
  "total": 1,
  "totalPages": 1
}
400Invalid query or unresolvable organization scope
Content-Type: application/json
"string"
401Unauthorized
Content-Type: application/json
"string"
403Missing export_finance.cabinets.view
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/export_finance/container-files?page=1&pageSize=50&sortField=departed_at&sortDir=desc" \
  -H "Accept: application/json"
GET/export_finance/order-files

List the 订单档案 (order file) in both the business and the finance view

Parameters

NameInRequiredSchemaDescription
purchaseOrderIdqueryNoany—
viewqueryNoany—
statusqueryNoany—
collectionStatusqueryNoany—
taxRefundStatusqueryNoany—
searchqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
formatqueryNoany—

Responses

200Order file rows, or a CSV export when `format=csv`
Content-Type: application/json
{
  "items": [
    {
      "purchaseOrderId": "00000000-0000-4000-8000-000000000000",
      "number": null,
      "businessNumber": null,
      "supplierName": null,
      "ownerName": null,
      "customerName": null,
      "productCategory": null,
      "businessStatus": "cancelled",
      "placedAt": null,
      "expectedDeliveryAt": null,
      "shipmentEtd": null,
      "shipmentDepartedAt": null,
      "receivedAt": null,
      "containerType": null,
      "containerNumber": null,
      "sealNumber": null,
      "bookingNumber": null,
      "shipmentCount": 1,
      "finance": {
        "orderAmount": "string",
        "depositPlanned": null,
        "balancePlanned": null,
        "paidAmount": "string",
        "outstandingAmount": "string",
        "kcPriceAmount": null,
        "kcPriceCurrency": null,
        "subsidiaryInvoiceAmount": null,
        "subsidiaryInvoiceCurrency": null,
        "exchangeRate": null
      },
      "collectionStatus": "received",
      "refundStatus": "completed",
      "allocatedRefundAmount": null,
      "containers": [
        {
          "shipmentId": "00000000-0000-4000-8000-000000000000",
          "shipmentNumber": null,
          "status": "string",
          "currentMilestone": null,
          "containerNumber": null,
          "departedAt": null,
          "receivedAt": null,
          "taxRefundStatus": "completed",
          "taxRefundAmount": null,
          "taxRefundNote": null
        }
      ],
      "checklist": {
        "supplierInvoice": true,
        "packingList": true,
        "purchasePaymentReceipt": true,
        "purchaseContract": true,
        "salesContract": true,
        "kcInvoiceStamped": true,
        "foreignIncomeCertificate": true,
        "so": true,
        "telexRelease": true,
        "customsDeclaration": true,
        "domesticFreight": true,
        "bookingCharges": true
      },
      "checklistMissing": [
        "string"
      ]
    }
  ],
  "total": 1,
  "totalPages": 1
}
400Invalid query or unresolvable organization scope
Content-Type: application/json
"string"
401Unauthorized
Content-Type: application/json
"string"
403Missing export_finance.orders.view
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/export_finance/order-files?view=business&page=1&pageSize=50&sortField=placed_at&sortDir=desc" \
  -H "Accept: application/json"
GET/export_finance/refund-documents
Auth required

List refund documents

Returns a paginated collection of refund documents in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
refundIdqueryNoany—
docTypequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated refund documents
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "refundId": "00000000-0000-4000-8000-000000000000",
      "docType": "tax_refund_package",
      "issuedAt": null,
      "attachmentId": null,
      "note": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/export_finance/refund-documents?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/export_finance/refund-documents
Auth required

Create refund document

Records one 报告草单 / 出口退税资料整理 file on a container-level refund record.

Request body (application/json)

{
  "refundId": "00000000-0000-4000-8000-000000000000",
  "docType": "tax_refund_package",
  "issuedAt": null,
  "attachmentId": null,
  "note": null
}

Responses

201Refund Document created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/export_finance/refund-documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"refundId\": \"00000000-0000-4000-8000-000000000000\",
  \"docType\": \"tax_refund_package\",
  \"issuedAt\": null,
  \"attachmentId\": null,
  \"note\": null
}"
PUT/export_finance/refund-documents
Auth required

Update refund document

Updates a refund document.

Request body (application/json)

{
  "issuedAt": null,
  "attachmentId": null,
  "note": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Refund Document updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/export_finance/refund-documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"issuedAt\": null,
  \"attachmentId\": null,
  \"note\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/export_finance/refund-documents
Auth required

Delete refund document

Soft-deletes a refund document.

Responses

200Refund Document deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/export_finance/refund-documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/export_finance/refunds
Auth required

List tax refund records

Returns a paginated collection of tax refund records in the current organization scope.

Parameters

NameInRequiredSchemaDescription
shipmentIdqueryYesany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated tax refund records
Content-Type: application/json
{
  "item": null
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/export_finance/refunds?shipmentId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/export_finance/refunds
Auth required

Update tax refund record

Upserts the 出口退税档案 of one container; a shipment that is missing or cancelled is refused with 409.

Request body (application/json)

{
  "shipmentId": "00000000-0000-4000-8000-000000000000",
  "shipmentNumber": null,
  "currencyCode": "CNY",
  "taxRefundStatus": "completed",
  "taxRefundNote": null,
  "updatedAt": null
}

Responses

200Tax Refund Record updated
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/export_finance/refunds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"shipmentId\": \"00000000-0000-4000-8000-000000000000\",
  \"shipmentNumber\": null,
  \"currencyCode\": \"CNY\",
  \"taxRefundStatus\": \"completed\",
  \"taxRefundNote\": null,
  \"updatedAt\": null
}"

Parties

Showing 6 of 6 endpoints
GET/parties
Auth required

List parties

Returns a paginated collection of parties in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
searchqueryNoany—
statusqueryNoany—
countryCodequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated parties
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "code": "string",
      "name": "string",
      "countryCode": null,
      "status": "string",
      "contactName": null,
      "contactPhone": null,
      "email": null,
      "addressLine1": null,
      "addressLine2": null,
      "city": null,
      "tenant_id": null,
      "organization_id": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/parties?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/parties
Auth required

Create party

Creates a party (with its roles and bank block) in the caller’s organization.

Request body (application/json)

{
  "code": "string",
  "name": "string",
  "countryCode": null,
  "contactName": null,
  "contactPhone": null,
  "email": null,
  "addressLine1": null,
  "addressLine2": null,
  "city": null
}

Responses

201Party created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/parties" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"code\": \"string\",
  \"name\": \"string\",
  \"countryCode\": null,
  \"contactName\": null,
  \"contactPhone\": null,
  \"email\": null,
  \"addressLine1\": null,
  \"addressLine2\": null,
  \"city\": null
}"
PUT/parties
Auth required

Update party

Updates a party; requires the expected version for optimistic locking.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "countryCode": null,
  "contactName": null,
  "contactPhone": null,
  "email": null,
  "addressLine1": null,
  "addressLine2": null,
  "city": null
}

Responses

200Party updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/parties" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"countryCode\": null,
  \"contactName\": null,
  \"contactPhone\": null,
  \"email\": null,
  \"addressLine1\": null,
  \"addressLine2\": null,
  \"city\": null
}"
DELETE/parties
Auth required

Delete party

Soft-deletes a party.

Responses

200Party deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/parties" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/parties/{id}
Auth required

Get one party with its roles and bank accounts

Scoped read; encrypted fields are decrypted for the response.

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200The party aggregate.
Content-Type: application/json
{
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "code": "string",
    "name": "string",
    "countryCode": null,
    "status": "string",
    "contactName": null,
    "contactPhone": null,
    "email": null,
    "addressLine1": null,
    "addressLine2": null,
    "city": null,
    "roles": [
      "string"
    ],
    "bankAccounts": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "beneficiaryBank": "string",
        "accountNumber": "string",
        "swiftCode": null,
        "bankAddress": null,
        "isDefault": true
      }
    ],
    "updatedAt": null
  }
}
400Malformed id or missing organization scope
Content-Type: application/json
{
  "error": "string"
}
404Party not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/parties/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/parties/options
Auth required

List party options

Scoped option source for pickers: display names only, filtered by code (the plaintext column). Encrypted fields are decrypted for the response but never used as a filter.

Responses

200Available party options.
Content-Type: application/json
{
  "items": [
    {
      "value": "string",
      "label": "string"
    }
  ]
}
403Missing parties.view
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/parties/options" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

S3-Compatible Storage

Showing 6 of 6 endpoints
DELETE/storage-providers/s3/delete

Delete file from S3

Responses

204Success

No response body.

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/storage-providers/s3/delete" \
  -H "Accept: application/json"
GET/storage-providers/s3/download

Download file from S3

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/storage-providers/s3/download" \
  -H "Accept: application/json"
GET/storage-providers/s3/list

List S3 objects

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/storage-providers/s3/list" \
  -H "Accept: application/json"
PUT/storage-providers/s3/signed-upload/:token

Upload through a bounded one-time compatibility URL

Responses

200Success response
Content-Type: application/json
"string"

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/storage-providers/s3/signed-upload/:token" \
  -H "Accept: application/json"
POST/storage-providers/s3/signed-url

Generate S3 pre-signed URL

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/storage-providers/s3/signed-url" \
  -H "Accept: application/json"
POST/storage-providers/s3/upload

Upload file to S3

Responses

201Success response
Content-Type: application/json
"string"

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/storage-providers/s3/upload" \
  -H "Accept: application/json"

Auth

Showing 1 of 1 endpoints
GET/auth/users/consents
Auth required

List user consents

Returns all consent records for a given user, with integrity verification status.

Parameters

NameInRequiredSchemaDescription
userIdqueryYesany—

Responses

200Consent list returned
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/auth/users/consents?userId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Catalog

Showing 20 of 37 endpoints
GET/catalog/categories
Auth required

List categories

Returns a paginated collection of categories scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
viewqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
statusqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated categories
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "slug": null,
      "description": null,
      "parentId": null,
      "parentName": null,
      "depth": 1,
      "treePath": "string",
      "pathLabel": "string",
      "childCount": 1,
      "descendantCount": 1,
      "isActive": true,
      "updatedAt": null,
      "organizationId": null,
      "tenantId": "00000000-0000-4000-8000-000000000000"
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/catalog/categories?view=manage&page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/catalog/categories
Auth required

Create category

Creates a new product category.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "slug": null,
  "parentId": null
}

Responses

201Category created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/catalog/categories" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"name\": \"string\",
  \"slug\": null,
  \"parentId\": null
}"
PUT/catalog/categories
Auth required

Update category

Updates an existing category by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "slug": null,
  "parentId": null
}

Responses

200Category updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/catalog/categories" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"slug\": null,
  \"parentId\": null
}"
DELETE/catalog/categories
Auth required

Delete category

Deletes a category by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Category deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/catalog/categories" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/catalog/dictionaries/{key}
Auth required

Get dictionary entries by key

Returns dictionary entries for a specific key (e.g., currency, unit).

Parameters

NameInRequiredSchemaDescription
keypathYesany—

Responses

200Dictionary entries
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "entries": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "value": "string",
      "label": "string",
      "color": null,
      "icon": null
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/catalog/dictionaries/:key" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/catalog/offers
Auth required

List offers

Returns a paginated collection of offers scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
productIdqueryNoany—
channelIdqueryNoany—
channelIdsqueryNoany—
idqueryNoany—
searchqueryNoany—
isActivequeryNoany—
withDeletedqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated offers
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "productId": null,
      "organizationId": null,
      "tenantId": null,
      "channelId": null,
      "title": "string",
      "description": null,
      "defaultMediaId": null,
      "defaultMediaUrl": null,
      "metadata": null,
      "isActive": null,
      "createdAt": null,
      "updatedAt": null,
      "product": null,
      "productChannelPrice": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/catalog/offers?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/catalog/offers
Auth required

Create offer

Creates a new offer linking a product to a sales channel.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "channelId": "00000000-0000-4000-8000-000000000000",
  "title": "string",
  "defaultMediaId": null,
  "defaultMediaUrl": null,
  "productId": "00000000-0000-4000-8000-000000000000"
}

Responses

201Offer created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/catalog/offers" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"channelId\": \"00000000-0000-4000-8000-000000000000\",
  \"title\": \"string\",
  \"defaultMediaId\": null,
  \"defaultMediaUrl\": null,
  \"productId\": \"00000000-0000-4000-8000-000000000000\"
}"
PUT/catalog/offers
Auth required

Update offer

Updates an existing offer by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "defaultMediaId": null,
  "defaultMediaUrl": null
}

Responses

200Offer updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/catalog/offers" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"defaultMediaId\": null,
  \"defaultMediaUrl\": null
}"
DELETE/catalog/offers
Auth required

Delete offer

Deletes an offer by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Offer deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/catalog/offers" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/catalog/option-schemas
Auth required

List option schemas

Returns a paginated collection of option schemas scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
idqueryNoany—
searchqueryNoany—
isActivequeryNoany—
withDeletedqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated option schemas
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "code": null,
      "description": null,
      "schema": null,
      "metadata": null,
      "is_active": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/catalog/option-schemas?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/catalog/option-schemas
Auth required

Create option schema

Creates a new option schema template for product configurations.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "schema": {
    "options": [
      {
        "code": "string",
        "label": "string",
        "inputType": "select"
      }
    ]
  }
}

Responses

201Option Schema created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/catalog/option-schemas" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"name\": \"string\",
  \"schema\": {
    \"options\": [
      {
        \"code\": \"string\",
        \"label\": \"string\",
        \"inputType\": \"select\"
      }
    ]
  }
}"
PUT/catalog/option-schemas
Auth required

Update option schema

Updates an existing option schema by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Option Schema updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/catalog/option-schemas" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/catalog/option-schemas
Auth required

Delete option schema

Deletes an option schema by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Option Schema deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/catalog/option-schemas" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/catalog/price-kinds
Auth required

List price kinds

Returns a paginated collection of price kinds scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
isPromotionqueryNoany—
isActivequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated price kinds
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "organization_id": null,
      "tenant_id": null,
      "code": "string",
      "title": "string",
      "display_mode": null,
      "currency_code": null,
      "is_promotion": null,
      "is_active": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/catalog/price-kinds?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/catalog/price-kinds
Auth required

Create price kind

Creates a new price kind for categorizing product prices.

Request body (application/json)

{
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "code": "string",
  "title": "string",
  "displayMode": "excluding-tax"
}

Responses

201Price Kind created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/catalog/price-kinds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"code\": \"string\",
  \"title\": \"string\",
  \"displayMode\": \"excluding-tax\"
}"
PUT/catalog/price-kinds
Auth required

Update price kind

Updates an existing price kind by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "displayMode": "excluding-tax"
}

Responses

200Price Kind updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/catalog/price-kinds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"displayMode\": \"excluding-tax\"
}"
DELETE/catalog/price-kinds
Auth required

Delete price kind

Deletes a price kind by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Price Kind deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/catalog/price-kinds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/catalog/prices
Auth required

List prices

Returns a paginated collection of prices scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
productIdqueryNoany—
variantIdqueryNoany—
offerIdqueryNoany—
channelIdqueryNoany—
currencyCodequeryNoany—
priceKindIdqueryNoany—
kindqueryNoany—
userIdqueryNoany—
userGroupIdqueryNoany—
customerIdqueryNoany—
customerGroupIdqueryNoany—
quantityqueryNoany—
quantityUnitqueryNoany—
withDeletedqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated prices
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "product_id": null,
      "variant_id": null,
      "offer_id": null,
      "currency_code": null,
      "price_kind_id": null,
      "kind": null,
      "min_quantity": null,
      "max_quantity": null,
      "unit_price_net": null,
      "unit_price_gross": null,
      "tax_rate": null,
      "tax_amount": null,
      "channel_id": null,
      "user_id": null,
      "user_group_id": null,
      "customer_id": null,
      "customer_group_id": null,
      "metadata": null,
      "starts_at": null,
      "ends_at": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/catalog/prices?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/catalog/prices
Auth required

Create price

Creates a new price entry for a product or variant.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "currencyCode": "string",
  "priceKindId": "00000000-0000-4000-8000-000000000000",
  "taxRateId": null
}

Responses

201Price created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/catalog/prices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"currencyCode\": \"string\",
  \"priceKindId\": \"00000000-0000-4000-8000-000000000000\",
  \"taxRateId\": null
}"
PUT/catalog/prices
Auth required

Update price

Updates an existing price by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "taxRateId": null
}

Responses

200Price updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/catalog/prices" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"taxRateId\": null
}"

Configs

Showing 8 of 8 endpoints
GET/configs/cache
Auth required

Get cache statistics

Returns detailed cache statistics including total entries and breakdown by cache segments. Requires cache service to be available.

Responses

200Cache statistics
Content-Type: application/json
{
  "generatedAt": "string",
  "totalKeys": 1,
  "segments": [
    {
      "segment": "string",
      "resource": null,
      "method": null,
      "path": null,
      "keyCount": 1,
      "keys": [
        "string"
      ]
    }
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Failed to resolve cache stats
Content-Type: application/json
{
  "error": "string"
}
503Cache service unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/configs/cache" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/configs/cache
Auth required

Purge cache

Purges cache entries. Supports two actions: purgeAll (clears entire cache) or purgeSegment (clears specific segment). Returns updated cache statistics after purge.

Request body (application/json)

{
  "action": "purgeAll"
}

Responses

200Cache segment cleared successfully
Content-Type: application/json
{
  "action": "purgeSegment",
  "segment": "string",
  "deleted": 1,
  "stats": {
    "generatedAt": "string",
    "totalKeys": 1,
    "segments": [
      {
        "segment": "string",
        "resource": null,
        "method": null,
        "path": null,
        "keyCount": 1,
        "keys": [
          "string"
        ]
      }
    ]
  }
}
400Invalid request - missing segment identifier for purgeSegment action
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Failed to purge cache
Content-Type: application/json
{
  "error": "string"
}
503Cache service unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/configs/cache" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"action\": \"purgeAll\"
}"
GET/configs/module-telemetry
Auth required

Get module resource usage telemetry

Returns in-process module resource attribution for API routes, event subscribers, and queue workers.

Responses

200Module resource usage report
Content-Type: application/json
{
  "generatedAt": "string",
  "startedAt": "string",
  "enabled": true,
  "bucketIntervalMs": 1,
  "totals": {
    "modules": 1,
    "operations": 1,
    "calls": 1,
    "errors": 1,
    "totalDurationMs": 1,
    "totalCpuMs": 1,
    "positiveHeapDeltaBytes": 1,
    "positiveRssDeltaBytes": 1
  },
  "thresholds": {
    "p95DurationMs": 1,
    "cpuMs": 1,
    "positiveHeapDeltaBytes": 1,
    "positiveRssDeltaBytes": 1,
    "errors": 1
  },
  "modules": [
    {
      "moduleId": "string",
      "calls": 1,
      "errors": 1,
      "totalDurationMs": 1,
      "p95DurationMs": 1,
      "totalCpuMs": 1,
      "positiveHeapDeltaBytes": 1,
      "positiveRssDeltaBytes": 1,
      "surfaces": [
        {
          "surface": "api",
          "calls": 1,
          "errors": 1,
          "totalDurationMs": 1,
          "p95DurationMs": 1,
          "totalCpuMs": 1,
          "positiveHeapDeltaBytes": 1,
          "positiveRssDeltaBytes": 1
        }
      ],
      "topOperations": [
        {
          "moduleId": "string",
          "surface": "api",
          "operation": "string",
          "resourceId": null,
          "calls": 1,
          "errors": 1,
          "totalDurationMs": 1,
          "maxDurationMs": 1,
          "p95DurationMs": 1,
          "totalCpuUserMs": 1,
          "totalCpuSystemMs": 1,
          "maxCpuMs": 1,
          "totalHeapDeltaBytes": 1,
          "positiveHeapDeltaBytes": 1,
          "maxHeapDeltaBytes": 1,
          "totalRssDeltaBytes": 1,
          "positiveRssDeltaBytes": 1,
          "maxRssDeltaBytes": 1,
          "firstSeenAt": "string",
          "lastSeenAt": "string"
        }
      ],
      "candidateReasons": [
        "string"
      ]
    }
  ],
  "candidates": [
    {
      "moduleId": "string",
      "calls": 1,
      "errors": 1,
      "totalDurationMs": 1,
      "p95DurationMs": 1,
      "totalCpuMs": 1,
      "positiveHeapDeltaBytes": 1,
      "positiveRssDeltaBytes": 1,
      "surfaces": [
        {
          "surface": "api",
          "calls": 1,
          "errors": 1,
          "totalDurationMs": 1,
          "p95DurationMs": 1,
          "totalCpuMs": 1,
          "positiveHeapDeltaBytes": 1,
          "positiveRssDeltaBytes": 1
        }
      ],
      "topOperations": [
        {
          "moduleId": "string",
          "surface": "api",
          "operation": "string",
          "resourceId": null,
          "calls": 1,
          "errors": 1,
          "totalDurationMs": 1,
          "maxDurationMs": 1,
          "p95DurationMs": 1,
          "totalCpuUserMs": 1,
          "totalCpuSystemMs": 1,
          "maxCpuMs": 1,
          "totalHeapDeltaBytes": 1,
          "positiveHeapDeltaBytes": 1,
          "maxHeapDeltaBytes": 1,
          "totalRssDeltaBytes": 1,
          "positiveRssDeltaBytes": 1,
          "maxRssDeltaBytes": 1,
          "firstSeenAt": "string",
          "lastSeenAt": "string"
        }
      ],
      "candidateReasons": [
        "string"
      ]
    }
  ],
  "buckets": [
    {
      "bucketStart": "string",
      "bucketEnd": "string",
      "bucketIntervalMs": 1,
      "stage": "startup",
      "partial": true,
      "totals": {
        "modules": 1,
        "calls": 1,
        "errors": 1,
        "totalDurationMs": 1,
        "totalCpuMs": 1,
        "positiveHeapDeltaBytes": 1,
        "positiveRssDeltaBytes": 1
      },
      "modules": [
        {
          "moduleId": "string",
          "calls": 1,
          "errors": 1,
          "totalDurationMs": 1,
          "p95DurationMs": 1,
          "totalCpuMs": 1,
          "positiveHeapDeltaBytes": 1,
          "positiveRssDeltaBytes": 1,
          "surfaces": [
            {
              "surface": "api",
              "calls": 1,
              "errors": 1,
              "totalDurationMs": 1,
              "p95DurationMs": 1,
              "totalCpuMs": 1,
              "positiveHeapDeltaBytes": 1,
              "positiveRssDeltaBytes": 1
            }
          ],
          "topOperations": [
            {
              "moduleId": "string",
              "surface": "api",
              "operation": "string",
              "resourceId": null,
              "calls": 1,
              "errors": 1,
              "totalDurationMs": 1,
              "maxDurationMs": 1,
              "p95DurationMs": 1,
              "totalCpuUserMs": 1,
              "totalCpuSystemMs": 1,
              "maxCpuMs": 1,
              "totalHeapDeltaBytes": 1,
              "positiveHeapDeltaBytes": 1,
              "maxHeapDeltaBytes": 1,
              "totalRssDeltaBytes": 1,
              "positiveRssDeltaBytes": 1,
              "maxRssDeltaBytes": 1,
              "firstSeenAt": "string",
              "lastSeenAt": "string"
            }
          ],
          "candidateReasons": [
            "string"
          ]
        }
      ]
    }
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/configs/module-telemetry" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
DELETE/configs/module-telemetry
Auth required

Clear module telemetry data

Development-only endpoint that clears in-memory module telemetry and local process telemetry files.

Responses

200Module telemetry cleared
Content-Type: application/json
{
  "cleared": true
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden outside development mode
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/configs/module-telemetry" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/configs/system-status
Auth required

Get system health status

Returns comprehensive system health information including environment details, version, resource usage, and service connectivity status.

Responses

200System status snapshot
Content-Type: application/json
{
  "generatedAt": "string",
  "runtimeMode": "development",
  "categories": [
    {
      "key": "profiling",
      "labelKey": "string",
      "descriptionKey": null,
      "items": [
        {
          "key": "string",
          "category": "profiling",
          "kind": "boolean",
          "labelKey": "string",
          "descriptionKey": "string",
          "docUrl": null,
          "defaultValue": null,
          "state": "enabled",
          "value": null,
          "normalizedValue": null
        }
      ]
    }
  ]
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Failed to load system status
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/configs/system-status" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/configs/system-status
Auth required

Clear system cache

Purges the entire cache for the current tenant. Useful for troubleshooting or forcing fresh data loading.

Responses

200Cache cleared successfully
Content-Type: application/json
{
  "cleared": true
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Failed to purge cache
Content-Type: application/json
{
  "error": "string"
}
503Cache service unavailable
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/configs/system-status" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/configs/upgrade-actions
Auth required

List pending upgrade actions

Returns a list of pending upgrade actions for the current version. These are one-time setup tasks that need to be executed after upgrading to a new version. Requires organization and tenant context.

Responses

200List of pending upgrade actions
Content-Type: application/json
{
  "version": "string",
  "actions": [
    {
      "id": "string",
      "version": "string",
      "message": "string",
      "ctaLabel": "string",
      "successMessage": "string",
      "loadingLabel": "string"
    }
  ]
}
400Missing organization or tenant context
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
500Failed to load upgrade actions
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/configs/upgrade-actions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/configs/upgrade-actions
Auth required

Execute upgrade action

Executes a specific upgrade action by ID. Typically used for one-time setup tasks like seeding example data after version upgrade. Returns execution status and localized success message.

Request body (application/json)

{
  "actionId": "string"
}

Responses

200Upgrade action executed successfully
Content-Type: application/json
{
  "status": "string",
  "message": "string",
  "version": "string"
}
400Invalid request body or missing context
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Upgrade actions are disabled
Content-Type: application/json
{
  "error": "string"
}
500Failed to execute upgrade action
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/configs/upgrade-actions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"actionId\": \"string\"
}"

Cross-Border

Showing 17 of 17 endpoints
GET/cross_border/shipments
Auth required

List shipments

Returns a paginated collection of shipments in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
searchqueryNoany—
containerNumberqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated shipments
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "number": null,
      "status": "draft",
      "carrierName": null,
      "departurePort": null,
      "containerType": null,
      "containerNumber": null,
      "sealNumber": null,
      "bookingNumber": null,
      "currentMilestone": null,
      "etd": null,
      "eta": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments?page=1&pageSize=50&sortField=created_at&sortDir=desc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/cross_border/shipments
Auth required

Create shipment

Creates a draft shipment with its purchase-order allocations.

Request body (application/json)

{
  "carrierName": null,
  "forwarderContact": null,
  "departurePort": null,
  "containerType": null,
  "containerNumber": null,
  "sealNumber": null,
  "bookingNumber": null,
  "destinationWarehouseId": null,
  "destinationLocationId": null,
  "etd": null,
  "eta": null,
  "notes": null,
  "allocations": [
    {
      "purchaseOrderLineId": "00000000-0000-4000-8000-000000000000",
      "quantity": 1
    }
  ]
}

Responses

201Shipment created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/cross_border/shipments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"carrierName\": null,
  \"forwarderContact\": null,
  \"departurePort\": null,
  \"containerType\": null,
  \"containerNumber\": null,
  \"sealNumber\": null,
  \"bookingNumber\": null,
  \"destinationWarehouseId\": null,
  \"destinationLocationId\": null,
  \"etd\": null,
  \"eta\": null,
  \"notes\": null,
  \"allocations\": [
    {
      \"purchaseOrderLineId\": \"00000000-0000-4000-8000-000000000000\",
      \"quantity\": 1
    }
  ]
}"
PUT/cross_border/shipments
Auth required

Update shipment

Updates a draft shipment; requires the expected version for optimistic locking.

Request body (application/json)

{
  "carrierName": null,
  "forwarderContact": null,
  "departurePort": null,
  "containerType": null,
  "containerNumber": null,
  "sealNumber": null,
  "bookingNumber": null,
  "destinationWarehouseId": null,
  "destinationLocationId": null,
  "etd": null,
  "eta": null,
  "notes": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Shipment updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/cross_border/shipments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"carrierName\": null,
  \"forwarderContact\": null,
  \"departurePort\": null,
  \"containerType\": null,
  \"containerNumber\": null,
  \"sealNumber\": null,
  \"bookingNumber\": null,
  \"destinationWarehouseId\": null,
  \"destinationLocationId\": null,
  \"etd\": null,
  \"eta\": null,
  \"notes\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/cross_border/shipments
Auth required

Delete shipment

Soft-deletes a draft or cancelled shipment.

Responses

200Shipment deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/cross_border/shipments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/cross_border/shipments/allocations
Auth required

List shipment allocations

Returns a paginated collection of shipment allocations in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
shipmentIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated shipment allocations
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "purchaseOrderId": "00000000-0000-4000-8000-000000000000",
      "purchaseOrderNumber": null,
      "purchaseOrderLineId": "00000000-0000-4000-8000-000000000000",
      "catalogProductId": "00000000-0000-4000-8000-000000000000",
      "productTitle": null,
      "productSku": null,
      "supplierSku": null,
      "quantity": "string",
      "receivedQuantity": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments/allocations?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/cross_border/shipments/cancel

List shipment cancellations

Returns a paginated collection of shipment cancellations in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated shipment cancellations
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "status": "string"
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments/cancel?page=1&pageSize=50" \
  -H "Accept: application/json"
POST/cross_border/shipments/cancel
Auth required

Create shipment cancellation

Cancels a draft or in-transit shipment; a reason is required. Cancelled shipments release their allocations.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "reason": "string"
}

Responses

201Shipment Cancellation created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/cross_border/shipments/cancel" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"reason\": \"string\"
}"
GET/cross_border/shipments/depart

List shipment departures

Returns a paginated collection of shipment departures in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated shipment departures
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "status": "string"
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments/depart?page=1&pageSize=50" \
  -H "Accept: application/json"
POST/cross_border/shipments/depart
Auth required

Create shipment departure

Departs a draft shipment: assigns its number, records the first milestone and advances allocated purchase orders to shipped.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

201Shipment Departure created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/cross_border/shipments/depart" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/cross_border/shipments/documents
Auth required

List export documents

Returns a paginated collection of export documents in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
shipmentIdqueryNoany—
docTypequeryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated export documents
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "shipmentId": "00000000-0000-4000-8000-000000000000",
      "purchaseOrderId": null,
      "docType": "customs_declaration",
      "documentNumber": null,
      "issuedAt": null,
      "attachmentId": null,
      "note": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments/documents?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/cross_border/shipments/documents
Auth required

Create export document

Records an export document on a shipment; the file itself lives in attachments.

Request body (application/json)

{
  "shipmentId": "00000000-0000-4000-8000-000000000000",
  "docType": "customs_declaration",
  "documentNumber": null,
  "issuedAt": null,
  "purchaseOrderId": null,
  "attachmentId": null,
  "note": null
}

Responses

201Export Document created
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/cross_border/shipments/documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"shipmentId\": \"00000000-0000-4000-8000-000000000000\",
  \"docType\": \"customs_declaration\",
  \"documentNumber\": null,
  \"issuedAt\": null,
  \"purchaseOrderId\": null,
  \"attachmentId\": null,
  \"note\": null
}"
PUT/cross_border/shipments/documents
Auth required

Update export document

Updates an export document.

Request body (application/json)

{
  "documentNumber": null,
  "issuedAt": null,
  "purchaseOrderId": null,
  "attachmentId": null,
  "note": null,
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Export Document updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/cross_border/shipments/documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"documentNumber\": null,
  \"issuedAt\": null,
  \"purchaseOrderId\": null,
  \"attachmentId\": null,
  \"note\": null,
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/cross_border/shipments/documents
Auth required

Delete export document

Soft-deletes an export document.

Responses

200Export Document deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/cross_border/shipments/documents" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/cross_border/shipments/milestones
Auth required

List shipment milestones

Returns a paginated collection of shipment milestones in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
shipmentIdqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated shipment milestones
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "milestone": "picked_up",
      "occurredAt": null,
      "note": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments/milestones?page=1&pageSize=100" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/cross_border/shipments/milestones
Auth required

Create shipment milestone

Records the next transit milestone; a stage earlier than the current one is rejected.

Request body (application/json)

{
  "shipmentId": "00000000-0000-4000-8000-000000000000",
  "milestone": "picked_up",
  "occurredAt": null,
  "note": null
}

Responses

201Shipment Milestone created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/cross_border/shipments/milestones" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"shipmentId\": \"00000000-0000-4000-8000-000000000000\",
  \"milestone\": \"picked_up\",
  \"occurredAt\": null,
  \"note\": null
}"
GET/cross_border/shipments/receive

List shipment receipts

Returns a paginated collection of shipment receipts in the current organization scope.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
statusqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated shipment receipts
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "status": "string"
    }
  ]
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/cross_border/shipments/receive?page=1&pageSize=50" \
  -H "Accept: application/json"
POST/cross_border/shipments/receive
Auth required

Create shipment receipt

Receives an in-transit shipment: books stock in wms and raises the received quantity of each allocated purchase-order line.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "locationId": "00000000-0000-4000-8000-000000000000"
}

Responses

201Shipment Receipt created
Content-Type: application/json
{
  "ok": true
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/cross_border/shipments/receive" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"locationId\": \"00000000-0000-4000-8000-000000000000\"
}"

Currency policy

Showing 2 of 2 endpoints
GET/currency_policy/currencies
Auth required

List currency options

Scoped option source backed by the installed `dictionaries` module; the shape matches the pickers’ existing `{ entries }` contract.

Responses

200Available currency entries.
Content-Type: application/json
{
  "entries": [
    {
      "value": "string",
      "label": "string"
    }
  ]
}
400Missing organization scope
Content-Type: application/json
{
  "error": "string"
}
403Missing currencies.view
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/currency_policy/currencies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/currency_policy/rates
Auth required

List CNY rates for display

The latest stored rate per requested currency, expressed as CNY per one unit of that currency. Read-only: the fetch is the installed `currencies` module’s.

Parameters

NameInRequiredSchemaDescription
symbolsqueryNoanyComma-separated ISO codes (max 32); omitted = every currency of the organization

Responses

200Rates found
Content-Type: application/json
{
  "base": "string",
  "items": [
    {
      "currencyCode": "string",
      "rate": "string",
      "date": "string",
      "source": "string"
    }
  ]
}
400Malformed symbols or no organization selected
Content-Type: application/json
{
  "error": "string"
}
401Not authenticated
Content-Type: application/json
{
  "error": "string"
}
403Missing currencies.view
Content-Type: application/json
{
  "error": "string"
}
500Read failed
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/currency_policy/rates" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Customers

Showing 20 of 101 endpoints
GET/customers/activities
Auth required

List activitys

Returns a paginated collection of activitys scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
entityIdqueryNoany—
dealIdqueryNoany—
activityTypequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated activitys
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "activityType": "string",
      "subject": null,
      "body": null,
      "occurredAt": null,
      "createdAt": "string",
      "appearanceIcon": null,
      "appearanceColor": null,
      "entityId": null,
      "authorUserId": null,
      "authorName": null,
      "authorEmail": null,
      "dealId": null,
      "dealTitle": null,
      "customValues": null,
      "activityTypeLabel": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/activities?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/customers/activities
Auth required

Create activity

DEPRECATED (sunset 2026-06-30): Creates a timeline activity. Use POST /api/customers/interactions instead.

Request body (application/json)

{
  "entityId": "00000000-0000-4000-8000-000000000000",
  "activityType": "string",
  "phoneNumber": null,
  "appearanceIcon": null,
  "appearanceColor": null
}

Responses

201Activity created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/customers/activities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"00000000-0000-4000-8000-000000000000\",
  \"activityType\": \"string\",
  \"phoneNumber\": null,
  \"appearanceIcon\": null,
  \"appearanceColor\": null
}"
PUT/customers/activities
Auth required

Update activity

DEPRECATED (sunset 2026-06-30): Updates an activity. Use PUT /api/customers/interactions instead.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "phoneNumber": null,
  "appearanceIcon": null,
  "appearanceColor": null
}

Responses

200Activity updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/customers/activities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"phoneNumber\": null,
  \"appearanceIcon\": null,
  \"appearanceColor\": null
}"
DELETE/customers/activities
Auth required

Delete activity

DEPRECATED (sunset 2026-06-30): Deletes an activity. Use DELETE /api/customers/interactions instead.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Activity deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/customers/activities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/customers/addresses
Auth required

List addresss

Returns a paginated collection of addresss scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
entityIdqueryNoany—
idqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated addresss
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "entity_id": "00000000-0000-4000-8000-000000000000",
      "name": null,
      "purpose": null,
      "company_name": null,
      "address_line1": null,
      "address_line2": null,
      "building_number": null,
      "flat_number": null,
      "city": null,
      "region": null,
      "postal_code": null,
      "country": null,
      "latitude": null,
      "longitude": null,
      "is_primary": null,
      "organization_id": null,
      "tenant_id": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/addresses?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/customers/addresses
Auth required

Create address

Creates a customer address record and associates it with the referenced entity.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "entityId": "00000000-0000-4000-8000-000000000000",
  "addressLine1": "string",
  "latitude": null,
  "longitude": null
}

Responses

201Address created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/customers/addresses" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"entityId\": \"00000000-0000-4000-8000-000000000000\",
  \"addressLine1\": \"string\",
  \"latitude\": null,
  \"longitude\": null
}"
PUT/customers/addresses
Auth required

Update address

Updates fields on an existing customer address.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "latitude": null,
  "longitude": null
}

Responses

200Address updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/customers/addresses" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"latitude\": null,
  \"longitude\": null
}"
DELETE/customers/addresses
Auth required

Delete address

Deletes an address by id. The identifier may be included in the body or query.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Address deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/customers/addresses" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/customers/assignable-staff
Auth required

DEPRECATED: use GET /api/staff/team-members/assignable instead.

Deprecated. Returns 308 Permanent Redirect to /api/staff/team-members/assignable preserving the query string. Will be removed no earlier than the next major release.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—

Responses

200Assignable staff members (only reachable by following the redirect).
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "teamMemberId": "00000000-0000-4000-8000-000000000000",
      "userId": "00000000-0000-4000-8000-000000000000",
      "displayName": "string",
      "email": null,
      "teamName": null,
      "user": null,
      "team": null
    }
  ],
  "total": 1,
  "totalPages": 1
}
308Permanent redirect to /api/staff/team-members/assignable.
Content-Type: application/json
{
  "error": "string"
}
400Invalid request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/assignable-staff?page=1&pageSize=24" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/customers/comments
Auth required

List comments

Returns a paginated collection of comments scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
entityIdqueryNoany—
dealIdqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated comments
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "entity_id": null,
      "deal_id": null,
      "body": null,
      "author_user_id": null,
      "appearance_icon": null,
      "appearance_color": null,
      "organization_id": null,
      "tenant_id": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/comments?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/customers/comments
Auth required

Create comment

Adds a comment to a customer timeline.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "entityId": "00000000-0000-4000-8000-000000000000",
  "body": "string",
  "appearanceIcon": null,
  "appearanceColor": null
}

Responses

201Comment created
Content-Type: application/json
{
  "id": null,
  "authorUserId": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/customers/comments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"entityId\": \"00000000-0000-4000-8000-000000000000\",
  \"body\": \"string\",
  \"appearanceIcon\": null,
  \"appearanceColor\": null
}"
PUT/customers/comments
Auth required

Update comment

Updates an existing timeline comment.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "appearanceIcon": null,
  "appearanceColor": null
}

Responses

200Comment updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/customers/comments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"appearanceIcon\": null,
  \"appearanceColor\": null
}"
DELETE/customers/comments
Auth required

Delete comment

Deletes a comment identified by `id` supplied via body or query string.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Comment deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/customers/comments" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/customers/companies
Auth required

List companies

Returns a paginated collection of companies scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
emailqueryNoany—
emailStartsWithqueryNoany—
emailContainsqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
statusqueryNoany—
lifecycleStagequeryNoany—
sourcequeryNoany—
hasEmailqueryNoany—
hasPhonequeryNoany—
hasNextInteractionqueryNoany—
createdFromqueryNoany—
createdToqueryNoany—
idqueryNoany—
tagIdsqueryNoany—
tagIdsEmptyqueryNoany—
excludeIdsqueryNoany—
excludeLinkedPersonIdqueryNoany—
excludeLinkedCompanyIdqueryNoany—
excludeLinkedDealIdqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated companies
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "description": null,
      "owner_user_id": null,
      "primary_email": null,
      "primary_phone": null,
      "status": null,
      "lifecycle_stage": null,
      "source": null,
      "next_interaction_at": null,
      "next_interaction_name": null,
      "next_interaction_ref_id": null,
      "next_interaction_icon": null,
      "next_interaction_color": null,
      "organization_id": null,
      "tenant_id": null,
      "created_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/companies?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/customers/companies
Auth required

Create company

Creates a company record and associated profile data.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "displayName": "string",
  "description": null,
  "primaryEmail": null,
  "primaryPhone": null,
  "nextInteraction": null,
  "legalName": null,
  "brandName": null,
  "domain": null,
  "websiteUrl": null,
  "sizeBucket": null,
  "annualRevenue": null
}

Responses

201Company created
Content-Type: application/json
{
  "id": null,
  "companyId": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/customers/companies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"displayName\": \"string\",
  \"description\": null,
  \"primaryEmail\": null,
  \"primaryPhone\": null,
  \"nextInteraction\": null,
  \"legalName\": null,
  \"brandName\": null,
  \"domain\": null,
  \"websiteUrl\": null,
  \"sizeBucket\": null,
  \"annualRevenue\": null
}"
PUT/customers/companies
Auth required

Update company

Updates company profile fields, tags, or custom attributes.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "description": null,
  "primaryEmail": null,
  "primaryPhone": null,
  "nextInteraction": null,
  "legalName": null,
  "brandName": null,
  "domain": null,
  "websiteUrl": null,
  "sizeBucket": null,
  "annualRevenue": null
}

Responses

200Company updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/customers/companies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"description\": null,
  \"primaryEmail\": null,
  \"primaryPhone\": null,
  \"nextInteraction\": null,
  \"legalName\": null,
  \"brandName\": null,
  \"domain\": null,
  \"websiteUrl\": null,
  \"sizeBucket\": null,
  \"annualRevenue\": null
}"
DELETE/customers/companies
Auth required

Delete company

Deletes a company by id. The identifier can be provided via body or query.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Company deleted
Content-Type: application/json
{
  "ok": true
}
422Company has dependent records (people, deals, or direct staff); unlink or reassign before delete.
Content-Type: application/json
{
  "error": "string",
  "code": "COMPANY_HAS_DEPENDENTS"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/customers/companies" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/customers/companies/{id}
Auth required

Fetch company with related data

Returns a company customer record with optional related resources such as addresses, comments, activities, interactions, deals, todos, and linked people.

Parameters

NameInRequiredSchemaDescription
idpathYesany—
includequeryNoanyComma-separated list of relations to include (addresses, comments, activities, interactions, deals, todos, people).

Responses

200Company detail payload
Content-Type: application/json
{
  "interactionMode": "canonical",
  "company": {
    "id": "00000000-0000-4000-8000-000000000000",
    "displayName": null,
    "description": null,
    "ownerUserId": null,
    "primaryEmail": null,
    "primaryPhone": null,
    "status": null,
    "lifecycleStage": null,
    "source": null,
    "nextInteractionAt": null,
    "nextInteractionName": null,
    "nextInteractionRefId": null,
    "nextInteractionIcon": null,
    "nextInteractionColor": null,
    "organizationId": null,
    "tenantId": null,
    "temperature": null,
    "renewalQuarter": null,
    "createdAt": "string",
    "updatedAt": "string"
  },
  "profile": null,
  "customFields": {},
  "tags": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "label": "string",
      "color": null
    }
  ],
  "addresses": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": null,
      "purpose": null,
      "addressLine1": null,
      "addressLine2": null,
      "buildingNumber": null,
      "flatNumber": null,
      "city": null,
      "region": null,
      "postalCode": null,
      "country": null,
      "latitude": null,
      "longitude": null,
      "isPrimary": null,
      "createdAt": "string"
    }
  ],
  "comments": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "body": null,
      "authorUserId": null,
      "authorName": null,
      "authorEmail": null,
      "dealId": null,
      "createdAt": "string",
      "appearanceIcon": null,
      "appearanceColor": null
    }
  ],
  "activities": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "activityType": "string",
      "subject": null,
      "body": null,
      "occurredAt": null,
      "dealId": null,
      "authorUserId": null,
      "authorName": null,
      "authorEmail": null,
      "createdAt": "string",
      "appearanceIcon": null,
      "appearanceColor": null
    }
  ],
  "interactions": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "entityId": null,
      "interactionType": "string",
      "title": null,
      "body": null,
      "status": "string",
      "scheduledAt": null,
      "occurredAt": null,
      "priority": null,
      "authorUserId": null,
      "ownerUserId": null,
      "dealId": null,
      "organizationId": null,
      "tenantId": null,
      "authorName": null,
      "authorEmail": null,
      "dealTitle": null,
      "customValues": null,
      "appearanceIcon": null,
      "appearanceColor": null,
      "source": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "deals": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "title": null,
      "status": null,
      "pipelineStage": null,
      "valueAmount": null,
      "valueCurrency": null,
      "probability": null,
      "expectedCloseAt": null,
      "ownerUserId": null,
      "source": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "todos": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "todoId": "00000000-0000-4000-8000-000000000000",
      "todoSource": "string",
      "createdAt": "string",
      "createdByUserId": null,
      "title": null,
      "isDone": null,
      "priority": null,
      "severity": null,
      "description": null,
      "dueAt": null,
      "todoOrganizationId": null,
      "customValues": null
    }
  ],
  "people": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "displayName": null,
      "primaryEmail": null,
      "primaryPhone": null,
      "status": null,
      "lifecycleStage": null,
      "jobTitle": null,
      "department": null,
      "createdAt": "string",
      "organizationId": null,
      "source": null,
      "temperature": null,
      "linkedAt": null
    }
  ],
  "viewer": {
    "userId": null,
    "name": null,
    "email": null
  }
}
400Invalid identifier
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden — caller lacks the required feature
Content-Type: application/json
{
  "error": "string"
}
404Company not found, or its organization is not in the caller’s scope
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/companies/:id" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/customers/companies/{id}/people
Auth required

List linked people for a company

Parameters

NameInRequiredSchemaDescription
idpathYesany—
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
sortqueryNoany—

Responses

200Paginated linked people
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "displayName": "string",
      "primaryEmail": null,
      "primaryPhone": null,
      "status": null,
      "lifecycleStage": null,
      "jobTitle": null,
      "department": null,
      "createdAt": "string",
      "organizationId": null,
      "temperature": null,
      "source": null,
      "linkedAt": null
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/companies/:id/people?page=1&pageSize=20&sort=name-asc" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/customers/companies/{id}/roles
Auth required

List roles for a company

Parameters

NameInRequiredSchemaDescription
idpathYesany—

Responses

200Role assignments
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "entityType": "company",
      "entityId": "00000000-0000-4000-8000-000000000000",
      "userId": "00000000-0000-4000-8000-000000000000",
      "userName": null,
      "userEmail": null,
      "userPhone": null,
      "roleType": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  ]
}
400Invalid request
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/customers/companies/00000000-0000-4000-8000-000000000000/roles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Dashboards

Showing 10 of 10 endpoints
GET/dashboards/layout
Auth required

Load the current dashboard layout

Returns the saved widget layout together with the widgets the current user is allowed to place.

Responses

200Current dashboard layout and available widgets.
Content-Type: application/json
{
  "layout": {
    "items": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "widgetId": "string",
        "order": 1
      }
    ]
  },
  "allowedWidgetIds": [
    "string"
  ],
  "canConfigure": true,
  "context": {
    "userId": "00000000-0000-4000-8000-000000000000",
    "tenantId": null,
    "organizationId": null,
    "userName": null,
    "userEmail": null,
    "userLabel": "string"
  },
  "widgets": [
    {
      "id": "string",
      "title": "string",
      "description": null,
      "defaultSize": "sm",
      "defaultEnabled": true,
      "defaultSettings": null,
      "features": [
        "string"
      ],
      "moduleId": "string",
      "icon": null,
      "loaderKey": "string",
      "supportsRefresh": true
    }
  ]
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dashboards/layout" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/dashboards/layout
Auth required

Persist dashboard layout changes

Saves the provided widget ordering, sizes, and settings for the current user.

Request body (application/json)

{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "widgetId": "string",
      "order": 1
    }
  ]
}

Responses

200Layout updated successfully.
Content-Type: application/json
{
  "ok": true
}
400Invalid layout payload
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing dashboards.configure feature
Content-Type: application/json
{
  "error": "string"
}
503Widget registry unavailable — the layout was not saved
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/dashboards/layout" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"items\": [
    {
      \"id\": \"00000000-0000-4000-8000-000000000000\",
      \"widgetId\": \"string\",
      \"order\": 1
    }
  ]
}"
PATCH/dashboards/layout/{itemId}
Auth required

Update a dashboard layout item

Adjusts the size or settings for a single widget within the dashboard layout.

Parameters

NameInRequiredSchemaDescription
itemIdpathYesany—

Request body (application/json)

{}

Responses

200Layout item updated.
Content-Type: application/json
{
  "ok": true
}
400Invalid payload or missing item id
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing dashboards.configure feature
Content-Type: application/json
{
  "error": "string"
}
404Item not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PATCH "https://dgital-base.kc-trade.cn/api/dashboards/layout/00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
GET/dashboards/roles/widgets
Auth required

Fetch widget assignments for a role

Returns the widgets explicitly assigned to the given role together with the evaluation scope.

Parameters

NameInRequiredSchemaDescription
roleIdqueryYesany—
tenantIdqueryNoany—
organizationIdqueryNoany—

Responses

200Current widget configuration for the role.
Content-Type: application/json
{
  "widgetIds": [
    "string"
  ],
  "hasCustom": true,
  "scope": {
    "tenantId": null,
    "organizationId": null
  }
}
400Missing role identifier
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Insufficient permissions to manage role widgets
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dashboards/roles/widgets?roleId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/dashboards/roles/widgets
Auth required

Update widgets assigned to a role

Persists the widget list for a role within the provided tenant and organization scope.

Request body (application/json)

{
  "roleId": "00000000-0000-4000-8000-000000000000",
  "widgetIds": [
    "string"
  ]
}

Responses

200Widgets updated successfully.
Content-Type: application/json
{
  "ok": true,
  "widgetIds": [
    "string"
  ]
}
400Invalid payload or unknown widgets
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Insufficient permissions to manage role widgets
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/dashboards/roles/widgets" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"roleId\": \"00000000-0000-4000-8000-000000000000\",
  \"widgetIds\": [
    \"string\"
  ]
}"
GET/dashboards/users/widgets
Auth required

Read widget overrides for a user

Returns the widgets inherited and explicitly configured for the requested user within the current scope.

Parameters

NameInRequiredSchemaDescription
userIdqueryYesany—
tenantIdqueryNoany—
organizationIdqueryNoany—

Responses

200Widget settings for the user.
Content-Type: application/json
{
  "mode": "inherit",
  "widgetIds": [
    "string"
  ],
  "hasCustom": true,
  "effectiveWidgetIds": [
    "string"
  ],
  "scope": {
    "tenantId": null,
    "organizationId": null
  }
}
400Missing user identifier
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Insufficient permissions to manage user widgets
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dashboards/users/widgets?userId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/dashboards/users/widgets
Auth required

Update user-specific dashboard widgets

Sets the widget override mode and allowed widgets for a user. Passing `mode: inherit` clears overrides.

Request body (application/json)

{
  "userId": "00000000-0000-4000-8000-000000000000",
  "mode": "inherit",
  "widgetIds": [
    "string"
  ]
}

Responses

200Overrides saved.
Content-Type: application/json
{
  "ok": true,
  "mode": "inherit",
  "widgetIds": [
    "string"
  ]
}
400Invalid payload or unknown widgets
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Insufficient permissions to manage user widgets
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/dashboards/users/widgets" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"userId\": \"00000000-0000-4000-8000-000000000000\",
  \"mode\": \"inherit\",
  \"widgetIds\": [
    \"string\"
  ]
}"
GET/dashboards/widgets/catalog
Auth required

List available dashboard widgets

Returns the catalog of widgets that modules expose, including defaults and feature requirements.

Responses

200Widgets available for assignment.
Content-Type: application/json
{
  "items": [
    {
      "id": "string",
      "title": "string",
      "description": null,
      "defaultSize": "sm",
      "defaultEnabled": true,
      "defaultSettings": null,
      "features": [
        "string"
      ],
      "moduleId": "string",
      "icon": null,
      "loaderKey": "string",
      "supportsRefresh": true
    }
  ]
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Insufficient permissions to view widget catalog
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dashboards/widgets/catalog" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/dashboards/widgets/data
Auth required

Fetch aggregated data for dashboard widgets

Executes an aggregation query against the specified entity type and returns the result. Supports date range filtering, grouping, and period-over-period comparison.

Request body (application/json)

{
  "entityType": "string",
  "metric": {
    "field": "string",
    "aggregate": "count"
  }
}

Responses

200Aggregated data for the widget.
Content-Type: application/json
{
  "value": null,
  "data": [
    {
      "value": null
    }
  ],
  "metadata": {
    "fetchedAt": "string",
    "recordCount": 1,
    "currency": null
  }
}
400Invalid request payload
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing analytics.view feature
Content-Type: application/json
{
  "error": "string"
}
422Too many rows to group an encrypted field in application code
Content-Type: application/json
{
  "error": "string"
}
500Internal server error
Content-Type: application/json
{
  "error": "string"
}
503Encryption is configured but the group source cannot currently be resolved
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/dashboards/widgets/data" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityType\": \"string\",
  \"metric\": {
    \"field\": \"string\",
    \"aggregate\": \"count\"
  }
}"
POST/dashboards/widgets/data/batch
Auth required

Fetch aggregated data for multiple dashboard widgets in one request

Resolves a batch of widget data requests with a single authentication, RBAC, organization-scope, and database-context setup. Each request is keyed by an opaque widget id and resolved independently, so a failure in one widget does not fail the batch.

Request body (application/json)

{
  "requests": [
    {
      "id": "string",
      "request": {
        "entityType": "string",
        "metric": {
          "field": "string",
          "aggregate": "count"
        }
      }
    }
  ]
}

Responses

200Per-widget aggregation results keyed by request id.
Content-Type: application/json
{
  "results": [
    {
      "id": "string",
      "ok": true,
      "data": {
        "value": null,
        "data": [
          {
            "value": null
          }
        ],
        "metadata": {
          "fetchedAt": "string",
          "recordCount": 1,
          "currency": null
        }
      }
    }
  ]
}
400Invalid request payload
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
500Internal server error
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/dashboards/widgets/data/batch" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"requests\": [
    {
      \"id\": \"string\",
      \"request\": {
        \"entityType\": \"string\",
        \"metric\": {
          \"field\": \"string\",
          \"aggregate\": \"count\"
        }
      }
    }
  ]
}"

Dictionaries

Showing 11 of 11 endpoints
GET/dictionaries
Auth required

List dictionaries

Returns dictionaries accessible to the current organization, optionally including inactive records.

Parameters

NameInRequiredSchemaDescription
includeInactivequeryNoany—

Responses

200Dictionary collection.
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "key": "string",
      "name": "string",
      "description": null,
      "isSystem": true,
      "isActive": true,
      "managerVisibility": null,
      "organizationId": null,
      "createdAt": "string",
      "updatedAt": null
    }
  ]
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
500Failed to load dictionaries
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dictionaries" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/dictionaries
Auth required

Create dictionary

Registers a dictionary scoped to the current organization.

Request body (application/json)

{
  "key": "string",
  "name": "string"
}

Responses

201Dictionary created.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "key": "string",
  "name": "string",
  "description": null,
  "isSystem": true,
  "isActive": true,
  "managerVisibility": null,
  "organizationId": null,
  "createdAt": "string",
  "updatedAt": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
409Dictionary key already exists
Content-Type: application/json
{
  "error": "string"
}
500Failed to create dictionary
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/dictionaries" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"key\": \"string\",
  \"name\": \"string\"
}"
GET/dictionaries/{dictionaryId}
Auth required

Get dictionary

Returns details for the specified dictionary, including inheritance flags.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—

Responses

200Dictionary details.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "key": "string",
  "name": "string",
  "description": null,
  "isSystem": true,
  "isActive": true,
  "managerVisibility": null,
  "organizationId": null,
  "createdAt": "string",
  "updatedAt": null
}
400Invalid parameters
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to load dictionary
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PATCH/dictionaries/{dictionaryId}
Auth required

Update dictionary

Updates mutable attributes of the dictionary. Currency dictionaries are protected from modification.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—

Request body (application/json)

{}

Responses

200Dictionary updated.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "key": "string",
  "name": "string",
  "description": null,
  "isSystem": true,
  "isActive": true,
  "managerVisibility": null,
  "organizationId": null,
  "createdAt": "string",
  "updatedAt": null
}
400Validation failed or protected dictionary
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary not found
Content-Type: application/json
{
  "error": "string"
}
409Dictionary key already exists
Content-Type: application/json
{
  "error": "string"
}
500Failed to update dictionary
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PATCH "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
DELETE/dictionaries/{dictionaryId}
Auth required

Delete dictionary

Soft deletes the dictionary unless it is the protected currency dictionary.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—

Responses

200Dictionary archived.
Content-Type: application/json
{
  "ok": true
}
400Protected dictionary cannot be deleted
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to delete dictionary
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/dictionaries/{dictionaryId}/entries
Auth required

List dictionary entries

Returns entries for the specified dictionary ordered by its configured entry sort mode. The number of entries returned per request is capped at 500; use `limit` and `offset` with the `total`/`hasMore` response fields to page through larger dictionaries.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—
limitqueryNoanyMaximum entries to return. Defaults to and is capped at 500.
offsetqueryNoanyNumber of entries to skip. Defaults to 0.

Responses

200Dictionary entries.
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "value": "string",
      "label": "string",
      "color": null,
      "icon": null,
      "position": 1,
      "isDefault": true,
      "createdAt": "string",
      "updatedAt": null
    }
  ],
  "total": 1,
  "limit": 1,
  "offset": 1,
  "hasMore": true,
  "sortMode": "label_asc"
}
400Invalid parameters
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to load dictionary entries
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000/entries" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/dictionaries/{dictionaryId}/entries
Auth required

Create dictionary entry

Creates a new entry in the specified dictionary.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—

Request body (application/json)

{
  "value": "string",
  "color": null,
  "icon": null
}

Responses

201Dictionary entry created.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "value": "string",
  "label": "string",
  "color": null,
  "icon": null,
  "position": 1,
  "isDefault": true,
  "createdAt": "string",
  "updatedAt": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to create dictionary entry
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000/entries" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"value\": \"string\",
  \"color\": null,
  \"icon\": null
}"
PATCH/dictionaries/{dictionaryId}/entries/{entryId}
Auth required

Update dictionary entry

Updates the specified dictionary entry using the command bus pipeline.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—
entryIdpathYesany—

Request body (application/json)

{
  "color": null,
  "icon": null
}

Responses

200Dictionary entry updated.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "value": "string",
  "label": "string",
  "color": null,
  "icon": null,
  "position": 1,
  "isDefault": true,
  "createdAt": "string",
  "updatedAt": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary or entry not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to update entry
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PATCH "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000/entries/00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"color\": null,
  \"icon\": null
}"
DELETE/dictionaries/{dictionaryId}/entries/{entryId}
Auth required

Delete dictionary entry

Deletes the specified dictionary entry via the command bus.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—
entryIdpathYesany—

Responses

200Entry deleted.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary or entry not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to delete entry
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000/entries/00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/dictionaries/{dictionaryId}/entries/reorder
Auth required

Reorder dictionary entries

Updates the position of dictionary entries for drag-and-drop reordering.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—

Request body (application/json)

{
  "entries": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "position": 1
    }
  ]
}

Responses

200Entries reordered.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to reorder entries
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000/entries/reorder" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entries\": [
    {
      \"id\": \"00000000-0000-4000-8000-000000000000\",
      \"position\": 1
    }
  ]
}"
POST/dictionaries/{dictionaryId}/entries/set-default
Auth required

Set default dictionary entry

Marks the specified entry as the default for this dictionary, clearing any previous default.

Parameters

NameInRequiredSchemaDescription
dictionaryIdpathYesany—

Request body (application/json)

{
  "entryId": "00000000-0000-4000-8000-000000000000"
}

Responses

200Default entry set.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
404Dictionary or entry not found
Content-Type: application/json
{
  "error": "string"
}
500Failed to set default entry
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/dictionaries/00000000-0000-4000-8000-000000000000/entries/set-default" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entryId\": \"00000000-0000-4000-8000-000000000000\"
}"

Directory

Showing 11 of 11 endpoints
GET/directory/organization-branding
Auth required

Read sidebar branding for the selected organization

Returns the logo URL used by the backend sidebar for the currently selected organization.

Responses

200Organization branding
Content-Type: application/json
{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "organizationName": "string",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "logoUrl": null,
  "logoPreserveAspectRatio": true,
  "updatedAt": null
}
400A concrete organization scope is required
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Organization not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/directory/organization-branding" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/directory/organization-branding
Auth required

Update sidebar branding for the selected organization

Stores an external image URL or an internal attachment image URL as the selected organization logo.

Request body (application/json)

{
  "logoUrl": null
}

Responses

200Updated organization branding
Content-Type: application/json
{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "organizationName": "string",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "logoUrl": null,
  "logoPreserveAspectRatio": true,
  "updatedAt": null
}
400Save failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Organization branding changed since it was loaded
Content-Type: application/json
{
  "error": "string"
}
422Invalid logo URL
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/directory/organization-branding" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"logoUrl\": null
}"
GET/directory/organization-switcher
Auth required

Load organization switcher menu

Returns the hierarchical menu of organizations the current user may switch to within the active tenant.

Responses

200Organization switcher payload.
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "depth": 1,
      "selectable": true,
      "children": []
    }
  ],
  "selectedId": null,
  "canManage": true,
  "canViewAllOrganizations": true,
  "tenantId": null,
  "tenants": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "isActive": true
    }
  ],
  "isSuperAdmin": true
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/directory/organization-switcher" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/directory/organizations
Auth required

List organizations

Returns organizations using options, tree, or paginated manage view depending on the `view` parameter.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
viewqueryNoany—
idsqueryNoany—
tenantIdqueryNoany—
includeInactivequeryNoany—
statusqueryNoany—

Responses

200Organization data for the requested view.
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "parentId": null,
      "parentName": null,
      "tenantId": null,
      "tenantName": null,
      "rootId": null,
      "treePath": null
    }
  ]
}
400Invalid query or tenant scope
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/directory/organizations?page=1&pageSize=50&view=options" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/directory/organizations
Auth required

Create organization

Creates a new organization within a tenant and optionally assigns hierarchy relationships.

Request body (application/json)

{
  "name": "string",
  "slug": null,
  "logoUrl": null,
  "parentId": null
}

Responses

201Organization created.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing directory.organizations.manage feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/directory/organizations" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"name\": \"string\",
  \"slug\": null,
  \"logoUrl\": null,
  \"parentId\": null
}"
PUT/directory/organizations
Auth required

Update organization

Updates organization details and hierarchy assignments.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "slug": null,
  "logoUrl": null,
  "parentId": null
}

Responses

200Organization updated.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing directory.organizations.manage feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/directory/organizations" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"slug\": null,
  \"logoUrl\": null,
  \"parentId\": null
}"
DELETE/directory/organizations
Auth required

Delete organization

Soft deletes an organization identified by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Organization deleted.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing directory.organizations.manage feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/directory/organizations" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/directory/tenants
Auth required

List tenants

Returns tenants visible to the current user with optional search and pagination.

Parameters

NameInRequiredSchemaDescription
idqueryNoany—
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
isActivequeryNoany—

Responses

200Paged list of tenants.
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "isActive": true,
      "createdAt": null,
      "updatedAt": null
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}
400Invalid query parameters
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Requires super-admin
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/directory/tenants?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/directory/tenants
Auth required

Create tenant

Creates a new tenant and returns its identifier.

Request body (application/json)

{
  "name": "string"
}

Responses

201Tenant created.
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing directory.tenants.manage feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/directory/tenants" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"name\": \"string\"
}"
PUT/directory/tenants
Auth required

Update tenant

Updates tenant properties such as name or activation state.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Tenant updated.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing directory.tenants.manage feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/directory/tenants" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/directory/tenants
Auth required

Delete tenant

Soft deletes the tenant identified by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Tenant removed.
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}
403Missing directory.tenants.manage feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/directory/tenants" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"

Entities

Showing 19 of 19 endpoints
GET/entities/definitions
Auth required

List active custom field definitions

Returns active custom field definitions for the supplied entity ids, respecting tenant scope and tombstones.

Parameters

NameInRequiredSchemaDescription
entityIdqueryNoany—
entityIdsqueryNoany—
fieldsetqueryNoany—

Responses

200Definition list
Content-Type: application/json
{
  "items": [
    {
      "key": "string",
      "kind": "string",
      "label": "string",
      "entityId": "string"
    }
  ]
}
400Missing entity id
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/definitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/entities/definitions
Auth required

Upsert custom field definition

Creates or updates a custom field definition for the current tenant/org scope.

Request body (application/json)

{
  "entityId": "string",
  "key": "string",
  "kind": "text"
}

Responses

200Definition saved
Content-Type: application/json
{
  "ok": true,
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "key": "string",
    "kind": "string",
    "configJson": {}
  }
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/entities/definitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"key\": \"string\",
  \"kind\": \"text\"
}"
DELETE/entities/definitions
Auth required

Soft delete custom field definition

Marks the specified definition inactive and tombstones it for the current scope.

Request body (application/json)

{
  "entityId": "string",
  "key": "string"
}

Responses

200Definition deleted
Content-Type: application/json
{
  "ok": true,
  "version": null
}
400Missing entity id or key
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
404Definition not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/entities/definitions" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"key\": \"string\"
}"
POST/entities/definitions.batch
Auth required

Save multiple custom field definitions

Creates or updates multiple definitions for a single entity in one transaction.

Request body (application/json)

{
  "entityId": "string",
  "definitions": [
    {
      "key": "string",
      "kind": "text"
    }
  ]
}

Responses

200Definitions saved
Content-Type: application/json
{
  "ok": true,
  "version": null
}
400Validation error
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
500Unexpected failure
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/entities/definitions.batch" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"definitions\": [
    {
      \"key\": \"string\",
      \"kind\": \"text\"
    }
  ]
}"
GET/entities/definitions.manage
Auth required

Get management snapshot

Returns scoped custom field definitions (including inactive tombstones) for administration interfaces.

Parameters

NameInRequiredSchemaDescription
entityIdqueryYesany—

Responses

200Scoped definitions and deleted keys
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "key": "string",
      "kind": "string",
      "configJson": null,
      "organizationId": null,
      "tenantId": null
    }
  ],
  "deletedKeys": [
    "string"
  ],
  "version": null
}
400Missing entity id
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication or feature
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/definitions.manage?entityId=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/entities/definitions.restore
Auth required

Restore definition

Reactivates a previously soft-deleted definition within the current tenant/org scope.

Request body (application/json)

{
  "entityId": "string",
  "key": "string"
}

Responses

200Definition restored
Content-Type: application/json
{
  "ok": true
}
400Missing entity id or key
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
404Definition not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/entities/definitions.restore" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"key\": \"string\"
}"
GET/entities/encryption
Auth required

Fetch encryption map

Returns the encrypted field map for the current tenant/organization scope.

Parameters

NameInRequiredSchemaDescription
entityIdqueryYesany—

Responses

200Map
Content-Type: application/json
{
  "entityId": "string",
  "fields": [
    {
      "field": "string",
      "hashField": null
    }
  ],
  "updatedAt": null
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/encryption?entityId=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/entities/encryption
Auth required

Upsert encryption map

Creates or updates the encryption map for the current tenant/organization scope. Enforces optimistic locking when the caller sends the expected version header.

Request body (application/json)

{
  "entityId": "string",
  "tenantId": null,
  "organizationId": null,
  "fields": [
    {
      "field": "string",
      "hashField": null
    }
  ]
}

Responses

200Saved
Content-Type: application/json
{
  "ok": true,
  "updatedAt": null
}
409Optimistic-lock conflict (stale write)
Content-Type: application/json
{
  "error": "string",
  "code": "string",
  "currentUpdatedAt": "string",
  "expectedUpdatedAt": "string"
}
422Selected organization is unavailable
Content-Type: application/json
{
  "error": "string",
  "code": "organization_selection_invalid"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/entities/encryption" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"tenantId\": null,
  \"organizationId\": null,
  \"fields\": [
    {
      \"field\": \"string\",
      \"hashField\": null
    }
  ]
}"
GET/entities/entities
Auth required

List available entities

Returns generated and custom entities scoped to the caller with field counts per entity.

Responses

200List of entities
Content-Type: application/json
{
  "items": [
    {
      "entityId": "string",
      "source": "code",
      "label": "string",
      "count": 1
    }
  ]
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/entities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/entities/entities
Auth required

Upsert custom entity

Creates or updates a tenant/org scoped custom entity definition.

Request body (application/json)

{
  "entityId": "string",
  "label": "string",
  "description": null,
  "showInSidebar": false,
  "accessRestricted": false
}

Responses

200Entity saved
Content-Type: application/json
{
  "ok": true,
  "item": {
    "id": "00000000-0000-4000-8000-000000000000",
    "entityId": "string",
    "label": "string"
  }
}
400Validation error
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/entities/entities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"label\": \"string\",
  \"description\": null,
  \"showInSidebar\": false,
  \"accessRestricted\": false
}"
DELETE/entities/entities
Auth required

Soft delete custom entity

Marks the specified custom entity inactive within the current scope.

Request body (application/json)

{
  "entityId": "string"
}

Responses

200Entity deleted
Content-Type: application/json
{
  "ok": true
}
400Missing entity id
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
404Entity not found in scope
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/entities/entities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\"
}"
GET/entities/entity-settings
Auth required

Get custom entity settings

Returns the tenant-scoped default-restricted policy for new custom entities.

Responses

200Current settings
Content-Type: application/json
{
  "newEntitiesRestrictedByDefault": true,
  "updatedAt": null
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/entity-settings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
PUT/entities/entity-settings
Auth required

Update custom entity settings

Sets the tenant-scoped default-restricted policy for new custom entities.

Request body (application/json)

{
  "newEntitiesRestrictedByDefault": true
}

Responses

200Updated settings
Content-Type: application/json
{
  "ok": true,
  "newEntitiesRestrictedByDefault": true,
  "updatedAt": null
}
400Invalid payload
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
409Optimistic lock conflict
Content-Type: application/json
{
  "code": "string",
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/entities/entity-settings" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"newEntitiesRestrictedByDefault\": true
}"
GET/entities/records
Auth required

List records

Returns paginated records for the supplied entity. Supports custom field filters, exports, and soft-delete toggles.

Parameters

NameInRequiredSchemaDescription
entityIdqueryYesany—
pagequeryNoany—
pageSizequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
searchqueryNoany—
searchFieldsqueryNoany—
withDeletedqueryNoany—
formatqueryNoany—
exportScopequeryNoany—
export_scopequeryNoany—
allqueryNoany—
fullqueryNoany—

Responses

200Paginated records
Content-Type: application/json
{
  "items": [
    {}
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}
400Missing entity id
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
500Unexpected failure
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/records?entityId=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/entities/records
Auth required

Create record

Creates a record for the given entity. When `recordId` is omitted or not a UUID the data engine will generate one automatically.

Request body (application/json)

{
  "entityId": "string",
  "values": {}
}

Responses

200Record created
Content-Type: application/json
{
  "ok": true
}
400Validation failure
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
500Unexpected failure
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/entities/records" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"values\": {}
}"
PUT/entities/records
Auth required

Update record

Updates an existing record. If the provided recordId is not a UUID the record will be created instead to support optimistic flows.

Request body (application/json)

{
  "entityId": "string",
  "recordId": "string",
  "values": {}
}

Responses

200Record updated
Content-Type: application/json
{
  "ok": true
}
400Validation failure
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
500Unexpected failure
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/entities/records" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"recordId\": \"string\",
  \"values\": {}
}"
DELETE/entities/records
Auth required

Delete record

Soft deletes the specified record within the current tenant/org scope.

Request body (application/json)

{
  "entityId": "string",
  "recordId": "string"
}

Responses

200Record deleted
Content-Type: application/json
{
  "ok": true
}
400Missing entity id or record id
Content-Type: application/json
{
  "error": "string"
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}
404Record not found
Content-Type: application/json
{
  "error": "string"
}
500Unexpected failure
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/entities/records" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityId\": \"string\",
  \"recordId\": \"string\"
}"
GET/entities/relations/options
Auth required

List relation options

Returns up to 200 option entries for populating relation dropdowns, automatically resolving label fields when omitted. An entityId that matches neither an active custom entity nor a registered ORM entity yields an empty option list.

Parameters

NameInRequiredSchemaDescription
entityIdqueryYesany—
labelFieldqueryNoany—
qqueryNoany—
idsqueryNoany—
routeContextFieldsqueryNoany—

Responses

200Option list
Content-Type: application/json
{
  "items": [
    {
      "value": "string",
      "label": "string"
    }
  ]
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/relations/options?entityId=string" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/entities/sidebar-entities
Auth required

Get sidebar entities

Returns custom entities flagged with `showInSidebar` for the current tenant/org scope.

Responses

200Sidebar entities for navigation
Content-Type: application/json
{
  "items": [
    {
      "entityId": "string",
      "label": "string",
      "href": "string"
    }
  ]
}
401Missing authentication
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/entities/sidebar-entities" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Query Index

Showing 3 of 3 endpoints
POST/query_index/purge
Auth required

Purge query index records

Queues a purge job to remove indexed records for an entity type within the active scope.

Request body (application/json)

{
  "entityType": "string"
}

Responses

200Purge job accepted.
Content-Type: application/json
{
  "ok": true
}
400Missing entity type
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/query_index/purge" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityType\": \"string\"
}"
POST/query_index/reindex
Auth required

Trigger query index rebuild

Queues a reindex job for the specified entity type within the current tenant scope.

Request body (application/json)

{
  "entityType": "string"
}

Responses

200Reindex job accepted.
Content-Type: application/json
{
  "ok": true
}
400Missing entity type
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/query_index/reindex" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"entityType\": \"string\"
}"
GET/query_index/status
Auth required

Inspect query index coverage

Returns entity counts comparing base tables with the query index along with the latest job status.

Responses

200Current query index status.
Content-Type: application/json
{
  "items": [
    {
      "entityId": "string",
      "label": "string",
      "baseCount": null,
      "indexCount": null,
      "vectorCount": null,
      "fulltextCount": null,
      "ok": true,
      "job": {
        "status": "idle",
        "startedAt": null,
        "finishedAt": null,
        "heartbeatAt": null,
        "processedCount": null,
        "totalCount": null,
        "scope": null
      },
      "refreshedAt": null
    }
  ],
  "errors": [
    {
      "id": "string",
      "source": "string",
      "handler": "string",
      "entityType": null,
      "recordId": null,
      "tenantId": null,
      "organizationId": null,
      "message": "string",
      "stack": null,
      "payload": null,
      "occurredAt": "string"
    }
  ],
  "logs": [
    {
      "id": "string",
      "source": "string",
      "handler": "string",
      "level": "info",
      "entityType": null,
      "recordId": null,
      "tenantId": null,
      "organizationId": null,
      "message": "string",
      "details": null,
      "occurredAt": "string"
    }
  ]
}
400Tenant or organization context required
Content-Type: application/json
{
  "error": "string"
}
401Authentication required
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/query_index/status" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"

Sales

Showing 20 of 110 endpoints
GET/sales/adjustment-kinds
Auth required

List sales adjustment kinds

Returns a paginated collection of sales adjustment kinds that belong to the current organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated sales adjustment kinds
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "value": "string",
      "label": null,
      "color": null,
      "icon": null,
      "organizationId": null,
      "tenantId": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/adjustment-kinds?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sales/adjustment-kinds
Auth required

Create sales adjustment kind

Creates an adjustment kind.

Request body (application/json)

{}

Responses

201Sales adjustment kind created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sales/adjustment-kinds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
PUT/sales/adjustment-kinds
Auth required

Update sales adjustment kind

Updates an adjustment kind.

Request body (application/json)

{}

Responses

200Sales adjustment kind updated
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/sales/adjustment-kinds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
DELETE/sales/adjustment-kinds
Auth required

Delete sales adjustment kind

Deletes an adjustment kind.

Request body (application/json)

{}

Responses

200Sales adjustment kind deleted
Content-Type: application/json
{
  "id": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sales/adjustment-kinds" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{}"
GET/sales/channels
Auth required

List sales channels

Manage sales channels to segment orders and pricing across marketplaces or stores.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
idqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
isActivequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
withDeletedqueryNoany—

Responses

200Paginated sales channels
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "code": null,
      "description": null,
      "statusEntryId": null,
      "isActive": true,
      "organizationId": null,
      "tenantId": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/channels?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sales/channels
Auth required

Create sales channel

Creates a new sales channel.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "code": "string"
}

Responses

201Sales channel created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sales/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"name\": \"string\",
  \"code\": \"string\"
}"
PUT/sales/channels
Auth required

Update sales channel

Updates an existing sales channel by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "code": "string"
}

Responses

200Sales channel updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/sales/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"code\": \"string\"
}"
DELETE/sales/channels
Auth required

Delete sales channel

Deletes a sales channel identified by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Sales channel deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sales/channels" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/sales/credit-memos
Auth required

List creditmemos

Returns a paginated collection of creditmemos that belong to the current organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
idqueryNoany—
orderIdqueryNoany—
invoiceIdqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated creditmemos
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "creditMemoNumber": "string",
      "status": null,
      "reason": null,
      "issueDate": null,
      "currencyCode": "string"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/credit-memos?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sales/credit-memos
Auth required

Create creditmemo

Create a new credit memo

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "currencyCode": "string"
}

Responses

201CreditMemo created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sales/credit-memos" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"currencyCode\": \"string\"
}"
PUT/sales/credit-memos
Auth required

Update creditmemo

Update a credit memo

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200CreditMemo updated
Content-Type: application/json
{
  "creditMemoId": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/sales/credit-memos" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/sales/credit-memos
Auth required

Delete creditmemo

Delete a credit memo

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200CreditMemo deleted
Content-Type: application/json
{
  "creditMemoId": "00000000-0000-4000-8000-000000000000"
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sales/credit-memos" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/sales/dashboard/widgets/new-orders

Fetch recently created sales orders

Fetches recently created sales orders for the dashboard widget with a configurable date period.

Parameters

NameInRequiredSchemaDescription
limitqueryNoany—
datePeriodqueryNoany—
customFromqueryNoany—
customToqueryNoany—
tenantIdqueryNoany—
organizationIdqueryNoany—

Responses

200List of recent orders
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "orderNumber": "string",
      "status": null,
      "fulfillmentStatus": null,
      "paymentStatus": null,
      "customerName": null,
      "customerEntityId": null,
      "netAmount": "string",
      "grossAmount": "string",
      "currency": null,
      "createdAt": "string"
    }
  ],
  "total": 1,
  "dateRange": {
    "from": "string",
    "to": "string"
  }
}
400Invalid query parameters
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden
Content-Type: application/json
{
  "error": "string"
}
500Widget failed to load
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/dashboard/widgets/new-orders?limit=5&datePeriod=last24h" \
  -H "Accept: application/json"
GET/sales/dashboard/widgets/new-quotes

Fetch recently created sales quotes

Fetches recently created sales quotes for the dashboard widget with a configurable date period.

Parameters

NameInRequiredSchemaDescription
limitqueryNoany—
datePeriodqueryNoany—
customFromqueryNoany—
customToqueryNoany—
tenantIdqueryNoany—
organizationIdqueryNoany—

Responses

200List of recent quotes
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "quoteNumber": "string",
      "status": null,
      "customerName": null,
      "customerEntityId": null,
      "validFrom": null,
      "validUntil": null,
      "netAmount": "string",
      "grossAmount": "string",
      "currency": null,
      "createdAt": "string",
      "convertedOrderId": null
    }
  ],
  "total": 1,
  "dateRange": {
    "from": "string",
    "to": "string"
  }
}
400Invalid query parameters
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
403Forbidden
Content-Type: application/json
{
  "error": "string"
}
500Widget failed to load
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/dashboard/widgets/new-quotes?limit=5&datePeriod=last24h" \
  -H "Accept: application/json"
GET/sales/delivery-windows
Auth required

List delivery windows

Define delivery windows to communicate lead times and cut-off rules for sales orders.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
isActivequeryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
withDeletedqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated delivery windows
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "name": "string",
      "code": null,
      "description": null,
      "leadTimeDays": null,
      "cutoffTime": null,
      "timezone": null,
      "isActive": true,
      "metadata": null,
      "organizationId": null,
      "tenantId": null,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/delivery-windows?page=1&pageSize=50" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sales/delivery-windows
Auth required

Create delivery window

Creates a new delivery window.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "name": "string",
  "code": "string"
}

Responses

201Delivery window created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sales/delivery-windows" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"name\": \"string\",
  \"code\": \"string\"
}"
PUT/sales/delivery-windows
Auth required

Update delivery window

Updates an existing delivery window by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Delivery window updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/sales/delivery-windows" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
DELETE/sales/delivery-windows
Auth required

Delete delivery window

Deletes a delivery window identified by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Delivery window deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/sales/delivery-windows" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/sales/document-addresses
Auth required

List document addresss

Returns a paginated collection of document addresss that belong to the current organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
documentIdqueryYesany—
documentKindqueryNoany—
sortFieldqueryNoany—
sortDirqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).

Responses

200Paginated document addresss
Content-Type: application/json
{
  "items": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "document_id": "00000000-0000-4000-8000-000000000000",
      "document_kind": "order",
      "customer_address_id": null,
      "name": null,
      "purpose": null,
      "company_name": null,
      "address_line1": "string",
      "address_line2": null,
      "building_number": null,
      "flat_number": null,
      "city": null,
      "region": null,
      "postal_code": null,
      "country": null,
      "latitude": null,
      "longitude": null,
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/sales/document-addresses?page=1&pageSize=50&documentId=00000000-0000-4000-8000-000000000000" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/sales/document-addresses
Auth required

Create document address

Creates a sales document address linked to an order or quote.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "documentId": "00000000-0000-4000-8000-000000000000",
  "documentKind": "order",
  "name": null,
  "purpose": null,
  "companyName": null,
  "addressLine1": "string",
  "addressLine2": null,
  "city": null,
  "region": null,
  "postalCode": null,
  "country": null,
  "buildingNumber": null,
  "flatNumber": null,
  "latitude": null,
  "longitude": null
}

Responses

201Document address created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/sales/document-addresses" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"documentId\": \"00000000-0000-4000-8000-000000000000\",
  \"documentKind\": \"order\",
  \"name\": null,
  \"purpose\": null,
  \"companyName\": null,
  \"addressLine1\": \"string\",
  \"addressLine2\": null,
  \"city\": null,
  \"region\": null,
  \"postalCode\": null,
  \"country\": null,
  \"buildingNumber\": null,
  \"flatNumber\": null,
  \"latitude\": null,
  \"longitude\": null
}"

WMS

Showing 20 of 41 endpoints
GET/wms/dashboard/operational
Auth required

Load operational dashboard data

Aggregated KPIs, expiry watch lot rows (`expiryLots`), monthly movement trends, and recent activity for the WMS operational dashboard.

Parameters

NameInRequiredSchemaDescription
warehouseIdqueryNoany—

Responses

200Dashboard payload
Content-Type: application/json
{
  "lastUpdatedAt": "string",
  "warehouseId": null,
  "kpis": [
    {
      "id": "lowStock",
      "count": 1,
      "deltaSinceYesterday": null,
      "sparkline": [
        1
      ]
    }
  ],
  "expiryLots": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "lotNumber": "string",
      "sku": "string",
      "expiresAt": "string",
      "availableQuantity": 1,
      "category": "expiringSoon"
    }
  ],
  "monthlyTrends": [
    {
      "month": "string",
      "receive": 1,
      "allocate": 1
    }
  ],
  "recentActivity": [
    {
      "id": "00000000-0000-4000-8000-000000000000",
      "movementType": "string",
      "quantity": 1,
      "variantSku": null,
      "variantId": "00000000-0000-4000-8000-000000000000",
      "referenceType": null,
      "referenceId": null,
      "reason": null,
      "locationLabel": "string",
      "performedAt": "string"
    }
  ]
}
401Unauthorized
Content-Type: application/json
"string"
404Warehouse not found
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/dashboard/operational" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
GET/wms/inventory-profiles
Auth required

List inventory profiles

Returns a paginated collection of inventory profiles scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
catalogProductIdqueryNoany—
catalogVariantIdqueryNoany—
defaultStrategyqueryNoany—
trackLotqueryNoany—
trackSerialqueryNoany—
trackExpirationqueryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated inventory profiles
Content-Type: application/json
{
  "items": [
    {
      "id": null,
      "organization_id": null,
      "tenant_id": null,
      "catalog_product_id": null,
      "catalog_variant_id": null,
      "product_title": null,
      "product_sku": null,
      "variant_name": null,
      "variant_sku": null,
      "default_uom": null,
      "track_lot": null,
      "track_serial": null,
      "track_expiration": null,
      "default_strategy": null,
      "reorder_point": null,
      "safety_stock": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/inventory-profiles?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/wms/inventory-profiles
Auth required

Create inventory profile

Creates a product inventory profile.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "catalogProductId": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": null,
  "defaultUom": "string",
  "defaultStrategy": "fifo"
}

Responses

201Inventory profile created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory-profiles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogProductId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": null,
  \"defaultUom\": \"string\",
  \"defaultStrategy\": \"fifo\"
}"
PUT/wms/inventory-profiles
Auth required

Update inventory profile

Updates an inventory profile by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": null
}

Responses

200Inventory profile updated
Content-Type: application/json
{
  "ok": true
}

Example

curl -X PUT "https://dgital-base.kc-trade.cn/api/wms/inventory-profiles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": null
}"
DELETE/wms/inventory-profiles
Auth required

Delete inventory profile

Soft-deletes an inventory profile by id.

Request body (application/json)

{
  "id": "00000000-0000-4000-8000-000000000000"
}

Responses

200Inventory profile deleted
Content-Type: application/json
{
  "ok": true
}

Example

curl -X DELETE "https://dgital-base.kc-trade.cn/api/wms/inventory-profiles" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"id\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/wms/inventory/adjust
Auth required

Adjust inventory

Applies a manual inventory adjustment and appends a movement ledger row.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "locationId": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": "00000000-0000-4000-8000-000000000000",
  "delta": 1,
  "reason": "string",
  "referenceType": "manual",
  "referenceId": "00000000-0000-4000-8000-000000000000",
  "performedBy": "00000000-0000-4000-8000-000000000000"
}

Responses

200Inventory adjusted
Content-Type: application/json
{
  "ok": true,
  "movementId": "00000000-0000-4000-8000-000000000000"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Insufficient stock
Content-Type: application/json
{
  "error": "string"
}
422Invalid location
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/adjust" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"locationId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": \"00000000-0000-4000-8000-000000000000\",
  \"delta\": 1,
  \"reason\": \"string\",
  \"referenceType\": \"manual\",
  \"referenceId\": \"00000000-0000-4000-8000-000000000000\",
  \"performedBy\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/wms/inventory/allocate
Auth required

Allocate reservation

Converts a reservation from reserved quantity into allocated quantity on the selected stock buckets.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "reservationId": "00000000-0000-4000-8000-000000000000"
}

Responses

200Reservation allocated
Content-Type: application/json
{
  "ok": true,
  "allocationState": "allocated"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Reservation not found
Content-Type: application/json
{
  "error": "string"
}
409Invalid reservation state
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/allocate" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"reservationId\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/wms/inventory/balances
Auth required

List inventory balances

Returns paginated inventory balance buckets for the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
warehouseIdqueryNoany—
locationIdqueryNoany—
catalogVariantIdqueryNoany—
lotIdqueryNoany—
serialNumberqueryNoany—
lowStockqueryNoany—
searchqueryNoany—

Responses

200Inventory balances collection
Content-Type: application/json
{
  "items": [
    {
      "id": null,
      "organization_id": null,
      "tenant_id": null,
      "warehouse_id": null,
      "warehouse_name": null,
      "warehouse_code": null,
      "location_id": null,
      "location_code": null,
      "location_type": null,
      "catalog_variant_id": null,
      "catalog_product_id": null,
      "variant_name": null,
      "variant_sku": null,
      "lot_id": null,
      "serial_number": null,
      "quantity_on_hand": null,
      "quantity_reserved": null,
      "quantity_allocated": null,
      "quantity_available": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/inventory/balances?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/wms/inventory/cycle-count
Auth required

Cycle count reconcile

Reconciles a counted quantity against the current on-hand balance and appends a cycle-count movement when a delta exists.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "locationId": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": "00000000-0000-4000-8000-000000000000",
  "countedQuantity": 1,
  "autoAdjust": true,
  "reason": "string",
  "referenceId": "00000000-0000-4000-8000-000000000000",
  "performedBy": "00000000-0000-4000-8000-000000000000"
}

Responses

200Cycle count reconciled
Content-Type: application/json
{
  "ok": true,
  "adjustmentDelta": "string",
  "movementId": null
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
422Invalid location
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/cycle-count" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"locationId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": \"00000000-0000-4000-8000-000000000000\",
  \"countedQuantity\": 1,
  \"autoAdjust\": true,
  \"reason\": \"string\",
  \"referenceId\": \"00000000-0000-4000-8000-000000000000\",
  \"performedBy\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/wms/inventory/import/apply
Auth required

Apply inventory CSV import

Applies validated inventory import rows via wms.inventory.adjust commands (idempotent skip when delta is zero).

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "importBatchId": "00000000-0000-4000-8000-000000000000",
  "reason": "CSV import inventory receipt",
  "mode": "additive",
  "rows": [
    {
      "rowNumber": 1,
      "warehouseId": "00000000-0000-4000-8000-000000000000",
      "locationId": "00000000-0000-4000-8000-000000000000",
      "catalogVariantId": "00000000-0000-4000-8000-000000000000",
      "quantity": 1,
      "delta": 1
    }
  ]
}

Responses

200Import applied
Content-Type: application/json
{
  "ok": true,
  "importBatchId": "00000000-0000-4000-8000-000000000000",
  "summary": {
    "applied": 1,
    "skipped": 1,
    "failed": 1
  }
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Partial apply failure
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/import/apply" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"importBatchId\": \"00000000-0000-4000-8000-000000000000\",
  \"reason\": \"CSV import inventory receipt\",
  \"mode\": \"additive\",
  \"rows\": [
    {
      \"rowNumber\": 1,
      \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
      \"locationId\": \"00000000-0000-4000-8000-000000000000\",
      \"catalogVariantId\": \"00000000-0000-4000-8000-000000000000\",
      \"quantity\": 1,
      \"delta\": 1
    }
  ]
}"
GET/wms/inventory/import/template
Auth required

Download inventory import CSV template

Returns a CSV template for WMS inventory imports. By default the quantity column is added to existing on-hand stock; the "Reconcile to exact balance" import option treats it as the absolute target balance instead.

Responses

200CSV template file
Content-Type: application/json
"string"

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/inventory/import/template" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/wms/inventory/import/validate
Auth required

Validate inventory CSV import

Dry-run validation for inventory import CSV rows. By default (mode "additive"), quantity is added to existing on-hand stock; opt into mode "reconcile" to instead treat quantity as the absolute target balance (overwrites existing stock, including reducing it). Accepts JSON rows, JSON csv text, or multipart file upload.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "mode": "additive",
  "rows": [
    {}
  ]
}

Responses

200Validation report
Content-Type: application/json
{
  "ok": true,
  "importBatchId": "00000000-0000-4000-8000-000000000000",
  "summary": {
    "totalRows": 1,
    "validRows": 1,
    "errorRows": 1,
    "warningRows": 1,
    "skipRows": 1
  },
  "rows": [
    {
      "rowNumber": 1,
      "status": "valid",
      "errors": [
        "string"
      ],
      "warnings": [
        "string"
      ]
    }
  ]
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/import/validate" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"mode\": \"additive\",
  \"rows\": [
    {}
  ]
}"
POST/wms/inventory/move
Auth required

Move inventory

Moves stock from one location to another within a warehouse and appends a transfer movement.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "fromLocationId": "00000000-0000-4000-8000-000000000000",
  "toLocationId": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": "00000000-0000-4000-8000-000000000000",
  "quantity": 1,
  "reason": "string",
  "referenceType": "manual",
  "referenceId": "00000000-0000-4000-8000-000000000000",
  "performedBy": "00000000-0000-4000-8000-000000000000"
}

Responses

200Inventory moved
Content-Type: application/json
{
  "ok": true,
  "movementId": "00000000-0000-4000-8000-000000000000"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Insufficient stock
Content-Type: application/json
{
  "error": "string"
}
422Invalid location
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/move" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"fromLocationId\": \"00000000-0000-4000-8000-000000000000\",
  \"toLocationId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": \"00000000-0000-4000-8000-000000000000\",
  \"quantity\": 1,
  \"reason\": \"string\",
  \"referenceType\": \"manual\",
  \"referenceId\": \"00000000-0000-4000-8000-000000000000\",
  \"performedBy\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/wms/inventory/movements
Auth required

List inventory movements

Returns paginated inventory ledger entries for the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
warehouseIdqueryNoany—
locationIdqueryNoany—
catalogVariantIdqueryNoany—
lotIdqueryNoany—
referenceTypequeryNoany—
referenceIdqueryNoany—
typequeryNoany—
searchqueryNoany—

Responses

200Inventory movements collection
Content-Type: application/json
{
  "items": [
    {
      "id": null,
      "organization_id": null,
      "tenant_id": null,
      "warehouse_id": null,
      "warehouse_name": null,
      "warehouse_code": null,
      "location_from_id": null,
      "location_from_code": null,
      "location_from_type": null,
      "location_to_id": null,
      "location_to_code": null,
      "location_to_type": null,
      "catalog_variant_id": null,
      "catalog_product_id": null,
      "variant_name": null,
      "variant_sku": null,
      "lot_id": null,
      "serial_number": null,
      "quantity": null,
      "type": null,
      "reference_type": null,
      "reference_id": null,
      "performed_by": null,
      "performed_at": null,
      "received_at": null,
      "reason": null,
      "reason_code": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/inventory/movements?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/wms/inventory/receive
Auth required

Receive inventory

Records inbound inventory receipt and appends a receipt movement ledger row.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "locationId": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": "00000000-0000-4000-8000-000000000000",
  "quantity": 1,
  "referenceType": "po",
  "referenceId": "00000000-0000-4000-8000-000000000000",
  "performedBy": "00000000-0000-4000-8000-000000000000"
}

Responses

200Inventory received
Content-Type: application/json
{
  "ok": true,
  "movementId": "00000000-0000-4000-8000-000000000000"
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
422Invalid location
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/receive" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"locationId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": \"00000000-0000-4000-8000-000000000000\",
  \"quantity\": 1,
  \"referenceType\": \"po\",
  \"referenceId\": \"00000000-0000-4000-8000-000000000000\",
  \"performedBy\": \"00000000-0000-4000-8000-000000000000\"
}"
POST/wms/inventory/release
Auth required

Release reservation

Releases a previously reserved or allocated inventory reservation.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "reservationId": "00000000-0000-4000-8000-000000000000",
  "reason": "string"
}

Responses

200Reservation released
Content-Type: application/json
{
  "ok": true
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
404Reservation not found
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/release" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"reservationId\": \"00000000-0000-4000-8000-000000000000\",
  \"reason\": \"string\"
}"
GET/wms/inventory/reservations
Auth required

List inventory reservations

Returns paginated inventory reservations for the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
warehouseIdqueryNoany—
catalogVariantIdqueryNoany—
lotIdqueryNoany—
sourceTypequeryNoany—
sourceIdqueryNoany—
statusqueryNoany—
searchqueryNoany—

Responses

200Inventory reservations collection
Content-Type: application/json
{
  "items": [
    {
      "id": null,
      "organization_id": null,
      "tenant_id": null,
      "warehouse_id": null,
      "warehouse_name": null,
      "warehouse_code": null,
      "catalog_variant_id": null,
      "catalog_product_id": null,
      "variant_name": null,
      "variant_sku": null,
      "lot_id": null,
      "serial_number": null,
      "quantity": null,
      "source_type": null,
      "source_id": null,
      "source_label": null,
      "expires_at": null,
      "status": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/inventory/reservations?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/wms/inventory/reserve
Auth required

Reserve inventory

Creates an inventory reservation and assigns available buckets using the configured stock strategy.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "catalogVariantId": "00000000-0000-4000-8000-000000000000",
  "quantity": 1,
  "sourceType": "order",
  "sourceId": "00000000-0000-4000-8000-000000000000"
}

Responses

200Inventory reserved
Content-Type: application/json
{
  "ok": true,
  "reservationId": "00000000-0000-4000-8000-000000000000",
  "allocatedBuckets": [
    {
      "locationId": "00000000-0000-4000-8000-000000000000",
      "lotId": null,
      "quantity": "string"
    }
  ]
}
400Validation failed
Content-Type: application/json
{
  "error": "string"
}
401Unauthorized
Content-Type: application/json
{
  "error": "string"
}
409Insufficient stock
Content-Type: application/json
{
  "error": "string"
}
422Invalid tracking state
Content-Type: application/json
{
  "error": "string"
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/inventory/reserve" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"catalogVariantId\": \"00000000-0000-4000-8000-000000000000\",
  \"quantity\": 1,
  \"sourceType\": \"order\",
  \"sourceId\": \"00000000-0000-4000-8000-000000000000\"
}"
GET/wms/locations
Auth required

List warehouse locations

Returns a paginated collection of warehouse locations scoped to the authenticated organization.

Parameters

NameInRequiredSchemaDescription
pagequeryNoany—
pageSizequeryNoany—
searchqueryNoany—
warehouseIdqueryNoany—
parentIdqueryNoany—
typequeryNoany—
isActivequeryNoany—
idsqueryNoanyComma-separated list of record UUIDs to filter by (max 200).
sortFieldqueryNoany—
sortDirqueryNoany—

Responses

200Paginated warehouse locations
Content-Type: application/json
{
  "items": [
    {
      "id": null,
      "organization_id": null,
      "tenant_id": null,
      "warehouse_id": null,
      "warehouse_name": null,
      "warehouse_code": null,
      "parent_id": null,
      "code": null,
      "type": null,
      "is_active": null,
      "capacity_units": null,
      "capacity_weight": null,
      "created_at": null,
      "updated_at": null
    }
  ],
  "total": 1,
  "totalPages": 1
}

Example

curl -X GET "https://dgital-base.kc-trade.cn/api/wms/locations?page=1&pageSize=25" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>"
POST/wms/locations
Auth required

Create warehouse location

Creates a storage location within a warehouse hierarchy.

Request body (application/json)

{
  "organizationId": "00000000-0000-4000-8000-000000000000",
  "tenantId": "00000000-0000-4000-8000-000000000000",
  "warehouseId": "00000000-0000-4000-8000-000000000000",
  "code": "string",
  "type": "zone",
  "parentId": null
}

Responses

201Warehouse location created
Content-Type: application/json
{
  "id": null
}

Example

curl -X POST "https://dgital-base.kc-trade.cn/api/wms/locations" \
  -H "Accept: application/json" \
  -H "authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d "{
  \"organizationId\": \"00000000-0000-4000-8000-000000000000\",
  \"tenantId\": \"00000000-0000-4000-8000-000000000000\",
  \"warehouseId\": \"00000000-0000-4000-8000-000000000000\",
  \"code\": \"string\",
  \"type\": \"zone\",
  \"parentId\": null
}"