API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console

Create invoice

POST/v1/invoices

Create a new invoice in the active tenant.

Data model

This operation works on the entity Invoice (invoice). All 51 fields — type, validation, required status, relationships — are listed in the schema reference.

  • Required fields: partyId, status
  • Server-managed: _id, schema, schemaVersion, tenantId, version, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy, invoiceNumber, lockedAt, lockedBy, contentHash, recordAddressSnapshot, deliveryAddressSnapshot, weclappId, weclappBaseUrl, externalVersion, syncedAt, customerPaymentReportedAt, customerPaymentReportedBy, customerPaymentReference, projectId — the platform assigns these fields; they are discarded in the request.

Request body

NameTypeDescription
partyIdrequiredstring
invoiceDatestring<date>
dueDatestring<date>
paymentTermsDaysinteger
defaultVatRatestring
sourcestring
salesOrderIdstring
introTextstring
closingTextstring
notestring
itemsrequiredobject[]

Example

curl -X POST https://api.codemeta-os.de/v1/invoices \
  -H "X-Tenant-Id: $TENANT" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
  "partyId": "string",
  "invoiceDate": "string",
  "dueDate": "string",
  "paymentTermsDays": 0,
  "defaultVatRate": "string",
  "source": "MANUAL",
  "salesOrderId": "string",
  "introText": "string",
  "closingText": "string",
  "note": "string",
  "items": []
}'
const result = await cm.invoices.post({
  "partyId": "string",
  "invoiceDate": "string",
  "dueDate": "string",
  "paymentTermsDays": 0,
  "defaultVatRate": "string",
  "source": "MANUAL",
  "salesOrderId": "string",
  "introText": "string",
  "closingText": "string",
  "note": "string",
  "items": []
});

Response codes

HTTP Meaning
201 Default Response

Search