Service Rates
Service rates determine the price, dimensions and available options for a given service. A user has access to service rates that are related to the contracts they have access to.
Attributes
Attribute |
Type |
Required |
Description |
---|---|---|---|
weight_min |
integer |
✓ |
The minimum weight in grams a shipment should have for this service rate to apply to it. |
weight_max |
integer |
✓ |
The maximum weight in grams a shipment should have for this service rate to apply to it. |
weight_bracket |
If a weight bracket is present, the price depends on the actual weight of the parcel and should be calculated. See weight-bracket calculation. |
||
length_max |
integer |
The maximum length of the shipment in mm. |
|
width_max |
integer |
The maximum width of the shipment in mm. |
|
height_max |
integer |
The maximum height of the shipment in mm. |
|
volume_max |
float |
The maximum volume of the shipment in liters (dm3). |
|
is_dynamic |
boolean |
When a service rate is dynamic, it’s price depends on complicated carrier logic. You can use the |
|
price |
The price of the service in cents. |
||
fuel_surcharge |
The additional fuel surcharge of the service in cents (not included in |
||
oversize_surcharge |
The oversize surcharge is an additional fee that is charged when the length of a shipment (longest dimension) exceeds the |
||
includes_vat |
boolean |
✓ |
Indicates whether VAT is included in the price returned by the API (default |
Relationship |
Type |
Required |
Description |
---|---|---|---|
contract |
✓ |
The contract this rate belongs to. |
|
service |
✓ |
The service this rate belongs to. |
|
service_options |
The service service options that are available for this contract and service combination. The price and whether it is always included are available in the meta. |
Endpoints
GET /service-rates
Retrieving a list of all the service rates available to the current user.
Scope Any of the following scopes:
organizations.manage
shipments.manage
Request parameters For more specific requests, the following parameters can be included as query parameters.
Parameter |
Type |
Description |
---|---|---|
filter[has_active_contract] |
boolean |
A |
filter[weight] |
integer |
Weight in grams to filter on. This will only return service-rates for which the following is true |
filter[volume] |
float |
Volume in liters (dm3) to filter on. Use together with weight filter for the most accurate results. This is used to calculate the volumetric weight, using the |
filter[service] |
string |
Comma separated string of service ids to filter the service rates by. |
filter[contract] |
string |
Comma separated string of contract ids to filter the service rates by. |
Request
GET /service-rates HTTP/1.1
Accept: application/vnd.api+json
Example: https://api.sandbox.myparcel.com/service-rates
Response
{
"data": [
{
"type": "service-rates",
"id": "09a8f83a-bc8d-4598-81e6-ebf9d59a186a",
"attributes": {
"weight_min": 0,
"weight_max": 2000,
"length_max": 300,
"width_max": 200,
"height_max": 200,
"volume_max": 12,
"price": {
"amount": 995,
"currency": "EUR"
}
},
"relationships": {
"contract": {
"data": {
"type": "contracts",
"id": "2cb32706-5762-4b96-9212-327e6afaeeff"
},
"links": {
"related": "https://api.sandbox.myparcel.com/contracts/2cb32706-5762-4b96-9212-327e6afaeeff"
}
},
"service": {
"data": {
"type": "services",
"id": "175a235f-aff5-4e44-87b5-3657b75c1deb"
},
"links": {
"related": "https://api.sandbox.myparcel.com/services/175a235f-aff5-4e44-87b5-3657b75c1deb"
}
},
"service_options": {
"data": [
{
"type": "service-options",
"id": "4c675b1a-516c-4410-abff-d237fd45bcd0",
"meta": {
"price": {
"amount": 995,
"currency": "EUR"
},
"included": true
}
}
]
}
},
"links": {
"self": "https://api.sandbox.myparcel.com/service-rates/c9ce29a4-6325-11e7-907b-a6006ad3dba0"
}
}
],
"meta": {
"total_pages": 13,
"total_records": 373
},
"links": {
"self": "https://api.sandbox.myparcel.com/service-rates?page[number]=3&page[size]=30",
"first": "https://api.sandbox.myparcel.com/service-rates?page[number]=1&page[size]=30",
"prev": "https://api.sandbox.myparcel.com/service-rates?page[number]=2&page[size]=30",
"next": "https://api.sandbox.myparcel.com/service-rates?page[number]=4&page[size]=30",
"last": "https://api.sandbox.myparcel.com/service-rates?page[number]=13&page[size]=30"
}
}
GET /service-rates/{service_rate_id}
Retrieve a specific service rate.
Scope
Any of the following scopes:
organizations.manage
Request
GET /shops/{service_rate_id} HTTP/1.1
Accept: application/vnd.api+json
Example: https://api.sandbox.myparcel.com/service-rates/09a8f83a-bc8d-4598-81e6-ebf9d59a186a
Response
{
"data": {
"type": "service-rates",
"id": "09a8f83a-bc8d-4598-81e6-ebf9d59a186a",
"attributes": {
"weight_min": 0,
"weight_max": 2000,
"length_max": 300,
"width_max": 200,
"height_max": 200,
"volume_max": 12,
"price": {
"amount": 995,
"currency": "EUR"
}
},
"relationships": {
"contract": {
"data": {
"type": "contracts",
"id": "2cb32706-5762-4b96-9212-327e6afaeeff"
},
"links": {
"related": "https://api.sandbox.myparcel.com/contracts/2cb32706-5762-4b96-9212-327e6afaeeff"
}
},
"service": {
"data": {
"type": "services",
"id": "175a235f-aff5-4e44-87b5-3657b75c1deb"
},
"links": {
"related": "https://api.sandbox.myparcel.com/services/175a235f-aff5-4e44-87b5-3657b75c1deb"
}
},
"service_options": {
"data": [
{
"type": "service-options",
"id": "4c675b1a-516c-4410-abff-d237fd45bcd0",
"meta": {
"price": {
"amount": 995,
"currency": "EUR"
},
"included": true
}
}
]
}
},
"links": {
"self": "https://api.sandbox.myparcel.com/service-rates/c9ce29a4-6325-11e7-907b-a6006ad3dba0"
}
}
}