You are on page 1of 29

Shipment API Documentation

Overview

The Shipment API provides a comprehensive set of features for managing shipping
operations, including:

 Get Rates

o Obtain shipping quotes for various carriers and services.

 Booking

o Book shipments and generate shipping labels.

 Cancel Shipping

o Cancel shipments that have not yet been processed.

 Re-Print

o Generate new shipping labels for existing shipments.

Prerequisites

Note: Before using the APIs, consider the following Account Number conditions based on the
Despatch Company specified in each API request:

 For DHL, use Account Number: 185282707 (Refer cms_ConfigurationSettings table)

SELECT * FROM cms_ConfigurationSettings WHERE SettingKey = 'DhlShipments'


 For FedEx:
a. In GetRates API, use Account Number (Prod): 426282046.
b. For Booking and Cancel Shipping APIs, use Account Number (Test): 802255209
(Retrieve from FedExAccountDetails).

SELECT AccountNumber, IsTestAccount, ContactName,WebserviceMeterNumber FROM


FedExAccountDetails WHERE WebserviceMeterNumber IS NULL

FYI: Kindly refrain from using the Production Account Number for any APIs other than the Get
Rates API; it should be exclusively utilized for that purpose.

Note: Despatch Company Parameter Values

For all API calls within this documentation, the following values apply to the
"despatch_company" parameter:

Despatch Company Parameter Values

AmazonShipping 0

DHL 1

FedEx 2

Parcelforce 3

Royalmail 4

Yamato 5

DhlParcelUk 6
Get Rates API

HTTP Request Method: POST

Endpoint URI: https://shipmentapivega.rockycloud.co.uk/api/courier/get-rate

Pre-Sample Request Information:

The Get Rates API allows you to retrieve shipping rates for a specific order. To use this API, you
will need to provide the following information:

 Despatch Company: Specify the shipping company you want to use. Set this value to the
corresponding despatch company code (e.g., 1 for DHL).
 Order ID: Provide the unique identifier of the order for which you want to calculate shipping
rates. Determine the order ID based on the specified SQL query if want to use existing data.

SELECT OrderId, ShippingCompanyName


FROM DespatchOrderDetails
WHERE id NOT IN (SELECT DespatchOrderDetailId FROM CancelledDespatchDetails)
ORDER BY 1 DESC

 Account Number: Obtain the account number according to the mentioned prerequisites.
 Origin Address: Enter the complete address from which the shipment will originate.
 Destination Address: Provide the complete address to which the shipment will be delivered.
 Parcel Details: Specify the dimensions, weight, and packaging material of the parcel to be
shipped.
Make sure to customize these values according to your specific needs for an accurate and
successful API request.

Sample API Request (Considering despatch_company “DHL”)

{
"header": {
"entityType": "Shipping",
"entityId": "2651851",
"entityAction": "GetRate",
"source": "FedEx"
},
"payload": {
"despatch_company": 1,
"order_id": 2808410,
"account_number": "185282707",
"collection_date": "2023-07-31T09:06:38.620Z",
"is_saturday_delivery": false,
"parcels": [
{
"weight": 10,
"dim_height": 10,
"dim_width": 10,
"dim_length": 10
}
],
"ship_from": {
"post_code": "NW107SU",
"city": "LONDON",
"country_code": "GB"
},
"ship_to": {
"post_code": "NG250AL",
"city": "Southwell",
"country_code": "GB"
},
"is_canary_islands": true,
"destination": "UK",
"shipping_products": [
"N",
"I",
"1"
],
"is_customer_country_eu": false,
"delivery_country_id": 1,
"is_test_mode": false,
"log_all_request_response_objects": true
}
}
Sample Response

