Rate Modification

Rates have multiple modifier options in Decimal. These modifiers can be used to do things like changing the cost, the display text, the zone, and sometimes, the origin.

Defaults

The outermost configuration and each of the carrier blocks have the option for "default" modifiers. These can set the defaults for price modifiers, zone and origin. A default config looks like this:

"default": {
    "origin": ["default"],
    "price_modifier": {
        "margin": 10,
        "markup": 5,
        "cents": -100
    },
    "zone": {
        "country": ["US"]
    }
}

To see what the above modifier actually does, scroll down to the section, "Price modifiers".

The 'origin' is all origins that apply by default, but only one origin will ever be selected based on the origin conditions. Please see the section "Multi Origin" for more information on multiple origins. This option is only available in default, so it only applies at the carrier level.

Services

Each rate is generated from a particular carrier and service. A rate config looks like this:

{
    "code": "INTERNATIONAL_ECONOMY",
    "display_text": "International Standard",
    "total_price": 3500,
    "price_modifier": {
        "margin": 10,
        "markup": 5,
        "cents": -100
    },
    "zone": {
        "country": [
            "CA",
            "UK"
        ]
    }
}

Each service has a code if the this is a Carrier rate then the code must be the service you want (see the USPS, Fedex and UPS docs for these codes) if this is a flat rate then it is a unique code you pick.

The display text can manually be set by the "display_text" property. This will override any rate mapping you have (see below). If you want a flat rate to be displayed to the buyer then you can set the "total_cost" directly.

Price modifiers

There are three different price modifiers. Markup, Margin and Cents. They will always be applied in that order. If you are not sure of the differnce between Markup and Margin, go with Margin. Or read here for the differences between the two.

In the case above, as an example, let's assume that the Rate is $22.50; then the math will be as follows:

$22.50 + (10% x $22.5) = $24.75

$24.75 / (1 - 0.95) = $26.05

$26.05 - $1.00 = $25.05

So the final rate should show up as $25.05 as the cost to the buyer at checkout. However, in this case, since the "totalcost" is set to $35, the buyer will be shown $35 as the rate, despite the lower value of $25.05 calculated. And so all you need to do to force the calculated value of $25 is remove the line, "total_cost: 3500"

Zone

Zones specifiy a destination area for the service. For more info, see the section, "Pickup and Zones".

results matching ""

    No results matching ""