Skip to content

Commit

Permalink
✨ Introduced get multi colli service rates endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
zwaans committed Nov 12, 2024
1 parent 63d7e14 commit 0136ae8
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 0 deletions.
3 changes: 3 additions & 0 deletions specification/paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"/get-service-rates": {
"$ref": "./paths/ServiceRates.json"
},
"/get-multi-colli-service-rates": {
"$ref": "./paths/MultiColliServiceRates.json"
},
"/manifests": {
"$ref": "./paths/Manifests.json"
},
Expand Down
190 changes: 190 additions & 0 deletions specification/paths/MultiColliServiceRates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"post": {
"tags": [
"MultiColliServiceRates"
],
"summary": "Get service rates for a multi-colli shipment",
"description": "This endpoint retrieves service rates from the carrier based on the supplied multi-colli shipment.",
"requestBody": {
"description": "The virtual master shipment and colli shipments to be created as one multi-colli shipment.",
"required": true,
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"properties": {
"master": {
"allOf": [
{
"$ref": "#/components/schemas/Shipment"
},
{
"required": [
"attributes"
],
"properties": {
"id": {
"readOnly": true
},
"attributes": {
"required": [
"myparcelcom_shipment_id",
"recipient_address",
"return_address",
"sender_address",
"service",
"physical_properties"
],
"properties": {
"recipient_address": {
"required": [
"first_name",
"last_name",
"street_1",
"city",
"country_code"
]
},
"return_address": {
"required": [
"street_1",
"city",
"country_code"
]
},
"sender_address": {
"required": [
"street_1",
"city",
"country_code"
]
},
"service": {
"required": [
"code"
]
},
"physical_properties": {
"required": [
"weight"
]
}
}
}
}
}
]
},
"colli": {
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/Shipment"
},
{
"required": [
"attributes"
],
"properties": {
"id": {
"readOnly": true
},
"attributes": {
"required": [
"myparcelcom_shipment_id",
"physical_properties"
],
"properties": {
"physical_properties": {
"required": [
"weight"
]
},
"items": {
"items": {
"required": [
"description",
"quantity"
]
}
}
}
}
}
}
]
}
}
}
},
"meta": {
"type": "object",
"properties": {
"track_trace": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Indicates whether or not the carrier should send track and trace emails for this shipment.",
"example": false,
"default": true
}
}
},
"label": {
"type": "object",
"properties": {
"mime_type": {
"type": "string",
"example": "application/pdf",
"default": "application/pdf",
"description": "Requested `mime-type` for the label of this shipment."
},
"size": {
"type": "string",
"example": "A6",
"default": "A6",
"description": "Requested size for the label of this shipment."
}
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Retrieved the service rates.",
"content": {
"application/vnd.api+json": {
"schema": {
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ServiceRateResponse"
}
}
}
}
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions specification/tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{
"name": "Manifests"
},
{
"name": "MultiColliServiceRates"
},
{
"name": "MultiColliShipments"
},
Expand Down

0 comments on commit 0136ae8

Please sign in to comment.