{
"statusMessage": {
"status": 0,
"message": null
},
"payload": {
"services": [
{
"service_code": "1",
"service_name": "EXPRESS DOMESTIC 12:00",
"volumetric_weight": 0.2,
"quoted_weight": 10.0,
"delivery": {
"day": null,
"time": "2023-11-24T12:00:00"
},
"charges": [
{
"type": "TotalNet",
"amount": 16.15,
"description": null,
"currency": "GBP"
}
],
"surcharges": [
{
"type": "EXPRESS DOMESTIC 12:00",
"amount": 8.52,
"description": null,
"currency": "GBP"
},
{
"type": "12:00 PREMIUM",
"amount": 6.0,
"description": null,
"currency": "GBP"
},
{
"type": "FUEL SURCHARGE",
"amount": 4.86,
"description": null,
"currency": "GBP"
}
],
"taxes": null
},
{
"service_code": "N",
"service_name": "EXPRESS DOMESTIC",
"volumetric_weight": 0.2,
"quoted_weight": 10.0,
"delivery": {
"day": null,
"time": "2023-11-24T23:59:00"
},
"charges": [
{
"type": "TotalNet",
"amount": 8.47,
"description": null,
"currency": "GBP"
}
],
"surcharges": [
{
"type": "EXPRESS DOMESTIC",
"amount": 8.52,
"description": null,
"currency": "GBP"
},
{
"type": "FUEL SURCHARGE",
"amount": 1.64,
"description": null,
"currency": "GBP"
}
],
"taxes": null
}
],
"cms_quotes": [
{
"price": 4.48,
"courierName": "Amazon Ship 24",
"weight": 10.0,
"transitTime": "1",
"logo": "https://static.contrado.com/despatch/48-pathicon.png",
"remoteAreaText": "",
"remoteSurcharge": 0.0,
"isRemoteArea": false,
"note": null,
"courierFees": 0.0,
"courierId": 23,
"addCourierFeesToLiveQuote": false,
"packageName": "Own Packaging",
"remoteAreaSurcharge": {
"chargeName": "Remote Surcharge(Excluded from Total)",
"amount": 0.0,
"addToLiveQuote": false
},
"fuelSurcharge": {
"chargeName": "Fuel Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"customSurcharge": {
"chargeName": "Custom Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"courierSurcharges": [],
"royalMailSurcharge": null,
"dimensionSurcharge": {
"chargeName": "Dim Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"serviceCode": null,
"serviceName": null
},
{
"price": 6.58,
"courierName": "DHLPUK",
"weight": 10.0,
"transitTime": "",
"logo": null,
"remoteAreaText": "",
"remoteSurcharge": 0.0,
"isRemoteArea": false,
"note": null,
"courierFees": 0.0,
"courierId": 25,
"addCourierFeesToLiveQuote": false,
"packageName": "Own Packaging",
"remoteAreaSurcharge": {
"chargeName": "Remote Surcharge(Excluded from Total)",
"amount": 0.0,
"addToLiveQuote": false
},
"fuelSurcharge": {
"chargeName": "Fuel Surcharge",
"amount": 0.83375,
"addToLiveQuote": false
},
"customSurcharge": {
"chargeName": "Custom Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"courierSurcharges": [],
"royalMailSurcharge": null,
"dimensionSurcharge": {
"chargeName": "Dim Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"serviceCode": null,
"serviceName": null
},
{
"price": 8.12,
"courierName": "FedEx UK",
"weight": 10.0,
"transitTime": "",
"logo": "https://static.contrado.com/despatch/30-pathicon.jpg",
"remoteAreaText": "",
"remoteSurcharge": 0.0,
"isRemoteArea": false,
"note": null,
"courierFees": 0.0,
"courierId": 16,
"addCourierFeesToLiveQuote": false,
"packageName": "Own Packaging",
"remoteAreaSurcharge": {
"chargeName": "Remote Surcharge(Excluded from Total)",
"amount": 0.0,
"addToLiveQuote": false
},
"fuelSurcharge": {
"chargeName": "Fuel Surcharge",
"amount": 1.12,
"addToLiveQuote": false
},
"customSurcharge": {
"chargeName": "Custom Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"courierSurcharges": [],
"royalMailSurcharge": null,
"dimensionSurcharge": {
"chargeName": "Dim Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"serviceCode": null,
"serviceName": null
},
{
"price": 8.40,
"courierName": "DHL Domestic",
"weight": 10.0,
"transitTime": "",
"logo": "https://static.contrado.com/despatch/20-pathicon.gif",
"remoteAreaText": "",
"remoteSurcharge": 12.0,
"isRemoteArea": false,
"note": null,
"courierFees": 0.0,
"courierId": 15,
"addCourierFeesToLiveQuote": false,
"packageName": "Own Packaging",
"remoteAreaSurcharge": {
"chargeName": "Remote Surcharge(Excluded from Total)",
"amount": 12.0,
"addToLiveQuote": false
},
"fuelSurcharge": {
"chargeName": "Fuel Surcharge",
"amount": 1.29575,
"addToLiveQuote": false
},
"customSurcharge": {
"chargeName": "Custom Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"courierSurcharges": [],
"royalMailSurcharge": null,
"dimensionSurcharge": {
"chargeName": "Dim Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"serviceCode": null,
"serviceName": null
},
{
"price": 10.83,
"courierName": "DHLPUK Pre12",
"weight": 10.0,
"transitTime": "",
"logo": null,
"remoteAreaText": "",
"remoteSurcharge": 0.0,
"isRemoteArea": false,
"note": null,
"courierFees": 0.0,
"courierId": 26,
"addCourierFeesToLiveQuote": false,
"packageName": "Own Packaging",
"remoteAreaSurcharge": {
"chargeName": "Remote Surcharge(Excluded from Total)",
"amount": 0.0,
"addToLiveQuote": false
},
"fuelSurcharge": {
"chargeName": "Fuel Surcharge",
"amount": 1.3717,
"addToLiveQuote": false
},
"customSurcharge": {
"chargeName": "Custom Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"courierSurcharges": [],
"royalMailSurcharge": null,
"dimensionSurcharge": {
"chargeName": "Dim Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"serviceCode": null,
"serviceName": null
},
{
"price": 15.08,
"courierName": "DHLPUK Sat",
"weight": 10.0,
"transitTime": "",
"logo": null,
"remoteAreaText": "",
"remoteSurcharge": 0.0,
"isRemoteArea": false,
"note": null,
"courierFees": 0.0,
"courierId": 27,
"addCourierFeesToLiveQuote": false,
"packageName": "Own Packaging",
"remoteAreaSurcharge": {
"chargeName": "Remote Surcharge(Excluded from Total)",
"amount": 0.0,
"addToLiveQuote": false
},
"fuelSurcharge": {
"chargeName": "Fuel Surcharge",
"amount": 1.90965,
"addToLiveQuote": false
},
"customSurcharge": {
"chargeName": "Custom Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"courierSurcharges": [],
"royalMailSurcharge": null,
"dimensionSurcharge": {
"chargeName": "Dim Surcharge",
"amount": 0.0,
"addToLiveQuote": false
},
"serviceCode": null,
"serviceName": null
}
],
"status_message": {
"status": 0,
"message": null
}
}
}

Tip: Similar API requests can be made for FedEx (or for any other despatch companies) by
changing relevant parameter values.
Booking API

HTTP Request Method: POST

Endpoint URL: https://shipmentapivega.rockycloud.co.uk/api/courier/book

Pre-Sample Request Information:

The Booking API enables you to book a shipment with the selected shipping company. To utilize
this API, you will need to provide the following details:

 Despatch Company: Specify the shipping company you want to use. Set this value to the
corresponding despatch company code (e.g., 1 for DHL)
 Order ID: Provide the unique identifier of the order you want to book.( Retrieve a specific
order based on certain criteria, such as order status – In Progress, absence in nonFreeOrders,
and specific conditions related to DespatchCompany and DeliveryCompanyID)
 Parcels: Include information about the parcels to be shipped, including dimensions, weight,
packing material, and description.
 Ship From: Specify the complete address from which the shipment will originate.
 Ship To: Provide the complete address to which the shipment will be delivered.
 Service Code: Select the appropriate service code for the desired shipping method.
 Is Saturday Delivery: Indicate whether Saturday delivery is required.
 Is Paperless Trade: Specify whether the shipment requires paperless trade documentation.
 Account Number: Obtain the account number according to the mentioned prerequisites.
 Order Value: Enter the total value of the order.
 Collection Date: Specify the desired date for the shipment's collection.
 Shipment Purpose: Briefly describe the purpose of the shipment.
 Custom Value: Provide the customs value of the shipment.
 Taxes Payable By: Indicate who is responsible for paying taxes (Sender or Receiver).
 Is Commercial Invoice Required: Specify whether a commercial invoice is required.
 Label Print Type: Select the preferred label print type (Laser or Thermal).
 Commodities: Provide details about the commodities being shipped, including name,
description, unit of measure, quantity, weight, country of manufacture, HS code, unit price,
custom value, and currency code.
Make sure to customize these values according to your specific needs for an accurate and
successful API request.

Sample API Request (Considering despatch_company “FedEx”)

{
"header": {
"entityType": "Shipping",
"entityId": "2808618",
"entityAction": "Booking",
"source": "Dhl-FedEx"
},
"payload": {
"despatch_company": 2,
"order_id": "2808618",
"parcels": [
{
"description": "",
"packing_material": "YOUR_PACKAGING",
"weight": 5.0,
"dim_height": 5.0,
"dim_width": 40.0,
"dim_length": 50.0
}
],
"ship_from": {
"name": "REST API Test",
"company_name": "Contrado Imaging Ltd",
"phone": "02089604567",
"mobile": "",
"email": "",
"address_1": "Unit 7",
"address_2": " Space Business Park",
"address_3": " Abbey Road",
"post_code": "NW107SU",
"town": "",
"city": "London",
"state": "",
"country_code": "GB",
"country_name": "",
"tin_number": "809656889000"
},
"ship_to": {
"name": "Fred Aldous Ltd",
"company_name": "FRED ALDOUS LTD",
"phone": "1234567890",
"mobile": "",
"email": "2633249@contrado1.co.uk",
"address_1": "masked",
"address_2": "masked",
"address_3": "",
"post_code": "NG25 0AL",
"town": "",
"city": "Southwell",
"state": "",
"country_code": "GB",
"country_name": "",
"tin_number": ""
},
"service_code": "FEDEX_NEXT_DAY_END_OF_DAY",
"is_saturday_delivery": false,
"is_paperless_trade": false,
"account_number": "802255209",
"order_value": 639.76,
"collection_date": "2023-07-04T00:00:00Z",
"shipment_purpose": "",
"custom_value": 639.76,
"taxes_payable_by": "Sender",
"is_commercial_invoice_required": false,
"label_print_type": "Laser",
"commodities": [
{
"name": "",
"description": null,
"unit_of_measure": "EA",
"quantity": 1,
"weight": 5.0,
"country_of_manufacture": "GB",
"hs_code": "",
"unit_price_amount": 639.76,
"custom_value_amount": 639.76,
"currency_code": "UKL"
},
{
"name": "Tea Towels",
"description": null,
"unit_of_measure": "",
"quantity": 4,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "63029100",
"unit_price_amount": 5.85,
"custom_value_amount": 23.4,
"currency_code": "UKL"
},
{
"name": "Tea Towels",
"description": null,
"unit_of_measure": "",
"quantity": 18,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "63029100",
"unit_price_amount": 5.85,
"custom_value_amount": 105.3,
"currency_code": "UKL"
},
{
"name": "Tea Towels",
"description": null,
"unit_of_measure": "",
"quantity": 8,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "63029100",
"unit_price_amount": 5.85,
"custom_value_amount": 46.8,
"currency_code": "UKL"
},
{
"name": "Tea Towels",
"description": null,
"unit_of_measure": "",
"quantity": 13,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "63029100",
"unit_price_amount": 5.85,
"custom_value_amount": 76.05,
"currency_code": "UKL"
},
{
"name": "Tea Towels",
"description": null,
"unit_of_measure": "",
"quantity": 13,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "63029100",
"unit_price_amount": 5.85,
"custom_value_amount": 76.05,
"currency_code": "UKL"
},
{
"name": "Socks",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "61159699",
"unit_price_amount": 6.36,
"custom_value_amount": 6.36,
"currency_code": "UKL"
},
{
"name": "Parachute Shopping Bag",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "42029291",
"unit_price_amount": 10.2,
"custom_value_amount": 10.2,
"currency_code": "UKL"
},
{
"name": "Mens Tracksuit Jacket",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "61033300",
"unit_price_amount": 67.8,
"custom_value_amount": 67.8,
"currency_code": "UKL"
},
{
"name": "Parachute Shopping Bag",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "42029291",
"unit_price_amount": 10.2,
"custom_value_amount": 10.2,
"currency_code": "UKL"
},
{
"name": "Parachute Shopping Bag",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "42029291",
"unit_price_amount": 10.2,
"custom_value_amount": 10.2,
"currency_code": "UKL"
},
{
"name": "Mens Tracksuit Trousers",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "61034300",
"unit_price_amount": 64.2,
"custom_value_amount": 64.2,
"currency_code": "UKL"
},
{
"name": "Cushions",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "94049090",
"unit_price_amount": 18.6,
"custom_value_amount": 18.6,
"currency_code": "UKL"
},
{
"name": "Jigsaw Puzzle",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "95030069",
"unit_price_amount": 11.88,
"custom_value_amount": 11.88,
"currency_code": "UKL"
},
{
"name": "Hoodie",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "61103091",
"unit_price_amount": 64.8,
"custom_value_amount": 64.8,
"currency_code": "UKL"
},
{
"name": "Socks",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "61159699",
"unit_price_amount": 6.36,
"custom_value_amount": 6.36,
"currency_code": "UKL"
},
{
"name": "Yoga Mat",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "40169100",
"unit_price_amount": 34.4,
"custom_value_amount": 34.4,
"currency_code": "UKL"
},
{
"name": "Single Layer Blankets",
"description": null,
"unit_of_measure": "",
"quantity": 1,
"weight": 0.01,
"country_of_manufacture": "GB",
"hs_code": "63014090",
"unit_price_amount": 7.16,
"custom_value_amount": 7.16,
"currency_code": "UKL"
}
],
"is_customer_country_eu": true,
"line_items": [
{
"product_commodity_description": "100% Cotton Tea-towel (Cotton-Linen, Standard
Edge, Portrait, No Label)",
"quantity": 4,
"value": 0.0,
"hs_code": "63029100",
"product_name": "Tea Towels",
"line_items_count": 0,
"line_sub_total": 640,
"price": 23.4,
"job_id": 12639402,
"job_number": "TT12639402",
"product_id": 315
},
{
"product_commodity_description": "100% Cotton Tea-towel (Cotton-Linen, Standard
Edge, Portrait, No Label)",
"quantity": 18,
"value": 0.0,
"hs_code": "63029100",
"product_name": "Tea Towels",
"line_items_count": 0,
"line_sub_total": 640,
"price": 105.3,
"job_id": 12639403,
"job_number": "TT12639403",
"product_id": 315
},
{
"product_commodity_description": "100% Cotton Tea-towel (Cotton-Linen, Standard
Edge, Portrait, No Label)",
"quantity": 8,
"value": 0.0,
"hs_code": "63029100",
"product_name": "Tea Towels",
"line_items_count": 0,
"line_sub_total": 640,
"price": 46.8,
"job_id": 12639404,
"job_number": "TT12639404",
"product_id": 315
},
{
"product_commodity_description": "100% Cotton Tea-towel (Cotton-Linen, Standard
Edge, Portrait, No Label)",
"quantity": 13,
"value": 0.0,
"hs_code": "63029100",
"product_name": "Tea Towels",
"line_items_count": 0,
"line_sub_total": 640,
"price": 76.05,
"job_id": 12639405,
"job_number": "TT12639405",
"product_id": 315
},
{
"product_commodity_description": "100% Cotton Tea-towel (Cotton-Linen, Standard
Edge, Portrait, No Label)",
"quantity": 13,
"value": 0.0,
"hs_code": "63029100",
"product_name": "Tea Towels",
"line_items_count": 0,
"line_sub_total": 640,
"price": 76.05,
"job_id": 12639406,
"job_number": "TT12639406",
"product_id": 315
},
{
"product_commodity_description": "polyester Socks (6.5-9UK Medium)",
"quantity": 1,
"value": 0.0,
"hs_code": "61159699",
"product_name": "Socks",
"line_items_count": 0,
"line_sub_total": 640,
"price": 6.36,
"job_id": 12639417,
"job_number": "SK12639417",
"product_id": 1546
},
{
"product_commodity_description": "Polyester Bag (Your Custom label, White)",
"quantity": 1,
"value": 0.0,
"hs_code": "42029291",
"product_name": "Parachute Shopping Bag",
"line_items_count": 0,
"line_sub_total": 640,
"price": 10.2,
"job_id": 12639445,
"job_number": "RUSB12639445",
"product_id": 3049
},
{
"product_commodity_description": "Men's knitted polyester jacket (White, Your
Custom label, M, Black)",
"quantity": 1,
"value": 0.0,
"hs_code": "61033300",
"product_name": "Mens Tracksuit Jacket",
"line_items_count": 0,
"line_sub_total": 640,
"price": 67.8,
"job_id": 12639458,
"job_number": "MTJ12639458",
"product_id": 3021
},
{
"product_commodity_description": "Polyester Bag (Your Custom label, White)",
"quantity": 1,
"value": 0.0,
"hs_code": "42029291",
"product_name": "Parachute Shopping Bag",
"line_items_count": 0,
"line_sub_total": 640,
"price": 10.2,
"job_id": 12639501,
"job_number": "RUSB12639501",
"product_id": 3049
},
{
"product_commodity_description": "Polyester Bag (Your Custom label, Black)",
"quantity": 1,
"value": 0.0,
"hs_code": "42029291",
"product_name": "Parachute Shopping Bag",
"line_items_count": 0,
"line_sub_total": 640,
"price": 10.2,
"job_id": 12639502,
"job_number": "RUSB12639502",
"product_id": 3049
},
{
"product_commodity_description": "Polyester Men's jogging pants (Your Custom
label, M, Black)",
"quantity": 1,
"value": 0.0,
"hs_code": "61034300",
"product_name": "Mens Tracksuit Trousers",
"line_items_count": 0,
"line_sub_total": 640,
"price": 64.2,
"job_id": 12639510,
"job_number": "MTT12639510",
"product_id": 3013
},
{
"product_commodity_description": "100% polyester cushion with woven 95% cotton
5% linen. (Square 40cm (16\"), Just the cover no Pad required, Print back as well, Plain
gold zip, Cotton-Linen, Your Custom label, No Piping)",
"quantity": 1,
"value": 0.0,
"hs_code": "94049090",
"product_name": "Cushions",
"line_items_count": 0,
"line_sub_total": 640,
"price": 18.6,
"job_id": 12639539,
"job_number": "U12639539",
"product_id": 30
},
{
"product_commodity_description": "puzzle (500 piece - 13 x 18.5” Cardboard,
Printed Tin, Portrait)",
"quantity": 1,
"value": 0.0,
"hs_code": "95030069",
"product_name": "Jigsaw Puzzle",
"line_items_count": 0,
"line_sub_total": 640,
"price": 11.88,
"job_id": 12639553,
"job_number": "J12639553",
"product_id": 43
},
{
"product_commodity_description": "Unisex knitted polyester Hoodie (Black, M,
Zipper Hoodie, Black Zip, Your Custom label)",
"quantity": 1,
"value": 0.0,
"hs_code": "61103091",
"product_name": "Hoodie",
"line_items_count": 0,
"line_sub_total": 640,
"price": 64.8,
"job_id": 12639568,
"job_number": "HD12639568",
"product_id": 1672
},
{
"product_commodity_description": "polyester Socks (6.5-9UK Medium)",
"quantity": 1,
"value": 0.0,
"hs_code": "61159699",
"product_name": "Socks",
"line_items_count": 0,
"line_sub_total": 640,
"price": 6.36,
"job_id": 12639576,
"job_number": "SK12639576",
"product_id": 1546
},
{
"product_commodity_description": "yoga rubber mat (Black)",
"quantity": 1,
"value": 0.0,
"hs_code": "40169100",
"product_name": "Yoga Mat",
"line_items_count": 0,
"line_sub_total": 640,
"price": 34.4,
"job_id": 12639605,
"job_number": "YOG12639605",
"product_id": 1700
},
{
"product_commodity_description": "Polyester blanket (Small 100x75cm 39x29\",
Charcoal, Portrait, No Label Leave Plain)",
"quantity": 1,
"value": 0.0,
"hs_code": "63014090",
"product_name": "Single Layer Blankets",
"line_items_count": 0,
"line_sub_total": 640,
"price": 7.16,
"job_id": 12639609,
"job_number": "KCUT12639609",
"product_id": 2787
}
],
"document_images": [],
"custom_documents": [],
"is_canary_islands": false,
"incoterm_description": "DDP–Delivered Duty Paid",
"track_and_logs": {
"application_product_name": "FedExShippingSystem",
"login_username": "ADRIANA BUCIUMAN",
"login_user_rfid": "10668243",
"packing_username": "10668243",
"packing_user_rfid": "",
"eori": "",
"order_postage": 24.49,
"order_site_name": "ContradoUK",
"order_site_currency_code": "GBP",
"invoice_path": "",
"service_code_name": "",
"delivery_company_id": "30",
"machine_name": "DEV023IN",
"tm_staff_id": "4715",
"tm_department_id": "28",
"ip_address": "10.20.7.103",
"customer_id": 2633249
},
"destination": "",
"export_reason": "Sale",
"seller_info": {
"name": "",
"email": "",
"store_name": "",
"phone": ""
},
"delivery_or_billing_country_id": 1,
"packing_reference": "010668243",
"selected_service": {
"service_code": "FEDEX_NEXT_DAY_END_OF_DAY",
"service_name": "FedEx® Next Day",
"volumetric_weight": 0.0,
"quoted_weight": 5.0,
"delivery": {
"day": "WED",
"time": "2023-07-05T18:00:00Z"
},
"charges": [
{
"type": "TotalBase",
"amount": 19.4,
"description": "",
"currency": "UKL"
},
{
"type": "TotalNet",
"amount": 14.66,
"description": "",
"currency": "UKL"
}
],
"surcharges": [
{
"type": "FUEL",
"amount": 1.71,
"description": "Fuel Surcharge",
"currency": "UKL"
}
],
"taxes": [
{
"type": "VAT",
"amount": 2.44,
"description": "United Kingdom VAT",
"currency": "UKL"
}
]
},
"set_custom_invoice": false,
"print_stock_type": "",
"insured_value": 0.0,
"create_invoice": true,
"custom_account_number": "700636402",
"manufacturer_code": "GBCONIMA7LON",
"add_taxes_or_miscellaneous_charge": false,
"import_duty": 0.0,
"email_customer_name_trans": "Fred Aldous Ltd",
"is_test_mode": true,
"log_all_request_response_objects": true
}
}

Sample Response

{
"statusMessage": {
"status": 0,
"message": null
},
"payload": {
"shipment_ids": [
"004d57ad-81b2-47a4-84b9-08330fe5ae23"
],
"tracking_codes": [
"794685339750"
],
"labels": [
{
"format": "PDF",
"image": "JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwov...",
"type": "LABEL",
"tracking_number": "794685339750",
"master_tracking_number": null
}
],
"uri": null,
"status_message": {
"status": 0,
"message": null
},
"form_id": "0850"
}
}

Tip: Similar API requests can be made for DHL (or for any other despatch companies) by
changing relevant parameter values.
Cancel Shipping API

HTTP Request Method: POST

Endpoint URI: https://shipmentapivega.rockycloud.co.uk/api/courier/cancel

Pre-Sample Request Information:

The Cancel Shipping API allows you to cancel a pending shipment. To utilize this API, you will
need to provide the following information:

 Despatch Company: Specify the shipping company you want to use. Set this value to the
corresponding despatch company code (e.g., 1 for DHL)
 Order ID: Provide the unique identifier of the order containing the shipment you want to
cancel. Determine the order ID based on the specified SQL query.

SELECT TOP 500


OrderId,
ShippingCompanyName,
AccountNumber
FROM
DespatchOrderDetails
WHERE
Id NOT IN (SELECT DespatchOrderDetailId FROM CancelledDespatchDetails)
AND ShippingCompanyName LIKE 'dhl%'
ORDER BY
OrderId DESC;

 Account Number: Obtain the account number according to the mentioned prerequisites.
Make sure to customize these values according to your specific needs for an accurate and
successful API request.

Sample API Request (Considering despatch_company “DHL”)

{
"header": {
"entityType": "Shipping",
"entityId": "2805583",
"entityAction": "Cancel",
"source": "Dhl"
},
"payload": {
"despatch_company": 1,
"order_id": 2805583,
"account_number": "802255209",
"tracking_number": "",
"login_username": "TEST",
"login_user_rfid": "123",
"is_test_mode": true,
"log_all_request_response_objects": true
}
}

Sample Response

{
"statusMessage": {
"status": 0,
"message": "Success"
},
"payload": {
"status_message": {
"status": 0,
"message": "Success"
}
}
}

Tip: Similar API requests can be made for FedEx (or for any other despatch companies) by
changing relevant parameter values.
Re-Print API

HTTP Request Method: POST

Endpoint URI: https://shipmentapivega.rockycloud.co.uk/api/courier/reprint

Pre-Sample Request Information:

The Re-Print API enables you to reprint shipping labels for an existing shipment. To use this API,
you will need to provide the following details:

 Despatch Company: Specify the shipping company you want to use. Set this value to the
corresponding despatch company code (e.g., 1 for DHL)
 Order ID: Provide the unique identifier of the order containing the shipment for which you
want to reprint labels. Determine the order ID based on the conditions specified in the SQL
query provided.

SELECT TOP 500


OrderId,
ShippingCompanyName,
AccountNumber
FROM
DespatchOrderDetails
WHERE
Id NOT IN (SELECT DespatchOrderDetailId FROM CancelledDespatchDetails)
AND ShippingCompanyName LIKE 'dhl%'
ORDER BY
OrderId DESC;
Make sure to customize these values according to your specific needs for an accurate and
successful API request.

Sample API Request (Considering despatch_company “DHL”)

{
"header": {
"entityType": "Shipping",
"entityId": "2651851",
"entityAction": "Reprint",
"source": "Dhl-fedex"
},
"payload":
{
"despatch_company": 1,
"order_id": 2809029,
"shipment_id": "",
"is_test_mode": true,
"log_all_request_response_objects": true
}
}

Sample Response

{
"statusMessage": {
"status": 0,
"message": null
},
"payload": {
"labels": [
{
"file_type": "ZPL",
"document_content":
"XlhBCl5GTzAsNTQKXkdCODI3LDAsMixCXkZTCl5GVDIyLDc5Cl5BME4...",
"document_type": null,
"document_id": null,
"tracking_number": null,
"master_tracking_number": null,
"account_number": "185282707",
"date": null
},
{
"file_type": "ZPL",
"document_content":
"fkRHUjpkaGxsZzEuR1JGLDEwMjAsMzAsMDAwMDAwMDAwMDNmZmZmZmZmZmZmYzAwMDAwMD...",
"document_type": null,
"document_id": null,
"tracking_number": null,
"master_tracking_number": null,
"account_number": "185282707",
"date": null
}
],
"status_message": {
"status": 0,
"message": null
}
}
}

Tip: Similar API requests can be made for FedEx (or for any other despatch companies) by
changing relevant parameter values.

Additional Notes:

 Error Handling: The API returns error messages in case of any issues or invalid requests.
a. The Shipment API is designed to provide informative error messages to help you
troubleshoot and address issues effectively. In case of any problems or invalid
requests, the API returns a structured error response.
b. Response Format: The error response follows a standard format, including an error
code, a message describing the issue, and additional details when necessary.
c. Error Codes:
i. • Code 0: Success
1. The API successfully processed the request.
ii. Code -1: General Error
1. Indicates an issue with the request.

Example - Successful Response:

{
"status": 0,
"data": {
"shipment_id": "123456",
"tracking_number": "ABC123",
"status": "Shipped",
"estimated_delivery_date": "2023-12-01"
}
}
Example - Error Response:

{
"error": {
"code": -1,
"message": "…",
}
}

 Authentication: Proper authentication is required to access the Shipment API.


 Documentation Updates: The documentation is subject to updates as the API evolves.

You might also like