Creates a packaging specification in one call: identity plus REFERENCES to library items created beforehand. Atomic — everything this call creates exists after it, or nothing does (any failure returns 422 and no resource is created).
Differences from the food create: name is required (packaging is the one type whose name is caller-chosen rather than derived from a trade item); there is NO tradeItemId (packaging specifications carry no trade item), NO folderId (packaging specifications cannot be placed in folders) and NO requirements (packaging chapters have no requirement sections). Sending any of them is a 400, not a silent drop.
Library-chapter slots: testingChapter takes a { "chapterId": ... } reference to a published, active library chapter. packagingSystemChapter references a packaging system and is not accepted yet: the member is refused (400), never dropped.
Questionnaires are attached AUTOMATICALLY at creation (one instance per matching published template), same as the food create; explicit questionnaires references are refused (400).
The user of your company who owns the specification and becomes its retailer contact. Optional when your credentials identify a user: that user is taken, and a person may only name themselves (naming anyone else is a 403). Required when your credentials carry no user. The company always binds from your credentials, never from the payload.
Your company's published specification template — communicated at onboarding by Professional Services. It must be owned by your company, published and in its active version.
Reference to an existing library chapter. The specification links the chapter's current ACTIVE version and shares that same document with every other linked specification: in-place content updates (the library PUT) are seen by all of them immediately. A NEW chapter version does not propagate — a spec adopts it by explicit re-link (the .../link endpoints). The referenced chapter must be a PUBLISHED, ACTIVE version owned by your company (422 otherwise). chapterId must be the ONLY property in the slot: "link this chapter AND change it" is two actions — this call does one.
Reference to a packaging system. Not accepted yet: sending the member is a 400, never a silent drop.
- Productionhttps://apis.traceone.com/spec/v2/packaging/specifications
curl -i -X POST \
https://apis.traceone.com/spec/v2/packaging/specifications \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"ownerUserId": "283eeac5-beea-465a-80a5-763009480d0f",
"name": "string",
"supplierId": "e01eb4c4-8eb9-4fb7-b625-61f58c6148db",
"templateId": "196100ac-4eec-4fb6-a7f7-86c8b584771d",
"languageCode": "en-US",
"reasonForThisVersion": "string",
"testingChapter": {
"chapterId": "2a48aff7-27e7-4ab6-9471-1ee9c5632811"
},
"packagingSystemChapter": {
"chapterId": "2a48aff7-27e7-4ab6-9471-1ee9c5632811"
},
"questionnaires": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}'{ "specificationId": "df380d59-2906-4417-bec3-4ac4567b1960" }