---
agentTools:
  projectIndex: https://docs.calqulate.io/llms.txt
---

# Update an Invoice

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Calqulate API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.calqulate.io/v3"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/invoices/{id}": {
      "patch": {
        "summary": "Update an Invoice",
        "description": "",
        "operationId": "update-an-invoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Invoice Id",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "invoice"
                ],
                "properties": {
                  "invoice": {
                    "type": "object",
                    "properties": {
                      "metaId": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "externalCode": {
                        "type": "string"
                      },
                      "creationDate": {
                        "type": "string",
                        "format": "date"
                      },
                      "billingReason": {
                        "type": "string"
                      },
                      "dueDate": {
                        "type": "string",
                        "format": "date"
                      },
                      "discountType": {
                        "type": "string",
                        "enum": [
                          "amount",
                          "percentage"
                        ]
                      },
                      "discount": {
                        "type": "number",
                        "format": "double"
                      },
                      "total": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "metaCurrencyId": {
                        "type": "string"
                      },
                      "customerId": {
                        "type": "string"
                      },
                      "metaCustomerId": {
                        "type": "string"
                      },
                      "subscriptionId": {
                        "type": "string"
                      },
                      "metaSubscriptionId": {
                        "type": "string"
                      },
                      "credit": {
                        "type": "boolean"
                      },
                      "creditedInvoiceId": {
                        "type": "string"
                      },
                      "metaCreditedInvoiceId": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"data\": {\n    \"id\":\"\",\n    \"metaId\":\"\",\n    \"code\":\"\",\n    \"externalCode\": \"\",\n    \"creationDate\":\"date\",\n    \"dueDate\":\"date\",\n    \"customerId\":\"\",\n    \"metaCustomerId\":\"\",\n    \"subscriptionId\":\"\",\n    \"metaSubscriptionId\":\"\",\n    \"currencyId\":\"\",\n    \"metaCurrencyId\":\"\",\n    \"credit\":false,\n    \"creditedInvoiceId\":\"\",\n    \"metaCreditedInvoiceId\":\"\",\n    \"discount\":0,\n    \"discountType\":\"\",\n    \"total\":\"\",\n    \"billingReason\":\"\",\n    \"url\":\"\",\n    \"dataSourceId\":\"\",\n    \"updatedAt\":\"date\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": ""
                        },
                        "metaId": {
                          "type": "string",
                          "example": ""
                        },
                        "code": {
                          "type": "string",
                          "example": ""
                        },
                        "externalCode": {
                          "type": "string",
                          "example": ""
                        },
                        "creationDate": {
                          "type": "string",
                          "example": "date"
                        },
                        "dueDate": {
                          "type": "string",
                          "example": "date"
                        },
                        "customerId": {
                          "type": "string",
                          "example": ""
                        },
                        "metaCustomerId": {
                          "type": "string",
                          "example": ""
                        },
                        "subscriptionId": {
                          "type": "string",
                          "example": ""
                        },
                        "metaSubscriptionId": {
                          "type": "string",
                          "example": ""
                        },
                        "currencyId": {
                          "type": "string",
                          "example": ""
                        },
                        "metaCurrencyId": {
                          "type": "string",
                          "example": ""
                        },
                        "credit": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "creditedInvoiceId": {
                          "type": "string",
                          "example": ""
                        },
                        "metaCreditedInvoiceId": {
                          "type": "string",
                          "example": ""
                        },
                        "discount": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "discountType": {
                          "type": "string",
                          "example": ""
                        },
                        "total": {
                          "type": "string",
                          "example": ""
                        },
                        "billingReason": {
                          "type": "string",
                          "example": ""
                        },
                        "url": {
                          "type": "string",
                          "example": ""
                        },
                        "dataSourceId": {
                          "type": "string",
                          "example": ""
                        },
                        "updatedAt": {
                          "type": "string",
                          "example": "date"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6202883ef5f761000f767440:6204e8c38b39a7004428325b"
}
```