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

# Log Organic Success (Pulse)

> Logs an organic success — a transaction that succeeded on the first try without needing recovery.

This data is used to calculate the **Revtain Lift** metric (the percentage improvement Revtain adds over your baseline success rate).

> **Important:** Without pulse data, your monthly CFO report will show a misleadingly high recovery rate because the only transactions recorded are recovery attempts.




## OpenAPI

````yaml /api-reference/openapi.yaml post /api/recovery/pulse
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/pulse:
    post:
      tags:
        - Recovery Engine
      summary: Log Organic Success (Pulse)
      description: >
        Logs an organic success — a transaction that succeeded on the first try
        without needing recovery.


        This data is used to calculate the **Revtain Lift** metric (the
        percentage improvement Revtain adds over your baseline success rate).


        > **Important:** Without pulse data, your monthly CFO report will show a
        misleadingly high recovery rate because the only transactions recorded
        are recovery attempts.
      operationId: logPulse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PulseRequest'
            example:
              amount: 5000
              currency: USD
              transactionId: your_internal_tx_id_123
      responses:
        '200':
          description: Organic success logged
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PulseResponse'
              example:
                success: true
                message: Organic success logged
                transactionId: da646dba-ce56-4483-ad0a-2a4fac54a5e2
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
components:
  schemas:
    PulseRequest:
      type: object
      required:
        - amount
      properties:
        amount:
          type: integer
          minimum: 50
          maximum: 100000000
          description: Amount in smallest currency unit.
          example: 5000
        currency:
          type: string
          default: USD
          example: USD
        transactionId:
          type: string
          description: >-
            Your internal transaction ID. If omitted, Revtain generates one
            automatically.
          example: your_internal_tx_id_123
    PulseResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Organic success logged
        transactionId:
          type: string
          example: da646dba-ce56-4483-ad0a-2a4fac54a5e2
    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.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: 'Your Revtain API key (format: `rev_xxx`). Provided during onboarding.'

````