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

# Report credential result

> Reports the outcome observed on the merchant page after using a credential. Requires `portal:write`.

Clink uses the report to close the order and the instruction usage. A report records what the merchant page showed; it does not execute or verify the payment.

> [!NOTE]
>
> This is the payment result confirmation endpoint. It is the only entry point for confirming or reporting a transaction result; there is no separate confirm-transaction API. Use it to report the final outcome, including after an `UNKNOWN` report, within the 24-hour reporting window described below.

| Outcome | Meaning |
| - | - |
| `SUCCEEDED` | The merchant explicitly confirmed that the payment succeeded. |
| `FAILED` | The merchant explicitly showed failure after the card was submitted. |
| `NOT_SUBMITTED` | The card was never submitted. |
| `UNKNOWN` | The card was submitted, but the result cannot be determined. Clink does not publish a result and returns `PENDING` with `report_deadline`; report the final outcome before that time. |

## Reporting rules

* Clink accepts a terminal result until `report_deadline`, 24 hours after the credential is issued. A report after the window returns `410` with `code` `71211018` (`report_window_expired`).
* A usage that does not exist, or does not belong to the token's customer, returns `404`.
* Clink compares terminal results in two classes: `SUCCEEDED` is success; `FAILED` and `NOT_SUBMITTED` are both failure. Repeating a result in the same class returns the recorded result with HTTP `200`; for example, reporting `FAILED` after `NOT_SUBMITTED` does not conflict. Reporting the other class after a terminal result is recorded returns `409` with `code` `71211017` (`result_already_reported`).
* `SUCCEEDED`, `FAILED`, and `NOT_SUBMITTED` close the usage and are delivered to Clink's existing payment-result pipeline.
* `UNKNOWN` records no terminal result, publishes no result message, and returns `PENDING`; report the final outcome before `report_deadline`.
* `paid_amount` and `currency_code` must be sent together. When `paid_amount` differs from the authorized amount, Clink records `paid_amount_mismatch: true` and keeps the authorized amount.


## OpenAPI

````yaml POST /agent/platform/credential-results
openapi: 3.1.0
info:
  title: Clink Agent Portal API
  description: >-
    Agent Portal APIs let an Agent platform read and manage one user's Clink
    account with a portal user token: payment methods, orders, refunds, purchase
    instructions, payment credentials, payment results, and settings.
  version: 1.0.0
servers:
  - url: https://uat-api.clinkbill.com
    description: Sandbox
security:
  - PortalToken: []
paths:
  /agent/platform/credential-results:
    post:
      summary: Report credential result
      description: >-
        Reports the outcome observed on the merchant page after using a
        credential. Requires `portal:write`.
      operationId: reportCredentialResult
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportResultRequest'
            example:
              client_reference_id: platform-ref-001
              outcome: SUCCEEDED
              paid_amount: '12.50'
              currency_code: USD
              failure_reason: null
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    format: int32
                    description: '`200` on success.'
                    example: 200
                  msg:
                    type: string
                    description: Result message.
                    example: Success
                  data:
                    $ref: '#/components/schemas/ReportResultResponse'
              example:
                code: 200
                msg: Success
                data:
                  status: SUCCEEDED
                  report_deadline: '2026-11-10T09:00:00Z'
                  paid_amount_mismatch: false
        '400':
          description: Invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing, expired, or invalid portal token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Wrong token audience, missing `portal:write` scope, or a platform
            client token used instead of a portal token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The usage does not exist or does not belong to the token's customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            A terminal result of the other class was already reported
            (`result_already_reported`, `code` `71211017`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '410':
          description: >-
            The reporting window has expired (`report_window_expired`, `code`
            `71211018`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ReportResultRequest:
      type: object
      required:
        - client_reference_id
        - outcome
      properties:
        client_reference_id:
          type: string
          description: >-
            Value used when requesting the credential. Clink finds the usage by
            this value for the token's customer.
          example: platform-ref-001
        outcome:
          type: string
          description: >-
            `SUCCEEDED`: the merchant explicitly confirmed that the payment
            succeeded. `FAILED`: the merchant explicitly showed failure after
            the card was submitted. `NOT_SUBMITTED`: the card was never
            submitted. `UNKNOWN`: the card was submitted, but the result cannot
            be determined; Clink returns `PENDING` with `report_deadline`.
          enum:
            - SUCCEEDED
            - FAILED
            - NOT_SUBMITTED
            - UNKNOWN
          example: SUCCEEDED
        paid_amount:
          type: string
          description: >-
            Amount shown by the merchant, decimal string in major currency
            units. Must be paired with `currency_code`.
          example: '12.50'
        currency_code:
          type: string
          description: Three-letter currency code. Must be paired with `paid_amount`.
          example: USD
        failure_reason:
          type: string
          description: >-
            Reason for a failed or unsubmitted payment. Accepted only with
            `FAILED` or `NOT_SUBMITTED`.
          enum:
            - CARD_DECLINED
            - AUTHENTICATION_REQUIRED
            - AMOUNT_CHANGED
            - CREDENTIAL_EXPIRED
            - CREDENTIAL_LOST
            - MERCHANT_ERROR
            - BUYER_CANCELLED
            - OTHER
    ReportResultResponse:
      type: object
      properties:
        status:
          type: string
          description: Recorded outcome. For an `UNKNOWN` report it is `PENDING`.
          example: SUCCEEDED
        report_deadline:
          type: string
          description: Latest time a terminal result can be reported.
          format: date-time
          example: '2026-11-10T09:00:00Z'
        paid_amount_mismatch:
          type: boolean
          description: >-
            `true` when `paid_amount` differs from the authorized amount. The
            report does not overwrite the authorized amount.
          example: false
    ErrorResponse:
      type: object
      description: Business errors use the standard envelope without `data`.
      properties:
        code:
          type: integer
          description: >-
            Numeric business error code. Judge an error by the HTTP status
            together with `code`, not by a string error code.
        msg:
          type: string
          description: Human-readable description.
  securitySchemes:
    PortalToken:
      type: http
      scheme: bearer
      description: >-
        Portal user token from `POST /agent/cwallet/platform/portal/tokens`.
        Reads require `portal:read`; writes require `portal:write`.

````

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