---
updatedAt: 2026-06-30T16:05:21.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/llms.txt
---

# Finalize bill

Finalize a draft bill to lock it for payment.

## Overview

Finalize a draft bill to lock it for payment. Only draft bills can be finalized — finalized and paid bills return 400.

## Side effects

* Bill status changes from Draft to Open
* `finalized_at` timestamp is set
* Bill can no longer be edited or deleted

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "core-api",
    "version": "1.88"
  },
  "servers": [
    {
      "url": "https://www.pelcro.com/api/v1/core"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      },
      "sec1": {
        "type": "apiKey",
        "in": "query",
        "name": "site_id"
      }
    }
  },
  "security": [
    {
      "sec0": [],
      "sec1": []
    }
  ],
  "paths": {
    "/bills/{id}/finalize": {
      "post": {
        "summary": "Finalize bill",
        "description": "Finalize a draft bill to lock it for payment.",
        "operationId": "get_invoices-1-1-1",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The bill ID."
          },
          {
            "name": "site_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The unique identifier of the site associated with your account."
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer eyJ***"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "message": "Bill finalized successfully",
                      "data": {
                        "id": 42,
                        "bill_number": "BILL-00042",
                        "number": "BILL-00042",
                        "status": "Open",
                        "user_id": 1001,
                        "user": {
                          "id": 1001,
                          "first_name": "Acme",
                          "last_name": "Corp",
                          "email": "billing@acme.com"
                        },
                        "amount_due": 15000,
                        "amount_paid": 0,
                        "amount_remaining": 15000,
                        "currency": "usd",
                        "paid": false,
                        "metadata": {},
                        "subtotal": 15000,
                        "total": 15000,
                        "footer": null,
                        "purchase_order": null,
                        "description": null,
                        "period_start": "2026-04-01",
                        "period_end": "2026-04-30",
                        "line_items": [
                          {
                            "id": 1,
                            "description": "Consulting services",
                            "quantity": 10,
                            "unit_price": 100,
                            "total": 1000,
                            "currency": "usd"
                          },
                          {
                            "id": 2,
                            "description": "Software license",
                            "quantity": 1,
                            "unit_price": 5000,
                            "total": 5000,
                            "currency": "usd"
                          }
                        ],
                        "finalized_at": 1712275200,
                        "paid_at": null,
                        "created_at": 1712188800,
                        "updated_at": 1712188800
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": {
                        "status": 400,
                        "message": "Invalid request, please try again."
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "message": {
                          "type": "string",
                          "example": "Invalid request, please try again."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": "Unauthenticated."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "error": {
                        "status": 404,
                        "message": "Not found."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "php",
              "code": "use GuzzleHttp\\Client;\n\n$site_id = 0; // (int) your site id here\n$page = 1; // (int) the page number  here\n  \n$api_key = '' // (string) your api key here\n$uri = \"bills\";\n\n$config = [\n  'base_uri' => 'https://www.pelcro.com/api/v1/core/'\n];\n\n$client = new Client($config);\n\n$options = [\n\t'json' => [\n\t\t'site_id' => $site_id,\n\t\t'page' => $page,\n\t],\n\t'headers' => [\n\t\t'Accept' => 'application/json',\n\t\t'Authorization' => 'Bearer ' . $api_key\n\t]\n];\n\n$response = $client->request('GET', $uri, $options);"
            }
          ],
          "samples-languages": [
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```

# Sibling pages

* [List bills](https://docs.pelcro.com/reference/list-bills.md)
* [Create bill](https://docs.pelcro.com/reference/create-bills.md)
* [Get bill](https://docs.pelcro.com/reference/get-bill.md)
* [Update bill](https://docs.pelcro.com/reference/update-bill.md)
* [Delete bill](https://docs.pelcro.com/reference/api-core-delete-bill.md)
* [Mark bill as paid](https://docs.pelcro.com/reference/api-core-mark-bill-as-paid.md)
* [Export bills](https://docs.pelcro.com/reference/api-core-export-bills.md)