---
title: "Refresh one Stripe invoice snapshot"
method: POST
path: "/admin/billing/stripe/invoices/{invoice_id}/refresh"
tags: ["Billing"]
---

# Refresh one Stripe invoice snapshot

`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`

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.

## Path parameters

- `invoice_id` string, required

## Headers

- `x-api-key` string, required

## Response `200`

Previous and refreshed local invoice snapshots

- BillingStripeInvoiceRefreshResponseDoc
  - `code` integer
  - `data` BillingStripeInvoiceRefreshDoc
    - `current` BillingStripeInvoiceSnapshotDoc
      - `actual_one_time_cents` integer
      - `actual_overage_cents` integer
      - `actual_proration_cents` integer
      - `actual_subscription_cents` integer
      - `amount_due_cents` integer
      - `amount_paid_cents` integer
      - `amount_remaining_cents` integer
      - `charge_id` string
      - `created_at` string
      - `currency` string
      - `discount_cents` integer
      - `due_date` string
      - `effective_due_date` string
      - `expected_total_cents` integer
      - `finalized_at` string
      - `hosted_invoice_url` string
      - `invoice_payment_ids` string[]
      - `invoice_pdf` string
      - `last_event_created` string
      - `last_event_id` string
      - `line_items` BillingStripeInvoiceLineItemDoc[]
        - `amount_cents` integer
        - `category` string
        - `currency` string
        - `description` string
        - `line_id` string
        - `period_end` string
        - `period_start` string
        - `proration` boolean
        - `source_ref` string
        - `type` string
      - `matched_period_key` string
      - `matched_user_id` string
      - `mismatch_flags` string[]
      - `mismatch_total_cents` integer
      - `net_cash_cents` integer
      - `paid_at` string
      - `payment_intent_id` string
      - `period_end` string
      - `period_start` string
      - `plan` string
      - `post_payment_credit_note_cents` integer
      - `pre_payment_credit_note_cents` integer
      - `reconciliation_status` string
      - `refund_cents` integer
      - `repair_attempts` integer
      - `repair_error` string
      - `repair_last_attempt_at` string
      - `repair_last_success_at` string
      - `repair_status` string
      - `stripe_customer_id` string
      - `stripe_invoice_id` string
      - `stripe_invoice_number` string
      - `stripe_invoice_status` string
      - `subtotal_cents` integer
      - `subtotal_excluding_tax_cents` integer
      - `tax_cents` integer
      - `total_cents` integer
      - `total_excluding_tax_cents` integer
      - `updated_at` string
    - `ledger_updated` boolean
    - `previous` BillingStripeInvoiceSnapshotDoc
      - `actual_one_time_cents` integer
      - `actual_overage_cents` integer
      - `actual_proration_cents` integer
      - `actual_subscription_cents` integer
      - `amount_due_cents` integer
      - `amount_paid_cents` integer
      - `amount_remaining_cents` integer
      - `charge_id` string
      - `created_at` string
      - `currency` string
      - `discount_cents` integer
      - `due_date` string
      - `effective_due_date` string
      - `expected_total_cents` integer
      - `finalized_at` string
      - `hosted_invoice_url` string
      - `invoice_payment_ids` string[]
      - `invoice_pdf` string
      - `last_event_created` string
      - `last_event_id` string
      - `line_items` BillingStripeInvoiceLineItemDoc[]
        - `amount_cents` integer
        - `category` string
        - `currency` string
        - `description` string
        - `line_id` string
        - `period_end` string
        - `period_start` string
        - `proration` boolean
        - `source_ref` string
        - `type` string
      - `matched_period_key` string
      - `matched_user_id` string
      - `mismatch_flags` string[]
      - `mismatch_total_cents` integer
      - `net_cash_cents` integer
      - `paid_at` string
      - `payment_intent_id` string
      - `period_end` string
      - `period_start` string
      - `plan` string
      - `post_payment_credit_note_cents` integer
      - `pre_payment_credit_note_cents` integer
      - `reconciliation_status` string
      - `refund_cents` integer
      - `repair_attempts` integer
      - `repair_error` string
      - `repair_last_attempt_at` string
      - `repair_last_success_at` string
      - `repair_status` string
      - `stripe_customer_id` string
      - `stripe_invoice_id` string
      - `stripe_invoice_number` string
      - `stripe_invoice_status` string
      - `subtotal_cents` integer
      - `subtotal_excluding_tax_cents` integer
      - `tax_cents` integer
      - `total_cents` integer
      - `total_excluding_tax_cents` integer
      - `updated_at` string
    - `refreshed_at` string
    - `stripe_invoice_id` string
  - `msg` string

## Other responses

- `400`: Invoice identity or ownership validation failed
- `401`: Authentication required
- `403`: Admin plan required
- `404`: Local Stripe invoice snapshot not found
- `500`: Stripe read or local update failed

---

[API](https://skmtc.dev/crawlora/apis/crawlora-api.md) · [All operations](https://skmtc.dev/crawlora/apis/crawlora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crawlora/apis/crawlora-api/revisions/028417aa35bb?raw)
