Skip to content

Quote carrier services

POST
/stores/{storeRef}/orders/{id}/shipments/quote
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/stores/example/orders/1/shipments/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "weight_gr": 1500, "length_cm": 20, "width_cm": 15, "height_cm": 10, "cod_amount": 0, "freight_payment_method": "cash", "use_insurance": true, "note": "example" }'

Asks the AllinGo carrier for live prices of every service that can carry this order’s package, and books nothing. Send the package size, weight, COD amount and who pays the freight; the pickup and delivery addresses come from the store and the order. Each call contacts the carrier.

Required scopes: write:orders

id
required
integer

The order ID.

storeRef
required
string

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

Media typeapplication/json
object
weight_gr
required

Grams

number
>= 1

Example

1500
length_cm
required

Cm

number
>= 1 <= 300

Example

20
width_cm
required

Cm

number
>= 1 <= 300

Example

15
height_cm
required

Cm

number
>= 1 <= 300

Example

10
cod_amount
required

VND to collect; 0 for prepaid

number

Example

0
freight_payment_method
required
string
Allowed values: cash credit post_paid
use_insurance
required
boolean
note

Note to the courier

string
<= 500 characters
Media typeapplication/json
object
quotes
required

One entry per carrier service.

Array<object>
object
service_id
required

ID of the carrier service. Pass it as service_id when booking.

string
service_name
required

Name of the carrier service.

string
partner_code
required

Code of the delivery partner.

string
partner_name
required

Name of the delivery partner.

string
partner_logo_url
required

Logo URL of the delivery partner, or null.

string
nullable
price
required

Price of the service for this package.

number
available
required

Whether the service can carry this package.

boolean
error_code
required

Why the service is unavailable, or null.

string
nullable
estimated_label
required

Estimated delivery time as a label, such as 1-2 days, or null.

string
nullable

Example generated

{
"quotes": [
{
"service_id": "example",
"service_name": "example",
"partner_code": "example",
"partner_name": "example",
"partner_logo_url": "example",
"price": 1,
"available": true,
"error_code": "example",
"estimated_label": "example"
}
]
}

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"
}

The request conflicts with the resource’s current state.

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 request is valid but cannot be processed.

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"
}