Calculate the premium

post
/coverages/calculate

Calculate premium

subtotal
Amount
required
amount
string
required
Example:
12.34
Match pattern:
^[0-9.]+$
currency
string
required

Only support USD for now

>= 3 characters<= 3 characters
Example:
USD
Match pattern:
^[A-Z]{3}$
shipping_total
Amount

OK

meta
Meta
required

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by AfterShip."}
code
number
required
Allowed values:
2000020100404004220050000
Default:
20000
type
string
required
>= 1 characters
message
string
required
>= 1 characters
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object
required
premium
Amount

Bad Request

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by AfterShip."}
code
number
required
Allowed values:
2000020100404004220050000
Default:
20000
type
string
required
>= 1 characters
message
string
required
>= 1 characters
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Unauthorized

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by AfterShip."}
code
number
required
Allowed values:
2000020100404004220050000
Default:
20000
type
string
required
>= 1 characters
message
string
required
>= 1 characters
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object

Unprocessable Entity (WebDAV)

meta
Meta

Meta data object.

Example:
{"code":20000,"type":"OK","message":"The request was successfully processed by AfterShip."}
code
number
required
Allowed values:
2000020100404004220050000
Default:
20000
type
string
required
>= 1 characters
message
string
required
>= 1 characters
errors
array[Error]

Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error.

data
object
Auth
:
Body
{ "subtotal": { "currency": "USD", "amount": "29.23" }, "shipping_total": { "currency": "USD", "amount": "1.23" } }
Response Example
{ "meta": { "code": 20000, "type": "OK", "message": "The request was successfully processed by AfterShip." }, "data": { "premium": { "amount": "12.3", "currency": "USD" } } }