Versions Compared

Key

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

With Codyt projects, cost details are saved with documents (for client costing) and jobs (for supplier costing). These details are then pulled when creating invoices. The following APIs return cost details:

PROPERTIES

A cost object has these properties:

total

Total amount, excluding VAT.

If null, then the cost has not been assigned or calculated. Note, that most (but not all) other properties below will also be null when no cost was assigned.

decimal?

totalBase

Total cost prior to applying reductions, fees/discounts and percentage of total content costed. The details of these are described in the next lines.

decimal?

details

The individual contributions to the cost (similar to invoice lines). The array is empty if there are no details available.

See chapter below for the documentation.

object[]

reduction

Information on applicable reductions

object

reduction.amount

Total reduction

decimal

reduction.percent

Total reduction in percent relative to totalBase.

decimal?

reduction.subTotal

Total after applying reduction (totalBase - reduction.amount)

decimal?

fee

Information on fee (positive) or discounts (negative)

object

fee.amount

Total amount added. If the amount is positive then it is a fee, otherwise it is a discount.

decimal

fee.percent

Total reduction in percent

decimal?

fee.subTotal

Total after applying reduction (reduction.subTotal + fee.amount).

decimal?

covered.percent

100% means that the cost is applied (and will be invoiced). 50% means that only half of the cost will be applied. By default the value is 100.

decimal

covered.subTotal

This is the same as total.

decimal?

currency

The currency code, see settings/currencies/codes

Null if cost is not calculated.

string

decimals

Decimal places used when rounding amounts.

int

COST DETAILS LINES

The details node contains an array with cost lines (when no details available then the array is empty). The properties are:

summary

The description of the provided service.

string

task

The service task code such as TR for translation or RV for revision. To discover all task types, see settings/tasks/codes

string

count

Number of units (see priceUnitCode) that are costed. This may be e.g. 10 words. The count can be 0.

int

priceUnitCode

The unit that is costed. Such as “WD” (words) or “CH” (characters). See also: Price units.

string

priceUnits

Number of units included in the unit price.

int

priceAmount

Unit price that is the price of serviceUnitCount units of type serviceUnit. For example: 1 EUR for 10 characters.

decimal

priceCurrency

Currency code such as “EUR” or “USD”.

string

productCode

Optional product code. Empty string if none.

string

reduction

Optional reduction in percent from 0 to 100.

decimal

amount

Total amount for this line.

decimal

amountBase

Total amount before reduction for this line.

decimal

fuzzyCategory

Indicates if this line refers to a fuzzy match/repetition or a pre-translation. See Match/Pretranslation Category (EFuzzyCategory)

int

fuzzyInterval

The match % that corresponds to the fuzzyCategory. Null if it is neither a match/repetition nor a pre-translation. In that case fuzzyCategory is always Default.

int?

isMinCharge

Boolean that indicates if this line specifies a minimum fee.

bool

EXAMPLES

To clarify how reductions, fees and coverage are applied on the base cost, see this screenshot and the corresponding payload below:

...

Code Block
"cost": {
    "total": 495.00,
    "totalBase": 1000.00,
    "details": [],
    "reduction": {
        "amount": 100.00,
        "percent": 10.0,
        "subTotal": 900.00
    },
    "fee": {
        "amount": 90.00,
        "percent": 10.0,
        "subTotal": 990.00
    },
    "covered": {
        "percent": 50.0,
        "subTotal": 495.00
    },
    "currency": "USD",
    "decimals": 2
}

An example for a details array:

Code Block
[
    {
        "task": "TR",
        "count": 0.0,
        "priceUnitCode": "WD",
        "priceAmount": 2.0000,
        "priceCurrency": "EUR",
        "priceUnits": 1,
        "productCode": "",
        "reduction": 40.0,
        "amount": 0.00,
        "amountBase": 0.00,
        "fuzzyInterval": 100,
        "fuzzyCategory": 0,
        "summary": "Translation 0 Words 100% match, EUR 2.00 per Word - 40% reduction",
        "isMinCharge": false
    },
    {
        "task": "TR",
        "count": 2.0,
        "priceUnitCode": "WD",
        "priceAmount": 2.0000,
        "priceCurrency": "EUR",
        "priceUnits": 1,
        "productCode": "",
        "reduction": 0.0,
        "amount": 4.00,
        "amountBase": 4.00,
        "fuzzyInterval": null,
        "fuzzyCategory": 0,
        "summary": "Translation 2 Words, EUR 2.00 per Word",
        "isMinCharge": false
    }
]