Billing

Get one Stripe invoice snapshot

Returns one Stripe invoice by invoice_id (admin only): a snapshot of the invoice, the matched billing ledger summary when the invoice is tied to a billing period, and recent invoice_events and adjustment_events audit records with repair state such as repair_status and repair_attempts.

get/admin/billing/stripe/invoices/{invoice_id}

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/admin/billing/stripe/invoices/{invoice_id}
  • Auth: API key in header x-api-key

Path parameters

invoice_idstring required

Stripe invoice id

Headers

x-api-keystring required

Admin API key required unless an Admin JWT is already present

Response

Stripe invoice snapshot detail

codeinteger
msgstring

Example response

{
  "code": 200,
  "data": {
    "adjustment_events": [
      {
        "amount_cents": 500,
        "charge_id": "ch_123",
        "currency": "usd",
        "event_created": "2026-05-02T01:01:00Z",
        "event_id": "evt_123",
        "event_type": "credit_note.created",
        "kind": "credit_note",
        "match_status": "matched",
        "matched_period_key": "2026-04",
        "matched_stripe_invoice_id": "in_123",
        "matched_user_id": "user-1",
        "payment_intent_id": "pi_123",
        "pre_payment_credit_note_cents": 500,
        "processed_at": "2026-05-02T01:01:02Z",
        "reconciliation_status": "matched",
        "repair_attempts": 1,
        "repair_last_attempt_at": "2026-05-02T02:00:00Z",
        "repair_source": "webhook_auto",
        "repair_status": "pending",
        "resource_id": "cn_123",
        "resource_status": "issued",
        "stripe_customer_id": "cus_123",
        "stripe_invoice_id": "in_123"
      }
    ],
    "invoice_events": [
      {
        "amount_due": 19900,
        "amount_paid": 19900,
        "charge_id": "ch_123",
        "currency": "usd",
        "due_date": "2026-05-08T00:00:00Z",
        "event_created": "2026-05-01T01:01:00Z",
        "event_id": "evt_123",
        "event_type": "invoice.paid",
        "hosted_invoice_url": "https://invoice.stripe.com/i/acct_...",
        "invoice_pdf": "https://pay.stripe.com/invoice/.../pdf",
        "line_items": [
          {
            "amount_cents": 7900,
            "category": "subscription",
            "currency": "usd",
            "description": "Pro plan",
            "line_id": "il_123",
            "period_end": "2026-05-01T00:00:00Z",
            "period_start": "2026-04-01T00:00:00Z",
            "source_ref": "sub_123",
            "type": "subscription"
          }
        ],
        "match_status": "matched",
        "matched_period_key": "2026-04",
        "matched_user_id": "user-1",
        "payment_intent_id": "pi_123",
        "period_end": "2026-05-01T00:00:00Z",
        "period_start": "2026-04-01T00:00:00Z",
        "processed_at": "2026-05-01T01:01:02Z",
        "reconciliation_status": "paid",
        "repair_attempts": 1,
        "repair_last_attempt_at": "2026-05-01T02:00:00Z",
        "repair_source": "admin_manual",
        "repair_status": "pending",
        "stripe_customer_id": "cus_123",
        "stripe_invoice_id": "in_123",
        "stripe_invoice_number": "C8F8C2D-0001",
        "stripe_invoice_status": "paid",
        "subtotal_cents": 19900,
        "subtotal_excluding_tax_cents": 19900,
        "total_cents": 19900,
        "total_excluding_tax_cents": 19900
      }
    ],
    "ledger": {
      "charged_requests": 1150,
      "closed_at": "2026-05-01T00:15:00Z",
      "credits_used": 3450,
      "currency": "usd",
      "endpoint_breakdown": [
        {
          "charged_requests": 1150,
          "credits": 3450,
          "endpoint": "google/search",
          "failed_requests": 5,
          "non_billable_requests": 45,
          "requests": 1200
        }
      ],
      "expected_subscription_amount_cents": 7900,
      "expected_total_amount_cents": 7900,
      "failed_requests": 5,
      "generated_at": "2026-04-16T10:00:00Z",
      "included_credits": 400000,
      "non_billable_requests": 45,
      "overage_price_per_1000": 0.3,
      "period_end": "2026-05-01T00:00:00Z",
      "period_key": "2026-04",
      "period_start": "2026-04-01T00:00:00Z",
      "plan": "Pro",
      "pricing_source": "plan_default",
      "status": "open",
      "stripe_actual_amount_due_cents": 11100,
      "stripe_actual_amount_paid_cents": 11100,
      "stripe_actual_net_cash_cents": 11100,
      "stripe_actual_overage_cents": 3200,
      "stripe_actual_subscription_cents": 7900,
      "stripe_actual_total_cents": 11100,
      "stripe_customer_id": "cus_123",
      "stripe_invoice_amount_due": 19900,
      "stripe_invoice_amount_paid": 19900,
      "stripe_invoice_currency": "usd",
      "stripe_invoice_due_date": "2026-05-08T00:00:00Z",
      "stripe_invoice_effective_due_date": "2026-05-08T00:00:00Z",
      "stripe_invoice_finalized_at": "2026-05-01T01:00:00Z",
      "stripe_invoice_hosted_url": "https://invoice.stripe.com/i/acct_...",
      "stripe_invoice_id": "in_123",
      "stripe_invoice_last_event_created": "2026-05-01T01:01:00Z",
      "stripe_invoice_last_event_id": "evt_123",
      "stripe_invoice_number": "C8F8C2D-0001",
      "stripe_invoice_paid_at": "2026-05-01T01:01:00Z",
      "stripe_invoice_payment_failed_at": "2026-05-01T01:01:00Z",
      "stripe_invoice_pdf": "https://pay.stripe.com/invoice/.../pdf",
      "stripe_invoice_period_end": "2026-05-01T00:00:00Z",
      "stripe_invoice_period_start": "2026-04-01T00:00:00Z",
      "stripe_invoice_reconciliation_status": "paid",
      "stripe_invoice_status": "paid",
      "stripe_meter_event_identifier": "crawlora:user-1:2026-04:overage:v1",
      "stripe_meter_event_name": "crawlora_overage_credits",
      "stripe_snapshot_updated_at": "2026-05-01T01:01:00Z",
      "stripe_sync_attempts": 1,
      "stripe_sync_first_attempt_at": "2026-05-01T00:30:00Z",
      "stripe_sync_last_attempt_at": "2026-05-01T00:30:00Z",
      "stripe_sync_status": "synced",
      "stripe_synced_at": "2026-05-01T00:30:01Z",
      "subscription_price_cents": 7900,
      "updated_at": "2026-04-16T10:00:00Z",
      "user_id": "user-1"
    },
    "snapshot": {
      "actual_overage_cents": 3200,
      "actual_subscription_cents": 7900,
      "amount_due_cents": 11100,
      "amount_paid_cents": 11100,
      "charge_id": "ch_123",
      "created_at": "2026-05-01T00:59:00Z",
      "currency": "usd",
      "due_date": "2026-05-08T00:00:00Z",
      "effective_due_date": "2026-05-08T00:00:00Z",
      "expected_total_cents": 11100,
      "finalized_at": "2026-05-01T01:00:00Z",
      "hosted_invoice_url": "https://invoice.stripe.com/i/acct_...",
      "invoice_pdf": "https://pay.stripe.com/invoice/.../pdf",
      "last_event_created": "2026-05-01T01:01:00Z",
      "last_event_id": "evt_123",
      "line_items": [
        {
          "amount_cents": 7900,
          "category": "subscription",
          "currency": "usd",
          "description": "Pro plan",
          "line_id": "il_123",
          "period_end": "2026-05-01T00:00:00Z",
          "period_start": "2026-04-01T00:00:00Z",
          "source_ref": "sub_123",
          "type": "subscription"
        }
      ],
      "matched_period_key": "2026-04",
      "matched_user_id": "user-1",
      "net_cash_cents": 11100,
      "paid_at": "2026-05-01T01:01:00Z",
      "payment_intent_id": "pi_123",
      "period_end": "2026-05-01T00:00:00Z",
      "period_start": "2026-04-01T00:00:00Z",
      "plan": "Pro",
      "reconciliation_status": "paid",
      "repair_attempts": 1,
      "repair_last_attempt_at": "2026-05-01T02:00:00Z",
      "repair_last_success_at": "2026-05-01T02:01:00Z",
      "repair_status": "pending",
      "stripe_customer_id": "cus_123",
      "stripe_invoice_id": "in_123",
      "stripe_invoice_number": "C8F8C2D-0001",
      "stripe_invoice_status": "paid",
      "subtotal_cents": 11100,
      "subtotal_excluding_tax_cents": 11100,
      "total_cents": 11100,
      "total_excluding_tax_cents": 11100,
      "updated_at": "2026-05-01T01:01:00Z"
    }
  },
  "msg": "OK"
}

Changes

No recorded changes to this operation across all 3 revisions of this API.