Text types¶
Every item declares a textType. It's a fixed set — send one of these exact
strings. The authoritative list is GET /info/text-types; as of writing it's:
textType |
Use it for |
|---|---|
specialized-text |
General / technical copy. The safe default. |
product |
Product data — names, descriptions, attributes. |
marketing |
Campaign copy, taglines, anything that needs to sell. |
term |
Terminology, glossary entries, short standalone terms. |
template |
Templated content with placeholders/structure. |
software |
UI strings, labels, messages. |
ai-01, ai-02, ai-03 |
AI-assisted translation tiers. |
For an Akeneo product catalogue, product is almost always right. When unsure,
specialized-text won't be wrong, just generic.
Don't hardcode the list¶
The set grows (the ai-0x tiers were added after the original six). If you
validate textType against a copy baked into your code, you'll eventually reject
values the API accepts — a silent, annoying bug. Pull the current list at runtime
instead:
$allowed = $client->getTextTypes(); // GET /info/text-types
if (!in_array($textType, $allowed, true)) {
// fail early, with a clear message
}
The client deliberately does not reject textType values for you, exactly so
it can't fall out of sync with the API. Sending an unknown value fails item
creation with a 4xx, so if you skip the runtime check you'll still find out —
just later and less clearly.