---
title: "Relink one user's invoices to the periods they prepay"
method: POST
path: "/admin/billing/stripe/relink-invoices"
tags: ["Billing"]
---

# Relink one user's invoices to the periods they prepay

`POST /admin/billing/stripe/relink-invoices`

## Request

- Base URL: `https://api.crawlora.net/api/v1`
- URL: `https://api.crawlora.net/api/v1/admin/billing/stripe/relink-invoices`
- Auth: API key in header `x-api-key`

Plans, and optionally applies, moving one user's closed billing periods onto the prepaid invoice model: each period links to the invoice whose subscription line starts at the period start. Never calls or changes Stripe. dry_run defaults to true; freeze_statements creates new statement revisions for changed periods.

## Headers

- `x-api-key` string, required

## Request body

- object

## Response `200`

OK

- AppResponse: The Response struct is used for wrapping the API response with a code, message, and data.
  - `code` integer: Code is the HTTP status code or a custom code used to indicate the result of the request @example 200
  - `data` unknown
  - `msg` unknown

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal Server Error

---

[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)
