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

# Retry Invoice Now

> Requeue a past-due invoice for an immediate smart-retry attempt, subject to the same safety checks the automated engine applies.

Requeues a past-due invoice so the retry worker picks it up on its next pass
instead of waiting for `next_retry_at`. The worker then runs the normal settle
path — this endpoint charges nothing itself and posts no ledger legs.

The request is refused with a `409` unless the invoice is tenant-owned,
`past_due`, not paused, not collected by a mandate, and has no payment attempt
still in flight — the same envelope the automated engine honors, so a manual
retry can never stack a second charge on a settling one. Find candidates on the
[collections queue](/api-reference/collections/queue); if the invoice is
paused, resume it with [Pause Dunning](/api-reference/collections/pause) first.

## Path Parameters

| Parameter | Type          | Required | Description       |
| --------- | ------------- | -------- | ----------------- |
| `id`      | string (uuid) | Yes      | The invoice's id. |

No request body.

## Example Request

```bash theme={null}
curl -X POST "https://api.recurso.dev/v1/collections/invoices/06c151de-8d3a-4b21-9c77-2f0e5a9b4d12/retry-now" \
  -H "Authorization: Bearer $API_KEY"
```

## Response

```json theme={null}
{
  "data": {
    "status": "requeued"
  }
}
```

## Fields

| Field    | Type   | Description                                                                               |
| -------- | ------ | ----------------------------------------------------------------------------------------- |
| `status` | string | Always `requeued`. The invoice's `next_retry_at` is now and its `managed_by` is `worker`. |

## Errors

| Status | Code                | When                                                                                                                                                                 | Fix                                                                                                |
| ------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `400`  | `validation_failed` | `id` in the path is not a UUID                                                                                                                                       | Use the invoice's UUID                                                                             |
| `404`  | `not_found`         | Invoice doesn't exist, or belongs to another tenant (existence is never confirmed across tenants)                                                                    | Check the ID from the [collections queue](/api-reference/collections/queue)                        |
| `409`  | `conflict`          | The invoice is not `past_due`; dunning is paused on it; it is collected by a mandate auto-debit; or a payment attempt is already in flight. The message names which. | Resolve the stated condition — resume dunning, or wait for the in-flight attempt to settle or fail |

The `409` is also returned when the invoice's state changed between the check
and the requeue (for example it settled a moment earlier) — the response is
never a false success.

Errors use the standard envelope — see [Errors](/api-reference/errors).


## OpenAPI

````yaml POST /v1/collections/invoices/{id}/retry-now
openapi: 3.1.0
info:
  title: Recurso API
  version: 1.0.0
  description: |
    The Recurso billing engine REST API.

    Authenticate by passing your API key as a bearer token:

        Authorization: Bearer <api_key>

    Obtain an API key by registering a tenant via `POST /auth/register`.
    All authenticated endpoints live under the `/v1` prefix. Mutating
    endpoints support idempotency via the `Idempotency-Key` header.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://billing.example.com
    description: >-
      Example deployment — substitute the base URL of your own Recurso
      deployment.
security:
  - bearerAuth: []
tags:
  - name: System
    description: Health, version, and API metadata
  - name: Auth
    description: Tenant registration
  - name: Plans
    description: Product catalog plans
  - name: Customers
    description: Customer management
  - name: Subscriptions
    description: Subscription lifecycle
  - name: Invoices
    description: Invoices, PDFs, and Indian GST e-invoicing
  - name: Coupons
    description: Discounts
  - name: Usage
    description: Metered usage events
  - name: Credit Notes
    description: Customer credits
  - name: Quotes
    description: Quote-to-invoice lifecycle
  - name: Webhooks
    description: Webhook endpoint management and event feed
  - name: Analytics
    description: Revenue analytics
  - name: Checkout
    description: Public hosted checkout for invoices
  - name: Payments
    description: Payment order creation
  - name: Inbound Webhooks
    description: Receivers for payment-gateway callbacks (Razorpay, Stripe)
  - name: Customer Portal
    description: Customer-facing portal — magic-link auth and session-scoped data
  - name: Developer
    description: API key management
  - name: Account
    description: Tenant account settings
  - name: Finance
    description: Ledger accounts, entries, reconciliation, and revenue recognition
  - name: Settings
    description: Tax (GST) and e-invoicing (IRP) configuration
  - name: Consents
    description: Consent records for RBI-compliant recurring billing
  - name: Referrals
    description: Customer referral program
  - name: Gifts
    description: Gift subscriptions
  - name: Mandates
    description: UPI Autopay mandates
  - name: Offline Payments
    description: Virtual accounts and manually recorded payments
  - name: Organizations
    description: Multi-entity organizations grouping several tenants
  - name: Accounting
    description: QuickBooks / Xero accounting integrations
  - name: Churn
    description: Churn risk scoring and alerts
  - name: Cancel Flows
    description: Configurable retention flows shown at cancellation time
  - name: Dunning
    description: Dunning analytics and multi-channel dunning campaigns
paths:
  /v1/collections/invoices/{id}/retry-now:
    post:
      tags:
        - Collections
      summary: Retry a failing invoice now
      description: >
        Requeue a past-due invoice for an immediate smart-retry attempt. Refused
        (409) for a paused, mandate, or already-settling invoice; 404 if not
        found.
      operationId: collectionsRetryNow
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Requeued for retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      status:
                        type: string
                        const: requeued
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  responses:
    Unauthorized:
      description: Missing or invalid credentials (API key or session cookie).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        The request conflicts with current state (e.g. duplicate email, last
        owner).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          description: Structured error detail.
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
              examples:
                - validation_failed
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - rate_limited
                - internal_error
                - invalid_api_key
                - key_mode_mismatch
                - over_refund
                - invoice_not_paid
                - invoice_already_paid
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Tenant API key obtained from `POST /auth/register` or `POST
        /v1/developer/keys`.

````