API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console

Create partie

POST/v1/parties

Creates a new party (customer or supplier) in the current tenant. The partyType field must be ORGANIZATION or PERSON — mixed forms do not exist. For organizations, name is required; for persons, firstName and lastName.

The address may stay empty, but is then required when a contract is created. If you sync from weclapp, pass legacyId: 'wec-…' so that re-imports find the record again instead of creating a duplicate.

Data model

This operation works on the entity Party (party). All 70 fields — type, validation, required status, relationships — are listed in the schema reference.

  • Required fields: partyType, name, displayName
  • Server-managed: _id, schema, schemaVersion, tenantId, version, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy, churnedAt, lostAt, datevDebitorenkonto, datevKreditorenkonto, billingBlock.blockedAt, billingBlock.blockedBy, serviceBlock.blockedAt, serviceBlock.blockedBy, inheritedResponsibleUserIds, inheritedTeamIds, mergedIntoPartyId, mergedAt, mergedBy, mergedIntoAddressId — the platform assigns these fields; they are discarded in the request.

Example

curl -X POST https://api.codemeta-os.de/v1/parties \
  -H "X-Tenant-Id: $TENANT" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
  "partyType": "ORGANIZATION",
  "name": "Beispiel GmbH",
  "email": "info@beispiel.de"
}'
const result = await cm.parties.post({
  "partyType": "ORGANIZATION",
  "name": "Beispiel GmbH",
  "email": "info@beispiel.de"
});

Best practice

Keep the party record thin. Contract data, bank details and custom fields belong in separate linked entities — otherwise the audit patch becomes unwieldy on every update. Rule of thumb: anything that has a life of its own (multiple values, its own permission) gets its own entity.

Response codes

HTTP Meaning
200 Default Response

Search