cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/invoices/{id}/recalculate \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.invoices.recalculate_invoice(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.invoices.recalculateInvoice("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Invoices.RecalculateInvoice(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ModelsTemporalWorkflowResult != nil {
// handle response
}
}{
"message": "<string>",
"run_id": "<string>",
"workflow_id": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Invoices
Recalculate invoice (voided invoice)
Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.
POST
/
invoices
/
{id}
/
recalculate
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/invoices/{id}/recalculate \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.invoices.recalculate_invoice(id="<id>")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.invoices.recalculateInvoice("<id>");
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Invoices.RecalculateInvoice(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.ModelsTemporalWorkflowResult != nil {
// handle response
}
}{
"message": "<string>",
"run_id": "<string>",
"workflow_id": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}
