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

# Get Payment Attempt

> One payment attempt as an addressable object, resolved with the invoice, currency, customer, and subscription it belongs to.

Fetches one payment attempt as an addressable object, resolved with the
invoice-level context it belongs to: invoice number, currency, customer, and
— for recurring invoices — the subscription. `customer_id` and
`subscription_id` are read-time joins off the attempt's invoice, not stored on
the attempt itself.

## Example Request

```bash theme={null}
curl "https://api.recurso.dev/v1/payment-attempts/c2d4e6f8-1a3b-4c5d-9e7f-8a9b0c1d2e3f" \
  -H "Authorization: Bearer $API_KEY"
```

## Response

```json theme={null}
{
  "data": {
    "id": "c2d4e6f8-1a3b-4c5d-9e7f-8a9b0c1d2e3f",
    "invoice_id": "06c151de-8d3a-4b21-9c77-2f0e5a9b4d12",
    "invoice_number": "REC/2026/0042",
    "currency": "USD",
    "customer_id": "0b7a3f7e-4a2b-4c1d-9e8f-1a2b3c4d5e6f",
    "subscription_id": "b9071c55-0e14-4720-80f3-665613ceb7de",
    "gateway": "stripe",
    "method": "card",
    "gateway_payment_intent_id": "pi_3PqR7sK2eZvKYlo2C0Xy1AbC",
    "status": "succeeded",
    "failure_code": "",
    "amount": 118000,
    "created_at": "2026-07-03T14:22:00Z",
    "updated_at": "2026-07-03T14:22:10Z",
    "settled_at": "2026-07-03T14:22:10Z"
  }
}
```

## Fields

| Field                           | Type                         | Description                                                                             |
| ------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------- |
| `id`                            | string (uuid)                | The attempt's id                                                                        |
| `invoice_id` / `invoice_number` | uuid / string                | The invoice the attempt tried to settle                                                 |
| `currency`                      | string                       | The invoice's currency                                                                  |
| `customer_id`                   | string (uuid)                | The invoice's customer (read-time join)                                                 |
| `subscription_id`               | string (uuid), nullable      | The invoice's subscription for recurring invoices; `null` for one-offs (read-time join) |
| `gateway`                       | string                       | The gateway that processed the attempt                                                  |
| `method`                        | string                       | The payment method used                                                                 |
| `gateway_payment_intent_id`     | string                       | The gateway's reference for the attempt                                                 |
| `status`                        | string                       | `initiated`, `processing`, `succeeded`, `failed`, or `returned`                         |
| `failure_code`                  | string                       | Gateway failure or return code; empty when the attempt succeeded                        |
| `amount`                        | integer (int64)              | Minor units                                                                             |
| `created_at` / `updated_at`     | string (date-time)           | When the attempt was made and last changed status                                       |
| `settled_at`                    | string (date-time), nullable | When funds settled; `null` until then                                                   |

<Note>
  Read-only. A missing or cross-tenant `id` returns `404`. For the full retry
  history of one invoice, use
  [Invoice Payment Attempts](/api-reference/invoices/payment-attempts); for the
  tenant-wide log, [List Payment Attempts](/api-reference/payment-attempts/list).
</Note>


## OpenAPI

````yaml GET /v1/payment-attempts/{id}
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/payment-attempts/{id}:
    get:
      tags:
        - Payments
      summary: Get a payment attempt by id
      description: >
        One payment attempt as an addressable object, resolved with the
        invoice-level context it belongs to (invoice number, currency, customer,
        and subscription for recurring invoices). customer_id/subscription_id
        are read-time joins off the attempt's invoice. Read-only; cross-tenant
        ids return 404.
      operationId: getPaymentAttempt
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The payment attempt.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      invoice_id:
                        type: string
                        format: uuid
                      invoice_number:
                        type: string
                      currency:
                        type: string
                      customer_id:
                        type: string
                        format: uuid
                      subscription_id:
                        type: string
                        format: uuid
                        nullable: true
                      gateway:
                        type: string
                      method:
                        type: string
                      gateway_payment_intent_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - initiated
                          - processing
                          - succeeded
                          - failed
                          - returned
                      failure_code:
                        type: string
                      amount:
                        type: integer
                        format: int64
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
                      settled_at:
                        type: string
                        format: date-time
                        nullable: true
        '404':
          description: Payment not found.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Tenant API key obtained from `POST /auth/register` or `POST
        /v1/developer/keys`.

````