API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console

Create invoice

POST/v1/invoices

Create a new invoice in the active tenant.

Modèle de données

Cette opération porte sur l'entité Invoice (invoice). Les 51 champs (type, validation, caractère obligatoire, relations) figurent dans la référence du schéma.

  • Champs obligatoires : partyId, status
  • Gérés par le serveur : _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. La plateforme attribue ces champs ; ils sont ignorés dans la requête.

Corps de la requête

NomTypeDescription
partyIdobligatoirestring
invoiceDatestring<date>
dueDatestring<date>
paymentTermsDaysinteger
defaultVatRatestring
sourcestring
salesOrderIdstring
introTextstring
closingTextstring
notestring
itemsobligatoireobject[]

Exemple

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": []
});

Codes de réponse

HTTP Signification
201 Default Response

Recherche