---
updatedAt: 2026-04-20T21:41:08.000Z
agentTools:
  projectIndex: https://puzzle-api.readme.io/llms.txt
---

# Create Invoice

Creates an invoice for the company.

Required scope: write:invoice

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Puzzle Api",
    "description": "Puzzle Api",
    "version": "0"
  },
  "servers": [
    {
      "url": "https://api.puzzle.io/rest/v0"
    }
  ],
  "paths": {
    "/company/{id}/invoices": {
      "post": {
        "operationId": "createInvoiceApi",
        "summary": "Create Invoice",
        "description": "Creates an invoice for the company.\n\nRequired scope: write:invoice",
        "tags": [
          "Invoices"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The company ID",
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Partner-facing external identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Partner-facing external identifier"
                  },
                  "nativeId": {
                    "type": "string"
                  },
                  "customerId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Partner-facing external identifier"
                  },
                  "description": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "Deleted",
                      "Draft",
                      "Posted",
                      "Voided",
                      "Paid"
                    ]
                  },
                  "issueDate": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Calendar date, YYYY-MM-DD"
                  },
                  "dueDate": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Calendar date, YYYY-MM-DD"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Partner-facing external identifier"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Arbitrary-precision decimal, serialized as a string"
                        },
                        "coaKey": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Chart-of-accounts key"
                        },
                        "quantity": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Arbitrary-precision decimal, serialized as a string"
                        },
                        "unitPrice": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Arbitrary-precision decimal, serialized as a string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "classifications": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "class": {
                                "type": "string",
                                "minLength": 1
                              },
                              "segment": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "class",
                              "segment"
                            ]
                          }
                        },
                        "productId": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Partner-facing external identifier"
                        },
                        "productName": {
                          "type": "string"
                        },
                        "schedule": {
                          "type": "object",
                          "properties": {
                            "dateRange": {
                              "type": "object",
                              "properties": {
                                "fromInclusive": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Calendar date, YYYY-MM-DD"
                                },
                                "toInclusive": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Calendar date, YYYY-MM-DD"
                                }
                              },
                              "required": [
                                "fromInclusive",
                                "toInclusive"
                              ]
                            },
                            "postingMethod": {
                              "type": "string",
                              "enum": [
                                "automatically",
                                "userConfirm"
                              ]
                            }
                          },
                          "required": [
                            "dateRange"
                          ]
                        },
                        "revRecOptions": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "accountingConfigurationId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "description": "Partner-facing external identifier"
                                }
                              },
                              "required": [
                                "accountingConfigurationId"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "accountingOptions": {
                                  "type": "object",
                                  "properties": {
                                    "timing": {
                                      "type": "string",
                                      "enum": [
                                        "OverTime",
                                        "PointInTime"
                                      ]
                                    },
                                    "calculation": {
                                      "type": "string",
                                      "enum": [
                                        "Days360",
                                        "DaysActual",
                                        "Manual",
                                        "PercentageBased",
                                        "StraightLineByPeriod",
                                        "StraightLineDaily",
                                        "StraightLineMonthly"
                                      ]
                                    },
                                    "category": {
                                      "type": "string",
                                      "minLength": 1,
                                      "description": "Chart-of-accounts key"
                                    },
                                    "firstPeriodAllocation": {
                                      "type": "string",
                                      "enum": [
                                        "DayBased",
                                        "FullMonth",
                                        "HalfMonth",
                                        "Mid",
                                        "Zero"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "timing"
                                  ]
                                }
                              },
                              "required": [
                                "accountingOptions"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "amount",
                        "coaKey"
                      ]
                    }
                  },
                  "document": {
                    "type": "object",
                    "properties": {
                      "documentType": {
                        "type": "string",
                        "enum": [
                          "Receipt",
                          "Bill",
                          "Invoice"
                        ]
                      },
                      "fileName": {
                        "type": "string",
                        "minLength": 1
                      },
                      "contentType": {
                        "type": "string",
                        "minLength": 1
                      },
                      "base64File": {
                        "type": "string",
                        "minLength": 1
                      },
                      "nativeDocumentId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "documentType",
                      "fileName",
                      "contentType",
                      "base64File",
                      "nativeDocumentId"
                    ]
                  }
                },
                "required": [
                  "customerId",
                  "issueDate",
                  "lines"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Partner-facing external identifier"
                    },
                    "customerId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Partner-facing external identifier",
                      "nullable": true
                    },
                    "issueDate": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Calendar date, YYYY-MM-DD",
                      "nullable": true
                    },
                    "dueDate": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Calendar date, YYYY-MM-DD",
                      "nullable": true
                    },
                    "nativeId": {
                      "type": "string",
                      "nullable": true
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "amount": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "description": "Arbitrary-precision decimal, serialized as a string"
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 3,
                          "maxLength": 3,
                          "description": "ISO 4217 currency code"
                        }
                      },
                      "required": [
                        "amount",
                        "currency"
                      ],
                      "description": "A monetary amount with its currency"
                    },
                    "documents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "file": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "filename": {
                                "type": "string",
                                "nullable": true
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "size": {
                                "type": "integer"
                              },
                              "isDeleted": {
                                "type": "boolean"
                              },
                              "downloadInfo": {
                                "type": "object",
                                "properties": {
                                  "signedUrl": {
                                    "type": "string"
                                  },
                                  "urlExpiresAt": {
                                    "type": "string",
                                    "minLength": 1,
                                    "description": "ISO 8601 timestamp"
                                  }
                                },
                                "required": [
                                  "signedUrl",
                                  "urlExpiresAt"
                                ]
                              },
                              "parseError": {
                                "type": "string",
                                "nullable": true
                              },
                              "parseType": {
                                "type": "string",
                                "enum": [
                                  "bill",
                                  "invoice",
                                  "receipt",
                                  "bankStatement",
                                  "unknown"
                                ],
                                "nullable": true
                              }
                            },
                            "required": [
                              "id",
                              "filename",
                              "contentType",
                              "size",
                              "isDeleted",
                              "downloadInfo",
                              "parseError",
                              "parseType"
                            ]
                          },
                          "uploadActorType": {
                            "type": "string",
                            "enum": [
                              "SYSTEM_ACTOR",
                              "TRAIN_ACTOR",
                              "USER_ACTOR",
                              "USER_ACTOR_VIA_AI",
                              "ADMIN_ACTOR",
                              "AI_ACTOR"
                            ]
                          }
                        },
                        "required": [
                          "file",
                          "uploadActorType"
                        ]
                      }
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Partner-facing external identifier"
                          },
                          "classifications": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "class": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string",
                                  "nullable": true
                                },
                                "segments": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "description": "Partner-facing external identifier",
                                        "nullable": true
                                      },
                                      "segment": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string",
                                        "nullable": true
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "segment",
                                      "description"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "class",
                                "description",
                                "segments"
                              ]
                            }
                          },
                          "amount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Arbitrary-precision decimal, serialized as a string"
                              },
                              "currency": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 3,
                                "description": "ISO 4217 currency code"
                              }
                            },
                            "required": [
                              "amount",
                              "currency"
                            ],
                            "description": "A monetary amount with its currency"
                          },
                          "coaKey": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Chart-of-accounts key"
                          },
                          "quantity": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Arbitrary-precision decimal, serialized as a string",
                            "nullable": true
                          },
                          "unitPrice": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Arbitrary-precision decimal, serialized as a string",
                            "nullable": true
                          },
                          "productId": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Partner-facing external identifier",
                            "nullable": true
                          },
                          "description": {
                            "type": "string",
                            "nullable": true
                          },
                          "createdAt": {
                            "type": "string",
                            "minLength": 1,
                            "description": "ISO 8601 timestamp"
                          },
                          "updatedAt": {
                            "type": "string",
                            "minLength": 1,
                            "description": "ISO 8601 timestamp"
                          },
                          "removedAt": {
                            "type": "string",
                            "minLength": 1,
                            "description": "ISO 8601 timestamp",
                            "nullable": true
                          }
                        },
                        "required": [
                          "id",
                          "classifications",
                          "amount",
                          "coaKey",
                          "quantity",
                          "unitPrice",
                          "description",
                          "createdAt",
                          "updatedAt",
                          "removedAt"
                        ]
                      }
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Deleted",
                        "Draft",
                        "Posted",
                        "Voided",
                        "Paid"
                      ]
                    },
                    "contractId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Partner-facing external identifier",
                      "nullable": true
                    },
                    "createdAt": {
                      "type": "string",
                      "minLength": 1,
                      "description": "ISO 8601 timestamp"
                    },
                    "updatedAt": {
                      "type": "string",
                      "minLength": 1,
                      "description": "ISO 8601 timestamp"
                    },
                    "removedAt": {
                      "type": "string",
                      "minLength": 1,
                      "description": "ISO 8601 timestamp",
                      "nullable": true
                    }
                  },
                  "required": [
                    "id",
                    "issueDate",
                    "dueDate",
                    "nativeId",
                    "description",
                    "amount",
                    "documents",
                    "lines",
                    "status",
                    "createdAt",
                    "updatedAt",
                    "removedAt"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
```