Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Get presets list

RequestGET /editor/plugins_matchanalysis_pricingpreset
Paramsno params needed


Code Block
languagejs
titleResponse
collapsetrue
{
    "total": 3,
    "rows": [
        {
            "id": "1",
            "customerId": null,
            "name": "Translate5-Standard",  // This is a read-only preset that comes with translate5 installation 
            "unitType": "word",
             // and it's default, but you can set other one to be default
            "description": "",
            "priceAdjustment": "0.00",
            "isDefault": "
0
1"
        },
        {
            "id": "2",
            "customerId": null,
            "name": "Some preset",
            "unitType": "word",
            "description": null,
            "priceAdjustment": "0.00",
            "isDefault": "
1
0"
        }
    ],
    ...
}



Create preset

RequestPOST /editor/plugins_matchanalysis_pricingpreset
Params

name Required. Name for the preset, it should be unique across the all presets


customerId Optional. ID of customer. This param should be provided if you want new preset to be customer-specific one


Code Block
languagejs
titleResponse
collapsetrue
{
    "success": true,
    "created": {
        "id": "6",
        "customerId": null,
        "name": "Some preset",
        "unitType": "word",
        "description": null,
        "priceAdjustment": "0.00",
        "isDefault": "0"
    }
}



Clone preset

RequestPOST /editor/plugins_matchanalysis_pricingpreset/clone
Params

presetId Required. ID of preset to be cloned


name Required. Name for the clone, it should be unique across the all presets

customerId Optional. ID of customer. This param should be provided if you want new preset to be customer-specific one


Code Block
languagejs
titleResponse
collapsetrue
{
    "success": true,
    "clone": {
        "id": "5",
        "customerId": null,
        "name": "
asd1
Cloned from some preset",
        "unitType": "word",
        "description": null,
        "priceAdjustment": "0.00",
        "isDefault": "0"
    }
}



Edit preset

RequestPUT /editor/plugins_matchanalysis_pricingpreset
Params

presetId Required. ID of preset to be edited


name Optional. Name for the preset, it should be unique across the all presets, should be either not empty or not mentioned among the params

unitType=(word|character) Optional. Type of units that the preset should be based on, i.e. word-based or character-based


description Optional. Short description for the preset up to 255 characters long


priceAdjustment Optional. Value to be appended to final price. Should be a decimal value with up to 2 digits after floating point.


Code Block
languagejs
titleResponse
collapsetrue
{
    "success": true,
    "updated": {
        "id": "5",
        "customerId": null,
        "name": "Some preset",
        "unitType": "word",
        "description": "Some description",
        "priceAdjustment": "0.00",
        "isDefault": "0"
    }
}



Set to be default

RequestPUT /editor/plugins_matchanalysis_pricingpreset/setdefault
ParamspresetId Required. ID of preset to be set as default one for it's customer, if it's a customer-specific preset, or to be set as the global default


Code Block
languagejs
titleResponse
collapsetrue
{
    "wasDefault": 6 // Id of preset that was the previous default
}



Delete preset

RequestDELETE /editor/plugins_matchanalysis_pricingpreset
ParamspresetId Required. ID of preset to be deleted


Code Block
languagejs
titleResponse
collapsetrue
{
    "success": true
}