// Get the service
$attributeService = Shopware()->Container()->get('shopware_attribute.crud_service');
// Create Textfield
$attributeService->update('s_articles_attributes', 'your_custom_field', 'string', [
'label' => 'Your Label',
'translatable' => false,
'displayInBackend' => true,
'position' => 100
]
);
For a detailed documentation see: Attribute system