With the /Styles endpoint user can manage styles from the database.

GET /api/Styles/List Get a list of all styles
Request Example
    /api/Styles/List
            
Response Example
    [
        {
            "Id": "string",
            "Name": "string",
            "Code": "string",
            "Description": "string",
            "TemplatePreviewURL": "string",
            "FontName": "string",
            "TextHeight": 0,
            "Recipe": "string",
            "FontName2": "string",
            "TextHeight2": 0,
            "Recipe2": "string",
            "WidthCompression": 0,
            "LineSpacing": 0,
            "TextType": "string", 
            "MaxHeight": 0,
            "MaxWidth": 0,
            "Orientation": 0,   [0 Vertical, 1 Horizontal]
            "DefaultText": "string",
            "PricingSKU": "string",
            "Colors": [
                {
                    "label": "string",
                    "value": "string",
                    "Red": 0,
                    "Green": 0,
                    "Blue": 0
                },
                {
                    "label": "string",
                    "value": "string",
                    "Red": 0,
                    "Green": 0,
                    "Blue": 0
                },
                {
                    ...
                }
            ],
            "Fonts": [
                {
                    "id": 0,
                    "label": "string",
                    "value": "string",
                    "IsMultiColour": false,
                    "FontPath": "string",
                    "ForceCapitalization": false,
                    "MinLength": 0,
                    "MaxLength": 0,
                    "IsUppercase": false,
                    "IsLowercase": false,
                    "IsNumbers": false,
                    "IsRaised": false,
                    "Recipe": "string",
                    "PricingSKU": "string"
                },
                {
                    ...
                }
            ],
            "IsDefault": false
        },
        {...}
    ]
            
GET /api/Styles/Get Get a style
Request Example
    /api/Styles/Get?id=styleId&code=styleCode
    Use id parameter to get style by id or
    Use code parameter to get style by code
            
Response Example
    If found, a style is returned with status code 200. Otherwise an error with code and message is returned with status code 404  
        {
            "Id": "string",
            "Name": "string",
            "Code": "string",
            "Description": "string",
            "TemplatePreviewURL": "string",
            "FontName": "string",
            "TextHeight": 0,
            "Recipe": "string",
            "FontName2": "string",
            "TextHeight2": 0,
            "Recipe2": "string",
            "WidthCompression": 0,
            "LineSpacing": 0,
            "TextType": "string",
            "MaxHeight": 0,
            "MaxWidth": 0,
            "Orientation": 0,   [0 Vertical, 1 Horizontal]
            "DefaultText": "string",
            "PricingSKU": "string",
            "Colors": [
                {
                    "label": "string",
                    "value": "string",
                    "Red": 0,
                    "Green": 0,
                    "Blue": 0
                },
                {
                    "label": "string",
                    "value": "string",
                    "Red": 0,
                    "Green": 0,
                    "Blue": 0
                },
                {
                    ...
                }
            ],
            "Fonts": [
                {
                    "id": 0,
                    "label": "string",
                    "value": "string",
                    "IsMultiColour": false,
                    "FontPath": "string",
                    "ForceCapitalization": false,
                    "MinLength": 0,
                    "MaxLength": 0,
                    "IsUppercase": false,
                    "IsLowercase": false,
                    "IsNumbers": false,
                    "IsRaised": false,
                    "Recipe": "string",
                    "PricingSKU": "string"
                },
                {
                    ...
                }
            ],
            "IsDefault": false
        }    
            
POST /api/Styles/Create
Model Request Example
    {
        "Name": "string",
        "Code": "string",
        "Description": "string",
        "FontName": "string",
        "TextHeight": 0, [required, if not provided default value is applied: 1]
        "Recipe": "string",
        "FontName2": "string",
        "TextHeight2": 0,
        "Recipe2": "string",
        "WidthCompression": 0, [required, if not provided default value is applied: 100]
        "LineSpacing": 0,
        "TextType": "string", [possible values: "text"(the default), "traditional-monogram","modern-monogram","arc"]]
        "MaxHeight": 0,
        "MaxWidth": 0,
        "Orientation": "vertical",  [required, possible values: "vertical" or 0, "horizontal" or 1]
        "DefaultText": "string",
        "PricingSKU": "string",
        "Colors": ["string", "string", ...],
        "Fonts": ["string", "string", ...],
        "IsAllColors":true,
        "IsAllFonts":true,
        "CreateBoundary":false,
        "BorderDistance":0,
        "BorderSteilThickness":0,
        "BorderColor":"string",
        "BoundaryShape":"string"
    }
    
    If CreateBoundary is provided and set to true and no BoundaryShape is provided then the default value of Rectangle is given 
    Colors and Fonts lists: if provided, only matching colors and embroidery style fonts db names are inserted
                
