> ## 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.

# 获取交易状态

获取与您的 Localpayment 账户关联的任意交易的实时状态更新，以监控其当前进度。


## OpenAPI

````yaml openapi/zh/localpayment.json GET /api/transactions/{externalId}/status
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/transactions/{externalId}/status:
    get:
      summary: 获取交易状态
      operationId: get-transaction-status
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          required: true
          schema:
            type: string
        - name: externalId
          in: path
          description: 您这边会生成一个用于交易追溯的ID。该ID必须唯一，且仅接受字母数字字符和连字符（例如UUID4）。您还可以使用内部ID检索交易状态。
          required: true
          schema:
            type: string
            pattern: '[a-zA-Z0-9\- ]+'
            examples:
              - 53025bf4-4c87-4b4f-8fea-b47004440f37
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  internalId:
                    type: string
                    description: Localpayment交易标识符。
                  externalId:
                    type: string
                    description: 系统生成的唯一标识符，用于跟踪交易（包含字母、数字和连字符）。我们建议使用 UUID4 以确保唯一性。
                  status:
                    type: object
                    title: 状态
                    description: 操作状态。
                    properties:
                      code:
                        type: string
                        description: '[状态码](/zh/reference/transaction-status-error-codes)。'
                      description:
                        type: string
                        description: '[状态描述](/zh/reference/transaction-status-error-codes)。'
                      detail:
                        type: string
                        description: 更多状态信息。
                required:
                  - internalId
                  - externalId
                x-examples:
                  Example 1:
                    internalId: c948f6de-3082-4e64-bd30-916799cc56ea
                    externalId: '123456'
                    status:
                      code: '200'
                      description: COMPLETED
                      detail: INTERNAL TRANSFER
              examples:
                200 - COMPLETED:
                  value:
                    internalId: c948f6de-3082-4e64-bd30-916799cc56ea
                    externalId: '123456'
                    status:
                      code: '200'
                      description: COMPLETED
                      detail: INTERNAL TRANSFER
                716 - REJECTED:
                  value:
                    internalId: 383a29f4-5ed2-4596-89d6-f383923a1433
                    externalId: tw-000001
                    status:
                      code: '716'
                      description: REJECTED
                      detail: TransactionNotSupported
        '401':
          description: 未经授权。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                  code:
                    type: string
                    description: 状态码。
                  messages:
                    type: array
                    description: 消息列表。
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token 类。
                        token_type:
                          type: string
                          description: 令牌类型。
                        message:
                          type: string
                          description: 包含补充信息的消息。
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '404':
          description: 未找到
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    title: 状态
                    description: 操作状态。
                    properties:
                      code:
                        type: string
                        description: '[状态码](/zh/reference/transaction-status-error-codes)。'
                      description:
                        type: string
                        description: '[状态描述](/zh/reference/transaction-status-error-codes)。'
                      detail:
                        type: string
                        description: 更多状态信息。
              examples:
                404 - Transaction not found:
                  value:
                    status:
                      code: '404'
                      description: ERROR
                      detail: Transaction not found
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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