Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions specification/paths/ServiceRates.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"required": [
"recipient_address",
"sender_address",
"service",
"physical_properties"
],
"properties": {
Expand All @@ -52,6 +53,11 @@
"country_code"
]
},
"service": {
"required": [
"code"
]
},
Comment on lines +56 to +60
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a little discussion with @M4tini about this on Slack. I asked why the service and service.code properties were only required for /get-multi-colli-service-rates and not also for /get-service-rates.

He explained that initially, the endpoint was built to support a request for rates for multiple services, which made it impossible for this field to be required. However, in practice, we only ever request a rate for a single service at a time through our API and we also assume that the first result in the response (which is an array) will contain the correct rate.

Therefore, it is not a problem and more accurately reflects how we retrieve dynamic service rates to make these properties required in the schema

"physical_properties": {
"required": [
"weight"
Expand Down
11 changes: 9 additions & 2 deletions specification/schemas/Shipment.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,18 @@
"properties": {
"code": {
"type": "string",
"example": "service-a01"
"example": "service-a01",
"description": "Shipment service code"
},
"name": {
"type": "string",
"example": "Parcel to Parcelshop"
"example": "Parcel to Parcelshop",
"description": "Shipment service name"
},
"zone_to_code": {
"type": "string",
"example": "western-europe:netherlands",
"description": "Shipment service destination <a href=\"https://api-specification.myparcel.com/#tag/Zones/paths/~1zones~1%7Bzone_id%7D/get\" target=\"_blank\">Zone</a> code"
}
}
},
Expand Down