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

# Block, reactivate or delete an instrument

> Changes the status of an instrument. Send its ID as `instrument_id` and one
`action_type`:

- `BLOCK`: an `ACTIVE` instrument becomes `BLOCKED`. It can't be used for
  payments until you reactivate it.
- `ACTIVATE`: a `BLOCKED` or `EXPIRED` instrument becomes `ACTIVE` again.
- `DELETE`: the instrument becomes `DELETED`. This is permanent, and it no
  longer appears when you list instruments by `holder_id`.

If the instrument already has the status the action leads to, nothing
changes and you still get `200`. An action the current status doesn't allow
returns `409`: `BLOCK` on an `EXPIRED` instrument, or `BLOCK` or `ACTIVATE`
on a `DELETED` one.



## OpenAPI

````yaml /openapi/payment-instruments.json put /instruments/action
openapi: 3.1.0
info:
  title: lite - Payment Instruments
  version: 1.0.0
servers:
  - url: https://api.lite.sa
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Payment Instruments
    description: Create, manage, and perform actions on payment instruments
  - name: Encryption
    description: Get the public key used to encrypt card data before sending it to lite
paths:
  /instruments/action:
    put:
      tags:
        - Payment Instruments
      summary: Block, reactivate or delete an instrument
      description: >-
        Changes the status of an instrument. Send its ID as `instrument_id` and
        one

        `action_type`:


        - `BLOCK`: an `ACTIVE` instrument becomes `BLOCKED`. It can't be used
        for
          payments until you reactivate it.
        - `ACTIVATE`: a `BLOCKED` or `EXPIRED` instrument becomes `ACTIVE`
        again.

        - `DELETE`: the instrument becomes `DELETED`. This is permanent, and it
        no
          longer appears when you list instruments by `holder_id`.

        If the instrument already has the status the action leads to, nothing

        changes and you still get `200`. An action the current status doesn't
        allow

        returns `409`: `BLOCK` on an `EXPIRED` instrument, or `BLOCK` or
        `ACTIVATE`

        on a `DELETED` one.
      operationId: lite.instruments.instrumentAction
      parameters:
        - $ref: '#/components/parameters/x-correlation-id'
        - $ref: '#/components/parameters/x-business-account-id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - instrument_id
                - action_type
              properties:
                instrument_id:
                  type: string
                  format: uuid
                  description: ID of the instrument
                  example: 550e8400-e29b-41d4-a716-446655440000
                action_type:
                  type: string
                  description: What to do with the instrument
                  example: BLOCK
                  oneOf:
                    - title: Block
                      const: BLOCK
                      description: Stop payments with an `ACTIVE` instrument
                    - title: Activate
                      const: ACTIVATE
                      description: Make a `BLOCKED` or `EXPIRED` instrument `ACTIVE` again
                    - title: Delete
                      const: DELETE
                      description: Delete the instrument permanently
            examples:
              block:
                summary: Block an instrument
                value:
                  instrument_id: 550e8400-e29b-41d4-a716-446655440000
                  action_type: BLOCK
              activate:
                summary: Reactivate a blocked or expired instrument
                value:
                  instrument_id: 550e8400-e29b-41d4-a716-446655440000
                  action_type: ACTIVATE
              delete:
                summary: Delete an instrument
                value:
                  instrument_id: 550e8400-e29b-41d4-a716-446655440000
                  action_type: DELETE
      responses:
        '200':
          description: The instrument has the status the action leads to.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                properties:
                  success:
                    type: boolean
                    description: >-
                      Always `true`. A failed action returns an error status
                      instead
                    example: true
                  message:
                    type: string
                    example: Action executed successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    x-correlation-id:
      name: x-correlation-id
      in: header
      required: false
      description: >-
        Unique identifier for request tracing. Generated by the client or server
        if not provided.
      schema:
        type: string
        format: uuid
        example: 550e8400-e29b-41d4-a716-446655440000
    x-business-account-id:
      name: x-business-account-id
      in: header
      required: false
      description: >-
        The business account to act on, for platform use cases. When sent, that
        account is the merchant for the request: resources are created under it,
        reads and `404` checks are scoped to it, and per-merchant uniqueness
        (such as `merchant_reference_id`) applies within it. The API key's own
        account is recorded as the account acting on its behalf. Omit it to act
        on the API key's own account.
      schema:
        type: string
        format: uuid
        example: 550e8400-e29b-41d4-a716-446655440000
  responses:
    BadRequest:
      description: >
        The request was invalid or malformed.


        Returned when:

        - Request validation fails (missing required fields, invalid field
        formats)

        - Payment details do not match the session (amount, currency, order
        reference mismatch)

        - The operation is not allowed given the current resource state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    Unauthorized:
      description: >
        lite's API gateway couldn't authenticate the request: the API key is
        missing, malformed,

        unknown or revoked, or the request sent an `Authorization` header. The
        body is the gateway's,

        not the `errors` array.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayUnauthorized'
    Forbidden:
      description: >
        The request was refused.


        Returned when:

        - The API key lacks the permission for this operation (`FORBIDDEN`, in
        the `errors` array)

        - `x-business-account-id` names an account the key can't act on

        - The gateway's security filter matched markup or code-like text in the
        body, query or headers
          (gateway body, with an `X-Security-Block` header)
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ApiErrorResponse'
              - $ref: '#/components/schemas/GatewayError'
    NotFound:
      description: |
        The requested resource was not found.

        Returned when:
        - The specified resource ID does not exist
        - The path does not match any known endpoint
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ApiErrorResponse'
              - $ref: '#/components/schemas/GatewayError'
    Conflict:
      description: |
        The request conflicts with the current state of the resource.

        Returned when:
        - A resource with the same unique key already exists
        - The operation cannot be performed due to a conflicting state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
    InternalServerError:
      description: >
        An unexpected error occurred on the server.


        The request may have taken effect. Before you retry a create, check
        whether it went through:

        - For a payment, call `GET /payments?order_id=<reference>`.

        - A checkout session that was created answers a retry for the same
        `order.reference` with `409`.

        - Payments and payment links return this same error for 120 seconds to a
        retry with the same
          `x-idempotency-key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
  schemas:
    ApiErrorResponse:
      type: object
      description: >
        Error body returned by endpoints behind the external exception filter.
        Branch on

        `errors[].code`; `message` is readable text whose wording may change.
      required:
        - errors
        - request_id
      properties:
        errors:
          type: array
          description: >-
            One item per problem. A validation failure returns one item per
            invalid field.
          minItems: 1
          items:
            type: object
            required:
              - category
              - code
              - message
              - retriable
            properties:
              category:
                type: string
                description: Broad class of the error
                enum:
                  - SETUP
                  - VALIDATION
                  - INSTRUMENT
                  - ISSUER
                  - FRAUD
                  - WORKFLOW
                  - CONNECTION
                  - SYSTEM
              code:
                type: string
                description: Stable error code to branch on
              message:
                type: string
                description: Human-readable description of the error
              field:
                type: string
                description: The invalid request field. Present on validation errors only.
              retriable:
                type: boolean
                description: >-
                  Whether a later retry of the same request may succeed. On
                  `POST /payments` and `POST /payment-links`, a retry with the
                  same `x-idempotency-key` (or, without one, the same reference)
                  within 120 seconds gets this same error back. So when
                  `retriable` is `true`, retry with a new key or wait 120
                  seconds.
        request_id:
          type: string
          description: Correlation ID of the request. Include it when contacting support.
    GatewayUnauthorized:
      type: object
      description: >-
        Body of a 401 from lite's API gateway. It is not the `errors` array that
        lite's services return. `reason` says what to fix.
      required:
        - error
        - reason
        - message
      properties:
        error:
          type: string
          example: unauthorized
        reason:
          type: string
          description: What to fix.
          example: MALFORMED_CREDENTIAL
          oneOf:
            - title: No Credentials
              const: NO_CREDENTIALS
              description: No `x-api-key` header
            - title: Malformed Credential
              const: MALFORMED_CREDENTIAL
              description: The key doesn't start with `sk_live_` or `sk_sandbox_`
            - title: API Key Invalid
              const: API_KEY_INVALID
              description: Unknown or revoked key
            - title: Auth Type Not Allowed
              const: AUTH_TYPE_NOT_ALLOWED
              description: 'The request sent `Authorization: Bearer` instead of `x-api-key`'
            - title: Both Credentials
              const: BOTH_CREDENTIALS
              description: 'The request sent both `x-api-key` and `Authorization: Bearer`'
        message:
          type: string
          example: Authentication failed - invalid or missing credentials
        correlationId:
          type: string
          description: >-
            Quote it to lite support. Also sent in the `X-Correlation-Id`
            response header. Spelled in camelCase, as the gateway sends it.
    GatewayError:
      type: object
      description: >-
        Body of an error raised by lite's API gateway before the request reaches
        a service: an unknown path (404), a request blocked by the security
        filter (403, with an `X-Security-Block` header) or a body over 50 KB
        (413).
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: integer
              example: 403
            message:
              type: string
              example: Forbidden
            details:
              type: string
              description: What the security filter matched. Absent on 404.
            timestamp:
              type: string
              format: date-time
            correlationId:
              type: string
              description: >-
                Quote it to lite support. Spelled in camelCase, as the gateway
                sends it, unlike the `correlation_id` in service errors.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your secret API key from the dashboard. Keys starting `sk_sandbox_` work
        in test mode and keys starting `sk_live_` in live mode, on the same base
        URL. Don't send an `Authorization` header with it.

````

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