> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取状态历史记录

返回实体的状态转换历史，包含每次更改的执行方、原因和关联 ID。

* 条目按时间顺序排列。
* 由 Localpayment 执行的转换（IN\_REVIEW、ACTIVE、REJECTED、BLOCKED，以及因需更正而返回 PENDING\_KYC）及其原因会显示在此处。

错误使用带有固定 `code` 的 `application/problem+json`。完整目录：[实体状态和错误代码](https://docs.localpayment.com/zh/reference/entity-statuses-and-error-codes.md)。


## OpenAPI

````yaml openapi/zh/localpayment.json GET /api/entity/v1/entities/{entityId}/status-history
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/entity/v1/entities/{entityId}/status-history:
    get:
      summary: 获取状态历史记录
      operationId: get-entity-status-history
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。系统将据此识别您的商户账户和执行操作的用户。
          required: true
          schema:
            type: string
            examples:
              - Bearer <your_access_token>
        - name: X-Correlation-ID
          in: header
          description: 跟踪标识符（UUID）。会在响应中原样返回；如未提供，则由 Localpayment 生成。
          required: false
          schema:
            type: string
            examples:
              - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
        - name: entityId
          in: path
          description: 实体的 internalId。
          required: true
          schema:
            type: string
            examples:
              - 5aced5da-40c1-4bec-85ff-c8cd1bcb4526
            format: uuid
      responses:
        '200':
          description: OK。
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    fromStatus:
                      type: string
                      examples:
                        - PENDING_KYC
                      enum:
                        - PENDING_KYC
                        - IN_REVIEW
                        - ACTIVE
                        - REJECTED
                        - BLOCKED
                        - CLOSED
                      description: 过渡。
                    toStatus:
                      type: string
                      examples:
                        - IN_REVIEW
                      enum:
                        - PENDING_KYC
                        - IN_REVIEW
                        - ACTIVE
                        - REJECTED
                        - BLOCKED
                        - CLOSED
                      description: 过渡。
                    reason:
                      type: string
                      examples:
                        - Review started
                      description: 执行方给出的原因（在 REJECTED 和 BLOCKED 状态下始终存在）。
                    changedBy:
                      type: string
                      examples:
                        - '12345'
                      description: 进行更改的用户：您的帐户用户（来自访问令牌）或 Localpayment Compliance 用户。
                    correlationId:
                      type: string
                      examples:
                        - b68165b9-1d60-4f9d-9919-7fee12411714
                      format: uuid
                      description: 导致变更的请求的关联 ID。
                    createdAt:
                      type: string
                      examples:
                        - '2024-01-15T17:03:15Z'
                      format: date-time
                      description: 事情发生的时候。
              examples:
                Example 1:
                  value:
                    - fromStatus: PENDING_KYC
                      toStatus: IN_REVIEW
                      reason: Review started
                      changedBy: '12345'
                      correlationId: b68165b9-1d60-4f9d-9919-7fee12411714
                      createdAt: '2024-01-15T17:03:15Z'
                    - fromStatus: IN_REVIEW
                      toStatus: ACTIVE
                      reason: KYC approved
                      changedBy: '67890'
                      correlationId: b07a3416-11fb-48d8-8671-be471694f0a2
                      createdAt: '2024-01-15T17:03:22Z'
        '401':
          description: 未授权。UNAUTHORIZED：缺少或无效的访问令牌。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - UNAUTHORIZED:
                  value:
                    type: about:blank
                    title: Unauthorized
                    status: 401
                    detail: Missing or invalid access token.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/status-history
                    code: UNAUTHORIZED
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '404':
          description: 未找到。ENTITY_NOT_FOUND：该实体不存在或属于其他商家。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - ENTITY_NOT_FOUND:
                  value:
                    type: about:blank
                    title: Not found
                    status: 404
                    detail: The entity does not exist or belongs to another merchant.
                    instance: >-
                      /api/entity/v1/entities/5aced5da-40c1-4bec-85ff-c8cd1bcb4526/status-history
                    code: ENTITY_NOT_FOUND
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
      security:
        - token: []
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.