Authentication
This endpoint requires authentication. Include a valid API Key in the request:
- Header:
x-api-key: YOUR_API_KEY
If you would like to apply for an API key, please contact api@shipmycar.co.uk
Get All Costs
This API endpoint calculates potential vehicle transportation costs, determines if a route is quotable, and provides a breakdown of costs where applicable. It handles various route types including UK domestic, UK-EU, EU-UK, and International routes, incorporating driving distance calculations, port lookups, database route checks, IVA / MOT Testing, DVLA registration, and tax estimations.
Endpoint
POST /api/getallcosts
API Tracking & Continue Quote Feature
All successful API calls are now tracked, and quotable responses include a unique URL that allows users to continue their quote on the ShipMyCar website with all data pre-filled.
Key Features:
- API Usage Tracking: All requests are logged with response times, status codes, and request/response data
- Continue Quote URL: Quotable responses include a
continueQuoteUrl
that takes users directly to the quote flow - 30-Day Validity: Continue URLs expire after 30 days for security
- Secure Access: Each URL includes a cryptographically secure token
- Pre-filled Data: All vehicle, route, and service information is automatically populated
When a quote is successful (quotable: true
), the response will include:
continueQuoteUrl
- Complete URL to continue the quoteapiLogId
- Unique identifier for this API callexpiresAt
- Expiration timestamp for the continue URLmetadata.canContinue
- Boolean flag indicating continuation is available
Note: The continue quote feature is only available for successful, quotable responses. Failed requests or non-quotable routes will not include these fields.
Request Body
The request body must be in JSON format (`Content-Type: application/json`).
Field | Type | Required | Max Len | Description | Example |
---|---|---|---|---|---|
vehicleYear | Number | Yes | N/A | The manufacturing year of the vehicle (e.g., YYYY). | 1966 |
vehicleMake | String | Yes | 100 | The make/manufacturer of the vehicle. | "Ford" |
vehicleModel | String | Yes | 100 | The model of the vehicle. | "Mustang" |
vehicleValue | Number | Yes | N/A | The estimated value of the vehicle (non-negative). | 10000 |
vehicleCurrency | String | Yes | 3 | The 3-letter ISO currency code for the `vehicleValue`. | "USD" |
collectionAddress | String | Yes | 250 | The full collection address. Must be specific enough for geocoding (e.g., include city/state/country). | "kansas, usa" |
deliveryAddress | String | Yes | 250 | The full delivery address. Must be specific enough for geocoding. | "cardiff, uk" |
collectionCountry | String | Yes | 100 | The country where collection occurs. Should match values recognised by the system (e.g., "United States"). | "United States" |
deliveryCountry | String | Yes | 100 | The country where delivery occurs. Should match values recognised by the system (e.g., "United Kingdom"). | "United Kingdom" |
targetCurrency | String | Yes | 3 | The 3-letter ISO currency code for the desired output currency. All cost values will be converted to this currency. | "GBP" |
Success Response (Status Code: 200 OK)
The response body will be in JSON format.
Field | Type | Description |
---|---|---|
quotable | Boolean | `true` if a price can be estimated (driving distance found OR valid port-to-port database route found), `false` otherwise. |
routeId | Number / Null | The internal ID of the database route used for port-based international routes. `null` for driving routes (UK/EU). |
closestOriginPort | Object / Null | Details of the closest origin port found for port-based routes. `null` for driving routes. Object format: `{ "id": String, "name": String, "countryCode": String, "coordinates": [Number, Number] }`. |
closestDestinationPort | Object / Null | Details of the closest destination port found for port-based routes. `null` for driving routes. Object format: `{ "id": String, "name": String, "countryCode": String, "coordinates": [Number, Number] }`. |
import_vat | Number | Estimated UK Import VAT based on vehicle value, age, and origin. Calculated only for quotable UK import routes (`eu-to-uk`, `international-to-uk`). `0` otherwise. |
import_duty | Number | Estimated UK Import Duty based on vehicle value, age, and origin. Calculated only for quotable UK import routes (`eu-to-uk`, `international-to-uk`). `0` otherwise. |
quoteCostItems | Array / Null | An array of detailed cost items that make up the quote. Includes shipping, handling, testing, registration etc. Each item contains details such as description, amount, VAT, and other attributes. `null` if an error occurred during item processing. |
totalFreightCost | Number | The total cost of all freight-related items (shipping, handling, transport) before taxes. |
totalRegCosts | Number | The total cost of all registration-related items (testing, DVLA fees, etc.) before taxes. |
totalCostExTaxes | Number | The total cost of all items excluding taxes (VAT, import duties). |
totalCost | Number | The grand total cost including all items and applicable taxes. |
finalCurrency | String | The 3-letter ISO currency code that all monetary values are expressed in. This will match the requested `targetCurrency`. |
exchangeRateToGBP | Number | The exchange rate used to convert between GBP and the `finalCurrency`. This is the rate of finalCurrency to 1 GBP. |
continueQuoteUrl | String | A URL that allows users to continue their quote on the ShipMyCar website with all data pre-filled. Only included for quotable responses. Valid for 30 days. |
apiLogId | String | Unique identifier for this API call. Only included for quotable responses. Used with the continue quote feature. |
expiresAt | String (ISO 8601) | The expiration date/time for the continue quote URL. After this time, the URL will no longer be valid. Only included for quotable responses. |
metadata | Object | Additional metadata about the calculation including routeType, serviceType, dvlaEngaged, calculationTime, itemCount, apiLogId, and canContinue flag. |
quoteCostItems
Object Structure
Field | Type | Description |
---|---|---|
quoteCostId | String / Number | Unique identifier for the cost item. May be a string ID or a numeric ID. |
description | String | Description of the cost item (may include route details, services provided, etc). |
amount | Number | The calculated amount for this specific line item (excluding VAT). |
vat | Number | The VAT amount specifically applied to this line item (if any). |
optional | Boolean | Whether this cost item is considered optional. |
orderKey | Number | A key used for sorting/ordering items in display. |
isFreightOption | Boolean | Whether this cost item is a freight option. |
isUnloadingCharge | Boolean | Whether this cost item relates to unloading charges. |
fullDesc | String / Null | A more detailed description of the service, may include HTML formatting. |
freightRelated | Boolean | Whether this cost item relates directly to freight charges (e.g., shipping, port fees) or to other services (e.g., testing, registration, admin). |
Error Responses
Status Code: 400 Bad Request
- Cause: Invalid JSON format in the request body OR missing/invalid required input parameters (e.g., address too long, non-numeric year).
- Response Body Example:
{ "error": "Missing or invalid required parameters.", "details": [ "Valid vehicleYear required.", "collectionAddress required and must be 250 chars or less.", "targetCurrency required and must be a valid 3-letter currency code." ] }
Status Code: 500 Internal Server Error
- Cause: An unexpected error occurred on the server during processing (e.g., database connection issue, failed geocoding for a valid-looking address, unhandled code error).
- Response Body Example:
{ "error": "An unexpected error occurred while processing your request.", "quotable": false, "routeId": null, "closestOriginPort": null, "closestDestinationPort": null, "transportCost": null, "distanceMiles": null, "import_vat": 0, "import_duty": 0, "quoteCostItems": null }
Examples
Example Request (US to UK with Classic Car)
{
"vehicleYear": 1966,
"vehicleMake": "Ford",
"vehicleModel": "Mustang",
"vehicleValue": 10000,
"vehicleCurrency": "USD",
"collectionAddress": "kansas, usa",
"deliveryAddress": "cardiff, uk",
"collectionCountry": "United States",
"deliveryCountry": "United Kingdom",
"targetCurrency": "GBP"
}
International to UK Response (US to UK with Classic Car)
{
"quotable": true,
"routeId": 2,
"closestOriginPort": {
"id": "2",
"name": "Houston",
"countryCode": "US",
"coordinates": [
-94.988122,
29.673089
]
},
"closestDestinationPort": {
"id": "5",
"name": "ShipMyCar UK Depot",
"countryCode": "GB",
"coordinates": [
-1.401047,
50.9242
]
},
"import_vat": 370.01,
"import_duty": 0,
"quoteCostItems": [
{
"description": "US Customs and Loading Fees",
"amount": 195,
"vat": 0,
"quoteCostId": 15,
"orderKey": 2,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"fullDesc": "We carry out all US customs paperwork on your behalf including and security checks<br/><br/>Our specially trained port operators will then carefully load your vehicle into a container and strap & chock so it will not move at all during transit",
"freightRelated": true
},
{
"description": "Port-to-Port Shipping (consolidated container)",
"amount": 1095,
"vat": 0,
"quoteCostId": 1479,
"orderKey": 3,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": true,
"fullDesc": "<p>This price is for a consolidated container, which means your vehicle will be in a container with another car. This is sometimes called 'shared' container shipment.<br /><br />This is a completely safe way of shipping, all cars are loaded into containers by our trained port operators and shipped using only shipping lines that specialise in vehicle shipments.<br /><br />Consolidated container shipments can take longer to clear US customs and to ship, therefore you can opt for your own 20ft container",
"freightRelated": true
},
{
"description": "HMRC Customs Clearance & NOVA Service",
"amount": 150,
"vat": 0,
"quoteCostId": "HMRC_CLEARANCE_NOVA",
"orderKey": 5,
"freightRelated": false
},
{
"description": "Fully Comprehensive Marine Insurance (450GBP excess)",
"amount": 200,
"vat": 0,
"quoteCostId": 29,
"orderKey": 6,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"fullDesc": "Our marine insurance policy covers any damage made during transit. ",
"freightRelated": true
},
{
"description": "UK Terminal Handling Charges",
"amount": 175,
"vat": 0,
"quoteCostId": 30,
"orderKey": 7,
"isFreightOption": false,
"isUnloadingCharge": true,
"optional": false,
"fullDesc": "<p>When the ship docks at the UK port, we have your container unloaded from the vessel and have to pay the terminal handling and shipping line charges to do so.</p>",
"freightRelated": true
},
{
"description": "Container Unloading, Customs Clearance and NOVA",
"amount": 245,
"vat": 0,
"quoteCostId": 32,
"orderKey": 8.05,
"isFreightOption": false,
"isUnloadingCharge": true,
"optional": false,
"fullDesc": "<p>Once container is unloaded from vessel we have to truck it to our unloading depot in Milton Keynes for unloading.</p>
<p>We then carry ou customs clearance and submit the vehicle to the HMRC NOVA system which is required for DVLA registration at a later date.</p>",
"freightRelated": true
},
{
"description": "Historic MOT Test Fee",
"amount": 54.85,
"vat": 0,
"quoteCostId": "MOT_TEST_HISTORIC",
"orderKey": 70,
"freightRelated": false
},
{
"description": "DVLA Registration Fee",
"amount": 55,
"vat": 0,
"quoteCostId": "DVLA_REG_FEE",
"orderKey": 80,
"freightRelated": false
},
{
"description": "Free Road Tax (Historic Vehicle)",
"amount": 0,
"vat": 0,
"quoteCostId": "ROAD_TAX_FREE_HISTORIC",
"orderKey": 85,
"freightRelated": false
},
{
"quoteCostId": "ROAD_TRANSPORT_UK_DB",
"description": "UK Road Transport - From: ShipMyCar, Tanners Drive, Milton Keynes, MK14 5BN, UK to Cardiff, Cardiff, Wales, United Kingdom",
"amount": 291.98,
"vat": 48.66,
"orderKey": 97,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"freightRelated": true
},
{
"description": "UK Number Plates",
"amount": 25,
"vat": 5,
"quoteCostId": "UK_NUMBER_PLATES",
"orderKey": 98,
"freightRelated": false
},
{
"description": "ShipMyCar Administration Fee",
"amount": 275,
"vat": 0,
"quoteCostId": 39,
"orderKey": 9999,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": true,
"fullDesc": "<p>This is a non refundable cost for all of our services</p>",
"freightRelated": false
},
{
"quoteCostId": "INT_ROAD_TRANSPORT_11_US",
"description": "Road Transport in US: From Kansas, United States to Houston ",
"amount": 1120.81,
"vat": 0,
"orderKey": 0,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"freightRelated": true
}
],
"totalFreightCost": 3322.79,
"totalRegCosts": 564.85,
"totalCostExTaxes": 3887.64,
"totalCost": 4257.65,
"finalCurrency": "GBP",
"exchangeRateToGBP": 1,
"continueQuoteUrl": "https://www.shipmycar.co.uk/continue-api-quote?apiId=123e4567-e89b-12d3-a456-426614174000&token=abc123def456",
"apiLogId": "123e4567-e89b-12d3-a456-426614174000",
"expiresAt": "2025-08-03T15:13:13.013Z",
"metadata": {
"routeType": "international-to-uk",
"serviceType": "car-shipping",
"dvlaEngaged": true,
"calculationTime": "2025-07-03T15:13:13.013Z",
"itemCount": 13,
"apiLogId": "123e4567-e89b-12d3-a456-426614174000",
"canContinue": true
}
}
UK to UK Domestic Transport Response
Request example: Tesla Model 3 from Manchester to Cardiff
{
"quotable": true,
"routeId": null,
"closestOriginPort": null,
"closestDestinationPort": null,
"import_vat": 0,
"import_duty": 0,
"quoteCostItems": [
{
"quoteCostId": "ROAD_TRANSPORT_UK_DB",
"description": "UK Road Transport - From: Manchester, Greater Manchester, England, United Kingdom to Cardiff, Cardiff, Wales, United Kingdom ",
"amount": 377.42,
"vat": 62.9,
"orderKey": 10,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"freightRelated": true
}
],
"totalFreightCost": 377.42,
"totalRegCosts": 0,
"totalCostExTaxes": 377.42,
"totalCost": 377.42,
"finalCurrency": "GBP",
"exchangeRateToGBP": 1,
"continueQuoteUrl": "https://www.shipmycar.co.uk/continue-api-quote?apiId=456e7890-b12c-34d5-e678-901234567890&token=def789ghi012",
"apiLogId": "456e7890-b12c-34d5-e678-901234567890",
"expiresAt": "2025-08-03T16:00:00.000Z",
"metadata": {
"routeType": "uk-to-uk",
"serviceType": "car-shipping",
"dvlaEngaged": false,
"calculationTime": "2025-07-03T16:00:00.000Z",
"itemCount": 1,
"apiLogId": "456e7890-b12c-34d5-e678-901234567890",
"canContinue": true
}
}
UK Export to International Response
Request example: Land Rover Defender from Cardiff to Kansas, USA
{
"quotable": true,
"routeId": 28,
"closestOriginPort": {
"id": "5",
"name": "ShipMyCar UK Depot",
"countryCode": "GB",
"coordinates": [
-1.401047,
50.9242
]
},
"closestDestinationPort": {
"id": "2",
"name": "Houston",
"countryCode": "US",
"coordinates": [
-94.988122,
29.673089
]
},
"import_vat": 0,
"import_duty": 0,
"quoteCostItems": [
{
"quoteCostId": "ROAD_TRANSPORT_UK_DB",
"description": "UK Collection & Transport to ShipMyCar UK Depot",
"amount": 272.32,
"vat": 45.39,
"orderKey": 1,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"freightRelated": true
},
{
"description": "Customs Clearance and Loading",
"amount": 150,
"vat": 0,
"quoteCostId": 11229,
"orderKey": 2,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"fullDesc": "Vehicle will be loaded onto vessel, and secured ready for shipping.<br/><br/>All export paperwork carried out on your behalf",
"freightRelated": false
},
{
"description": "Port-to-Port Shipping (consolidated container)",
"amount": 1695,
"vat": 0,
"quoteCostId": 11222,
"orderKey": 3,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"fullDesc": "<p>Your vehicle will be loaded into a shared container using R-Raks - this is a very safe method of shipping",
"freightRelated": true
},
{
"description": "Fully Comprehensive Marine Insurance (450GBP excess)",
"amount": 500,
"vat": 0,
"quoteCostId": 11223,
"orderKey": 4,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"fullDesc": "Our marine policy is fully comprehensive and charged at a competitive rate",
"freightRelated": true
},
{
"quoteCostId": "INT_ROAD_TRANSPORT_11_US",
"description": "Road Transport in US: From Houston to Kansas, United States ",
"amount": 1119.75,
"vat": 0,
"orderKey": 95,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"freightRelated": true
},
{
"description": "**Arrival Charges and any applicable import tax / duties are not included in this estimate - please contact us for further information **",
"amount": 0,
"vat": 0,
"quoteCostId": 3552574,
"orderKey": 1000,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": false,
"fullDesc": null,
"freightRelated": false
},
{
"description": "ShipMyCar Administration Fee",
"amount": 275,
"vat": 0,
"quoteCostId": 39,
"orderKey": 9999,
"isFreightOption": false,
"isUnloadingCharge": false,
"optional": true,
"fullDesc": "<p>This is a non refundable cost for all of our services</p>",
"freightRelated": false
}
],
"totalFreightCost": 3587.07,
"totalRegCosts": 425,
"totalCostExTaxes": 4012.07,
"totalCost": 4012.07,
"finalCurrency": "GBP",
"exchangeRateToGBP": 1
}
UK to EU Transport Response
Request example: Tesla Model 3 from Cardiff to Paris
{
"quotable": true,
"routeId": null,
"closestOriginPort": null,
"closestDestinationPort": null,
"import_vat": 0,
"import_duty": 0,
"quoteCostItems": [
{
"description": "Fully Insured Road Transport by open transport from Cardiff, Cardiff, Wales, United Kingdom to Paris, France.<br>Includes all EU export clearances and UK Customs Clearance and NOVA.<br>Excludes any applicable import tax/duty.",
"amount": 2530.9,
"vat": 0,
"quoteCostId": "EU_TRANSPORT_COMBINED_10_2",
"orderKey": 10,
"freightRelated": true
}
],
"totalFreightCost": 2530.9,
"totalRegCosts": 0,
"totalCostExTaxes": 2530.9,
"totalCost": 2530.9,
"finalCurrency": "GBP",
"exchangeRateToGBP": 1
}
EU to UK Transport Response
Request example: Tesla Model 3 from Paris to Cardiff
{
"quotable": true,
"routeId": null,
"closestOriginPort": null,
"closestDestinationPort": null,
"import_vat": 5000,
"import_duty": 0,
"quoteCostItems": [
{
"description": "Fully Insured Road Transport by open transport from Paris, France to Cardiff, Cardiff, Wales, United Kingdom.<br>Includes all EU export and UK import clearances.<br>Excludes any applicable import tax/duty which is quoted separately.",
"amount": 2540.5,
"vat": 0,
"quoteCostId": "EU_TRANSPORT_COMBINED_10_1",
"orderKey": 10,
"freightRelated": true
}
],
"totalFreightCost": 2540.5,
"totalRegCosts": 0,
"totalCostExTaxes": 2540.5,
"totalCost": 7540.5,
"finalCurrency": "GBP",
"exchangeRateToGBP": 1
}
Error Response (400 Bad Request - Invalid Parameters)
{
"error": "Missing or invalid required parameters.",
"details": [
"Valid vehicleYear required.",
"collectionAddress required and must be 250 chars or less.",
"targetCurrency required and must be a valid 3-letter currency code."
]
}
Error Response (500 Server Error)
{
"error": "An unexpected error occurred while processing your request.",
"quotable": false,
"routeId": null,
"closestOriginPort": null,
"closestDestinationPort": null,
"transportCost": null,
"distanceMiles": null,
"import_vat": 0,
"import_duty": 0,
"quoteCostItems": null
}
Using the Continue Quote URL
When you receive a successful response with quotable: true
, you can use the continueQuoteUrl
to allow users to continue their quote on the ShipMyCar website:
// Example: After receiving API response
const response = await fetch('https://www.shipmycar.co.uk/api/getallcosts', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify(requestData)
});
const data = await response.json();
if (data.quotable && data.continueQuoteUrl) {
// Option 1: Direct user to continue their quote
window.location.href = data.continueQuoteUrl;
// Option 2: Display as a link
console.log('Continue your quote at:', data.continueQuoteUrl);
// Option 3: Store for later use (valid for 30 days)
localStorage.setItem('continueQuoteUrl', data.continueQuoteUrl);
localStorage.setItem('quoteExpiresAt', data.expiresAt);
}
The continue quote URL will automatically:
- Load all the quote data from the API call
- Pre-populate vehicle details, addresses, and service selections
- Route the user to the appropriate step in the quote flow
- Allow the user to complete their quote and make a booking