Skip to content

Commit

Permalink
Merge pull request #271 from MyParcelCOM/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
yoan-myparcel authored Nov 27, 2024
2 parents 7b7044d + 04018af commit 69fbb78
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 13 deletions.
15 changes: 9 additions & 6 deletions specification/paths.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"/validate-credentials": {
"$ref": "./paths/ValidateCredentials.json"
},
"/collection-time-slots": {
"$ref": "./paths/CollectionTimeSlots.json"
},
Expand All @@ -11,12 +14,12 @@
"/get-service-rates": {
"$ref": "./paths/ServiceRates.json"
},
"/get-multi-colli-service-rates": {
"$ref": "./paths/MultiColliServiceRates.json"
},
"/manifests": {
"$ref": "./paths/Manifests.json"
},
"/multi-colli-shipments": {
"$ref": "./paths/MultiColliShipments.json"
},
"/pickup-dropoff-locations/{pudo_id}": {
"$ref": "./paths/PickupDropoffLocations-pudo_id.json"
},
Expand All @@ -29,6 +32,9 @@
"/shipments": {
"$ref": "./paths/Shipments.json"
},
"/multi-colli-shipments": {
"$ref": "./paths/MultiColliShipments.json"
},
"/shipments/{shipment_id}": {
"$ref": "./paths/Shipments-shipment_id.json"
},
Expand All @@ -37,8 +43,5 @@
},
"/shipments/{shipment_id}/statuses/{tracking_code}": {
"$ref": "./paths/Shipments-shipment_id-Statuses-tracking_code.json"
},
"/validate-credentials": {
"$ref": "./paths/ValidateCredentials.json"
}
}
149 changes: 149 additions & 0 deletions specification/paths/MultiColliServiceRates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"post": {
"tags": [
"ServiceRates"
],
"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",
"required": [
"master",
"colli"
],
"properties": {
"master": {
"allOf": [
{
"$ref": "#/components/schemas/Shipment"
},
{
"required": [
"attributes"
],
"properties": {
"id": {
"readOnly": true
},
"attributes": {
"required": [
"recipient_address",
"sender_address",
"service",
"physical_properties"
],
"properties": {
"recipient_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": [
"physical_properties"
],
"properties": {
"physical_properties": {
"required": [
"weight"
]
},
"items": {
"items": {
"required": [
"description",
"quantity"
]
}
}
}
}
}
}
]
}
}
}
}
}
}
}
}
},
"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"
}
}
}
}
}
}
}
}
}
}
6 changes: 5 additions & 1 deletion specification/paths/MultiColliShipments.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"post": {
"tags": [
"MultiColliShipments"
"Shipments"
],
"summary": "Create a multi-colli shipment.",
"description": "This endpoint creates a new multi-colli shipment in the system of the carrier.",
Expand All @@ -19,6 +19,10 @@
"properties": {
"data": {
"type": "object",
"required": [
"master",
"colli"
],
"properties": {
"master": {
"allOf": [
Expand Down
2 changes: 1 addition & 1 deletion specification/paths/ValidateCredentials.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"get": {
"tags": [
"ValidateCredentials"
"Credentials"
],
"summary": "Validate credentials.",
"description": "This endpoint validates the credentials in the headers with the system of the carrier.",
Expand Down
7 changes: 2 additions & 5 deletions specification/tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"name": "Collections"
},
{
"name": "Manifests"
"name": "Credentials"
},
{
"name": "MultiColliShipments"
"name": "Manifests"
},
{
"name": "PickupDropoffLocations"
Expand All @@ -16,8 +16,5 @@
},
{
"name": "Shipments"
},
{
"name": "ValidateCredentials"
}
]

0 comments on commit 69fbb78

Please sign in to comment.