Billing

Refresh one Stripe invoice snapshot

Admin-only endpoint that reads one exact invoice from Stripe and refreshes its existing local snapshot after verifying invoice id and customer ownership. Livemode must match, except that a snapshot stored as test mode is corrected when Stripe returns the invoice as live; a live snapshot is never changed to test mode. This endpoint does not modify Stripe, issue refunds, change plans, or scan other invoices.

post/admin/billing/stripe/invoices/{invoice_id}/refresh

Request

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

Path parameters

invoice_idstring required

Existing Stripe invoice id

Headers

x-api-keystring required

Admin API key required unless an Admin JWT is already present

Response

Previous and refreshed local invoice snapshots

codeinteger
msgstring

Example response

{
  "code": 200,
  "data": {
    "current": {
      "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"
    },
    "previous": {
      "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"
    },
    "refreshed_at": "2026-08-28T10:00:00Z",
    "stripe_invoice_id": "in_123"
  },
  "msg": "OK"
}

Changes

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