---
title: "Backfill Costs"
method: POST
path: "/v1/shops/{shopId}/invoices/backfill-cost"
tags: ["Invoices"]
---

# Backfill Costs

`POST /v1/shops/{shopId}/invoices/backfill-cost`

## Request

- Base URL: `https://api.sellauth.com`
- URL: `https://api.sellauth.com/v1/shops/{shopId}/invoices/backfill-cost`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sellauth/apis/sellauth-api/docs/v1/shops/:shopId/invoices/backfill-cost/post.ts> (a function with typed inputs; its response is checked against the schema)

Queues a job that stamps the current variant cost onto historical invoice items in a date window that have no cost snapshot yet. Limited to one run per hour per shop.

## Request body

- object
  - `start` string, required: Start of the completion date window. Must be a valid date.
  - `end` string, required: End of the completion date window. Must be a valid date. Must be a date after or equal to <code>start</code>.

## Response `200`

---

[API](https://skmtc.dev/sellauth/apis/sellauth-api.md) - [All operations](https://skmtc.dev/sellauth/apis/sellauth-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sellauth/apis/sellauth-api/revisions/156a9aef5e98?raw)
