Track your shipment
API Documentation - DXPress

DXPress API Documentation

Welcome to the DXPress API documentation. This API provides you with the tools to integrate shipping functionality into your e-commerce platform or application.

To use the API, you'll need an API key. Contact our support team to get your API key.

Authentication

All API requests require authentication. Include your API key in the request headers.

X-API-Key: dxp_test_12345678

Base URL

All API endpoints are relative to the base URL:

https://dxpress.uk/api

Calculate Shipping Rates

Returns available shipping rates from multiple carriers based on shipment details.

Endpoint

POST /shipments/calculate-rates

Request Parameters

Parameter Type Description Required
origin string Pickup address Yes
destination string Delivery address Yes
weight number Package weight in kg Yes
dimensions object Package dimensions (length, width, height) in cm No
packageType string Type of package (Document, Parcel, Freight, Express) No
carriers array Specific carriers to get rates from (DHL, FedEx, UPS, USPS) No

Example Request

{
  "origin": "123 Sender St, New York, NY",
  "destination": "456 Receiver Ave, Los Angeles, CA",
  "weight": 5,
  "dimensions": {
    "length": 10,
    "width": 8,
    "height": 6
  },
  "packageType": "Parcel",
  "carriers": ["DHL", "FedEx", "UPS"]
}

Example Response

{
  "success": true,
  "data": {
    "rates": [
      {
        "carrier": "FedEx",
        "serviceLevel": "Ground",
        "cost": 15.95,
        "currency": "USD",
        "estimatedDays": 3,
        "selected": true
      },
      {
        "carrier": "DHL",
        "serviceLevel": "Express",
        "cost": 29.99,
        "currency": "USD",
        "estimatedDays": 1,
        "selected": false
      },
      {
        "carrier": "UPS",
        "serviceLevel": "Ground",
        "cost": 18.50,
        "currency": "USD",
        "estimatedDays": 3,
        "selected": false
      }
    ],
    "estimatedDeliveryDates": [
      {
        "carrier": "FedEx",
        "serviceLevel": "Ground",
        "estimatedDeliveryDate": "2023-06-10T00:00:00.000Z"
      },
      {
        "carrier": "DHL",
        "serviceLevel": "Express",
        "estimatedDeliveryDate": "2023-06-08T00:00:00.000Z"
      },
      {
        "carrier": "UPS",
        "serviceLevel": "Ground",
        "estimatedDeliveryDate": "2023-06-10T00:00:00.000Z"
      }
    ]
  }
}

Create Shipment

Creates a new shipment with the specified details.

Endpoint

POST /shipments

Request Parameters

Parameter Type Description Required
customerName string Customer's full name Yes
customerEmail string Customer's email address Yes
customerPhone string Customer's phone number No
origin string Pickup address Yes
destination string Delivery address Yes
weight number Package weight in kg Yes
dimensions object Package dimensions (length, width, height) in cm No
packageType string Type of package (Document, Parcel, Freight, Express) Yes
selectedRate object Selected shipping rate details No
isFragile boolean Whether the package contains fragile items No
insuranceIncluded boolean Whether insurance is included No
expressDelivery boolean Whether express delivery is required No
additionalNotes string Additional notes for the shipment No

Example Request

{
  "customerName": "John Doe",
  "customerEmail": "john@example.com",
  "customerPhone": "+1234567890",
  "origin": "123 Sender St, New York, NY",
  "destination": "456 Receiver Ave, Los Angeles, CA",
  "weight": 5,
  "dimensions": {
    "length": 10,
    "width": 8,
    "height": 6
  },
  "packageType": "Parcel",
  "selectedRate": {
    "carrier": "DHL",
    "serviceLevel": "Express",
    "cost": 29.99,
    "estimatedDays": 1
  },
  "isFragile": true,
  "insuranceIncluded": true,
  "expressDelivery": false,
  "additionalNotes": "Please handle with care."
}

Example Response

{
  "success": true,
  "message": "Shipment created successfully",
  "data": {
    "shipmentId": "60a1b2c3d4e5f6g7h8i9j0k",
    "trackingId": "DXP12345678",
    "invoiceId": "INV-20230607-12345",
    "paymentStatus": "Unpaid",
    "estimatedDelivery": "2023-06-08T00:00:00.000Z"
  }
}

Track Shipment

Retrieves tracking information for a shipment.

Endpoint

GET /tracking/:id

URL Parameters

Parameter Description Required
id Tracking ID of the shipment Yes

Example Response

{
  "success": true,
  "data": {
    "trackingId": "DXP12345678",
    "status": "In Transit",
    "estimatedDelivery": "2023-06-08T00:00:00.000Z",
    "origin": "123 Sender St, New York, NY",
    "destination": "456 Receiver Ave, Los Angeles, CA",
    "carrier": "DHL",
    "lastUpdate": "2023-06-06T18:30:00.000Z",
    "history": [
      {
        "status": "Pending",
        "location": "123 Sender St, New York, NY",
        "timestamp": "2023-06-05T12:00:00.000Z",
        "note": "Shipment created"
      },
      {
        "status": "Picked Up",
        "location": "New York Sorting Facility",
        "timestamp": "2023-06-05T16:45:00.000Z",
        "note": "Package picked up by carrier"
      },
      {
        "status": "In Transit",
        "location": "Chicago Transfer Station",
        "timestamp": "2023-06-06T18:30:00.000Z",
        "note": "Package in transit to destination"
      }
    ]
  }
}

Payment Endpoints

Create Payment

Initiates a payment for a shipment.

POST /payments/create

Request Parameters

Parameter Type Description Required
shipmentId string ID or tracking number of the shipment Yes
provider string Payment provider (stripe, paypal) Yes

Complete Payment

Completes a payment for a shipment.

POST /payments/complete

Request Parameters

Parameter Type Description Required
shipmentId string ID or tracking number of the shipment Yes
provider string Payment provider (stripe, paypal) Yes
paymentIntentId string For Stripe: Payment intent ID Conditional
orderId string For PayPal: Order ID Conditional