Skip to content

Update a shipping rate

PUT
/stores/{storeRef}/shipping-zones/{zoneId}/rates/{id}
curl --request PUT \
--url https://apibase.ecomweb.app/api/v1/stores/example/shipping-zones/1/rates/1 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "delivery_type": "STANDARD", "display_name": "Giao tiêu chuẩn", "rate_type": "FIXED", "amount": 25000, "condition_type": "NONE", "min_value": 1, "max_value": 1, "estimated_days_min": 1, "estimated_days_max": 1, "carrier_code": "allingo", "carrier_service_ids": [ "example" ], "price_adjustment": -5000, "is_active": true, "sort_order": 1 }'

Updates the fields you send. Switching a rate to CARRIER_QUOTE applies the same rules as creating one; switching a carrier rate back to FIXED needs an amount and clears the carrier fields. The zone in the path is not checked against the rate, which is looked up by its own ID.

Required scopes: write:shippings

id
required
integer

The shipping rate ID.

zoneId
required
integer

The ID of the shipping zone the rate belongs to.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
delivery_type

Kind of delivery.

string
Allowed values: STANDARD EXPRESS SAME_DAY ECONOMY PICKUP
display_name

Name shown to the shopper at checkout.

string
<= 255 characters

Example

Giao tiêu chuẩn
rate_type
string
default: FIXED
Allowed values: FIXED CARRIER_QUOTE
amount

Zero means free

number

Example

25000
condition_type

What min_value and max_value are measured on: the order value or the weight in grams. Defaults to NONE, which always matches.

string
default: NONE
Allowed values: NONE ORDER_VALUE WEIGHT
min_value

Lowest order value or weight, in grams, the rate applies to.

number
max_value

Highest order value or weight, in grams, the rate applies to.

number
estimated_days_min

Fastest estimated delivery, in days.

number
estimated_days_max

Slowest estimated delivery, in days.

number
carrier_code

Carrier of a carrier rate. Only allingo is supported.

string
Allowed values: allingo
carrier_service_ids

AllinGo service ids; required (non-empty) for CARRIER_QUOTE

Array<string>
price_adjustment

Signed VND added to the carrier quote

number

Example

-5000
is_active

Whether the rate is offered at checkout.

boolean
sort_order

Position of the rate in the zone’s list.

number
Media typeapplication/json
object
delivery_type
required

Kind of delivery.

string
Allowed values: STANDARD EXPRESS SAME_DAY ECONOMY PICKUP
rate_type
required

FIXED charges amount; CARRIER_QUOTE takes the price from the carrier at checkout.

string
Allowed values: FIXED CARRIER_QUOTE
condition_type
required

What the rate’s min_value and max_value are measured on: NONE, the order value or the weight in grams.

string
Allowed values: NONE ORDER_VALUE WEIGHT
active_reason
required

Why an active carrier rate cannot produce options right now: carrier_not_connected, or null.

string
nullable
Allowed values: carrier_not_connected
id
required

Rate ID.

number
zone_id
required

ID of the zone the rate belongs to.

number
display_name
required

Name shown to the shopper at checkout.

string
amount
required

Fee charged for a fixed rate; 0 means free. Always 0 for a carrier rate.

number
min_value
required

Lower bound of the condition, or null.

number
nullable
max_value
required

Upper bound of the condition, or null.

number
nullable
estimated_days_min
required

Fastest estimated delivery in days, or null.

number
nullable
estimated_days_max
required

Slowest estimated delivery in days, or null.

number
nullable
carrier_code
required

Carrier of a carrier rate: allingo. Null for a fixed rate.

string
nullable
carrier_service_ids
required

IDs of the carrier services a carrier rate offers. Empty for a fixed rate.

Array<string>
price_adjustment
required

Amount added to the carrier’s quote; may be negative. 0 for a fixed rate.

number
is_active
required

Whether the rate is offered at checkout.

boolean
sort_order
required

Position of the rate in the zone’s list.

number

Example

{
"delivery_type": "STANDARD",
"rate_type": "FIXED",
"condition_type": "NONE",
"active_reason": "carrier_not_connected"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}