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

# Revoke instruction

> Revokes a purchase instruction by setting its Clink status to `CANCELLED`. No request is sent to the card network: an instruction that already exists on the network (for example Visa VIC or Mastercard Agent Pay) stays usable there until it expires or its limit is exhausted. Requires `portal:write`. Pass the instruction ID (`inst_...`), not a payment credential ID.

Revokes a purchase instruction so it can no longer be used to obtain a credential or authorize a payment. Pass the **instruction ID** (`inst_...`), not a payment credential ID; a credential issued for an instruction contains that instruction's ID.

## What revoke changes

Revoke is a Clink-side status change only:

* `ACTIVE`, `CREATED`, and `PENDING` instructions become `CANCELLED` and record `revoked_at`.
* The instruction can no longer be activated by an outstanding activation link, and Clink refuses new charges against it.
* **No revocation is sent to the card network.** An instruction that already exists on Visa, Mastercard, or another scheme (for example Visa VIC or Mastercard Agent Pay) stays valid there until it expires or its limit is exhausted. Do not use revoke to release network-side spending limits; to stop network-side use, let the instruction expire or revoke it on the network side separately.

## Idempotency and final states

| Current status | Result | Response |
| - | - | - |
| `ACTIVE`, `CREATED`, `PENDING` | Becomes `CANCELLED` | `200`, `status` = `CANCELLED` |
| `CANCELLED` | No change; `revoked_at` keeps the original revoke time | `200`, `status` = `CANCELLED` |
| `COMPLETED`, `EXPIRED`, `DECLINED` | No change | `200`, `status` = the current final status |
| `INPROGRESS` | Rejected: a payment is in progress | `409`, `code` `71211028` (`portal_invalid_state`) |

A `200` does not always mean the instruction is now `CANCELLED`: read `status` in the response. Repeated calls are safe and do not create duplicate cancellation events.

## Errors

* `401` — missing, expired, or invalid portal token.
* `403` — the token lacks `portal:write`.
* `404` — the instruction does not exist or does not belong to the token's customer.
* `409` — `portal_invalid_state`; the instruction has a payment in progress, or its status kept changing during the call. Retry later.


## OpenAPI

````yaml POST /agent/platform/authorizations/{instructionId}/revoke
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/authorizations/{instructionId}/revoke:
    post:
      summary: Revoke instruction
      description: >-
        Revokes a purchase instruction by setting its Clink status to
        `CANCELLED`. No request is sent to the card network: an instruction that
        already exists on the network (for example Visa VIC or Mastercard Agent
        Pay) stays usable there until it expires or its limit is exhausted.
        Requires `portal:write`. Pass the instruction ID (`inst_...`), not a
        payment credential ID.
      operationId: revokeAuthorization
      parameters:
        - name: instructionId
          in: path
          required: true
          description: >-
            Instruction ID. A payment credential issued for the instruction
            contains this ID.
          schema:
            type: string
            example: inst_...
      responses:
        '200':
          description: >-
            The instruction is revoked, or was already final. Read `status` for
            the current state.
          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/RevokeAuthorizationResponse'
              example:
                code: 200
                msg: Success
                data:
                  instruction_id: inst_...
                  status: CANCELLED
                  revoked_at: '2026-11-23T06:00:00Z'
        '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 instruction does not exist or does not belong to the token's
            customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            The instruction cannot be revoked right now: a payment is in
            progress, or its status kept changing during the call (`code`
            `71211028`, `portal_invalid_state`). Retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RevokeAuthorizationResponse:
      type: object
      properties:
        instruction_id:
          type: string
          description: Instruction ID.
          example: inst_...
        status:
          type: string
          description: >-
            Instruction status after the call. `CANCELLED` means the instruction
            is revoked; any other value means it had already reached that
            terminal status and was left unchanged.
          example: CANCELLED
        revoked_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the instruction was revoked, as an ISO-8601 UTC instant. `null`
            when the instruction is final but was never cancelled (for example
            `COMPLETED`, `EXPIRED`, `DECLINED`); an already-`CANCELLED`
            instruction returns its original revoke time.
          example: '2026-11-23T06:00:00Z'
    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.