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

# Get Recovery Status by Idempotency Key

> Poll the current status of a recovery attempt by the `idempotencyKey` you supplied to `/api/recovery/execute`. An alternative to looking up by transaction ID.

> Clients can only query their own transactions.




## OpenAPI

````yaml /api-reference/openapi.yaml get /api/recovery/status
openapi: 3.0.3
info:
  title: Revtain API
  description: >
    Recover failed payments. No checkout changes. Works with your existing
    payment stack.


    ## Choose Your Path


    **Using Chargebee, Recurly, Stripe Billing, Braintree, Zuora, or Shopify
    (ReCharge)?**

    Use a Connector — paste one webhook URL, no code, 5 minutes.


    **Custom billing system or want full API control?**

    Use the Recovery Engine directly. The quickstart gets you to a working
    recovery call in 60 seconds.


    ## Authentication


    Pass your API key via the `X-API-KEY` header on all requests:


    ```

    X-API-KEY: rev_dTviCg52T8gLPCjrrW4KA0NKf_f5pQgk

    ```


    Keep this secret. Your API key can trigger charges. Never expose it in
    client-side code, public repos, or logs.


    ## Base URL


    ```

    https://api.revtain.com

    ```


    Same URL for testing and production. Test mode is controlled by your gateway
    type — onboard with a test gateway (e.g., Stripe `sk_test_...`) for sandbox,
    live key for production.
  version: 1.0.0
  contact:
    email: support@revtain.com
servers:
  - url: https://api.revtain.com
    description: Production & Sandbox (test mode controlled by gateway key)
security:
  - ApiKeyAuth: []
tags:
  - name: Recovery Engine
    description: Trigger and track payment recovery attempts
  - name: Predictive Risk Engine
    description: Pre-screen payments before they fail
  - name: Retention
    description: Hosted cancel flow to reduce voluntary churn
  - name: Health
    description: Service health check
paths:
  /api/recovery/status:
    get:
      tags:
        - Recovery Engine
      summary: Get Recovery Status by Idempotency Key
      description: >
        Poll the current status of a recovery attempt by the `idempotencyKey`
        you supplied to `/api/recovery/execute`. An alternative to looking up by
        transaction ID.


        > Clients can only query their own transactions.
      operationId: getRecoveryStatusByIdempotencyKey
      parameters:
        - name: idempotencyKey
          in: query
          required: true
          description: The idempotency key you supplied to `/api/recovery/execute`.
          schema:
            type: string
          example: order_12345_retry_1
      responses:
        '200':
          description: Recovery status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecoveryStatusResponse'
              example:
                transactionId: FAILED_API_1773792234011
                status: failed
                recovered: false
                amount: 5000
                currency: USD
                recoveredAt: null
                strategyUsed: all_failed
                attemptCount: 2
                lastDeclineCode: do_not_honor
                recommendedAction: retry_later
                recommendedActionReason: >-
                  The issuer returned a soft decline. A later retry, or a card
                  update, may succeed.
        '400':
          description: >-
            Validation error — provide a transactionId in the path or an
            idempotencyKey query parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Transaction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
components:
  schemas:
    RecoveryStatusResponse:
      type: object
      properties:
        transactionId:
          type: string
          example: 01KKZ14FEZK152ZBXEM2XK1B0C
        status:
          type: string
          enum:
            - succeeded
            - failed
            - blocked
            - unknown
          example: succeeded
        recovered:
          type: boolean
          example: true
        amount:
          type: integer
          example: 5000
        currency:
          type: string
          example: USD
        recoveredAt:
          type: string
          format: date-time
          nullable: true
          example: '2026-03-17T23:15:21.000Z'
        strategyUsed:
          type: string
          example: primary
        attemptCount:
          type: integer
          description: Number of gateway attempts made during the cascade.
          example: 2
        lastDeclineCode:
          type: string
          nullable: true
          description: The most recent decline code seen for this recovery.
          example: do_not_honor
        recommendedAction:
          type: string
          enum:
            - request_card_update
            - retry_later
            - manual_review
            - monitor
          description: What to do next. Present only when the recovery did not succeed.
          example: retry_later
        recommendedActionReason:
          type: string
          description: >-
            Human-readable explanation of the recommended action. Present only
            when the recovery did not succeed.
          example: >-
            The issuer returned a soft decline. A later retry, or a card update,
            may succeed.
    ValidationError:
      type: object
      properties:
        error:
          type: string
          example: Validation failed.
        details:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            paymentMethodToken:
              - Payment method token is required
            amount:
              - Amount must be a positive number
    UnauthorizedError:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized. Missing or invalid API key.
    NotFoundError:
      type: object
      properties:
        error:
          type: string
          example: Transaction not found.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: 'Your Revtain API key (format: `rev_xxx`). Provided during onboarding.'

````