Response Example
If the operation is successful a style will be returned with status code 201
Otherwise an error with code and message will be returned with status code 409           
            
PATCH /api/Styles/Update Update a style
Request Example
    /api/Styles/Update?id=styleId&code=styleCode&InUseBehavior=1
    Use id parameter to identify the style to update by id or
    Use code parameter to identify the style to update by code
    InUseBehavior is optional: it controls the behavior if the action attempts to update the style's code while it is being used by other entities
    Default value is 0 or UpdateIfNotUsed (the safest option) 
    Set to 1 or UpdateAlways in order to allow the update even if other entities pointing to the style exist (please have in mind that they may be affected)
            
Model Request Example
    Only provided fields are updated
    {
        "Code": "string",
        "Name": "string",
        "Description": "string",
        "FontName": "string",
        "TextHeight": 0,
        "Recipe": "string",
        "FontName2": "string",
        "TextHeight2": 0,
        "Recipe2": "string", 
        "WidthCompression": 0,
        "LineSpacing": 0,
        "TextType": "string", [possible values: "text", "traditional-monogram","modern-monogram","arc"]
        "MaxHeight": 0,
        "MaxWidth": 0,
        "Orientation": "vertical",  [possible values: "vertical" or 0, "horizontal" or 1]
        "DefaultText": "string",
        "PricingSKU": "string",
        "Colors": ["string", "string", ...],    [if provided they fully override the existing ones if any]
        "Fonts": ["string", "string", ...],     [if provided they fully override the existing ones if any]
        "IsAllColors":true,
        "IsAllFonts":true,
        "CreateBoundary":false,
        "BorderDistance":0,
        "BorderSteilThickness":0,
        "BorderColor":"string",
        "BoundaryShape":"string"
    }

    If CreateBoundary is provided and set to true and no BoundaryShape is provided and a value did not already exist either, then the default value of Rectangle is given 
    Colors and Fonts lists: if provided, only matching colors and embroidery style fonts db names are inserted
            
Response Example
If the operation is successful an empty response will be returned with status code 200
Otherwise an error with code and message will be returned with status code 409           
            
PUT /api/Styles/Update Update a style
Request Example
    /api/Styles/Update?id=styleId&code=styleCode&InUseBehavior=1
    Use id parameter to identify the style to update by id or
    Use code parameter to identify the style to update by code
    InUseBehavior is optional: it controls the behavior if the action attempts to update the style's code while it is being used by other entities
    Default value is 0 or UpdateIfNotUsed (the safest option) 
    Set to 1 or UpdateAlways in order to allow the update even if other entities pointing to the style exist (please have in mind that they may be affected)
            
Model Request Example
    All fields are updated
    {
        "Code": "string",
        "Name": "string",
        "Description": "string",
        "FontName": "string",
        "TextHeight": 0,
        "Recipe": "string",
        "FontName2": "string",
        "TextHeight2": 0,
        "Recipe2": "string", 
        "WidthCompression": 0,
        "LineSpacing": 0,
        "TextType": "string", [possible values: "text", "traditional-monogram","modern-monogram","arc"]
        "MaxHeight": 0,
        "MaxWidth": 0,
        "Orientation": "vertical",  [possible values: "vertical" or 0, "horizontal" or 1]
        "DefaultText": "string",
        "PricingSKU": "string",
        "Colors": ["string", "string", ...],    [if provided they fully override the existing ones if any]
        "Fonts": ["string", "string", ...],     [if provided they fully override the existing ones if any]
        "IsAllColors":true,
        "IsAllFonts":true,
        "CreateBoundary":false,
        "BorderDistance":0,
        "BorderSteilThickness":0,
        "BorderColor":"string",
        "BoundaryShape":"string"
    }

    If CreateBoundary is provided and set to true and no BoundaryShape is provided and a value did not already exist either, then the default value of Rectangle is given 
    Colors and Fonts lists: if provided, only matching colors and embroidery style fonts db names are inserted
            
Response Example
If the operation is successful an empty response will be returned with status code 200
Otherwise an error with code and message will be returned with status code 409
            
DELETE /api/Styles/Delete Delete a style
Request Example
/api/Styles/Delete?id=styleId&code=styleCode&InUseBehavior=0
Use id parameter to identify the style to update by id or
Use code parameter to identify the style to delete by code
InUseBehavior is optional: it controls the behavior if the action attempts to delete a style which is being used by other entities.
Default value is 0 or DeleteIfNotUsed (the safest option) 
Set to 1 or DeleteAlways in order to allow the deletion even if other entities pointing to the style exist (please have in mind that they may be affected)
            
Response Example
If the operation is successful an empty response will be returned with status code 200
Otherwise an error with code and message will be returned with status code 409