wOow Global

Get Shipping Rates

Calculate shipping rates for packages

Get Shipping Rates

This endpoint allows users to retrieve shipping rates based on specified parameters, including the dimensions of the package, product type, sender and receiver details, and delivery type.

API Tester - Get Shipping Rates

Calculate shipping rates based on package details and addresses

Environment:
POST
https://dev-api.woowbd.com/api/v1/developer/get-shipping-rates

Get your token from: http://dev-app.woowbd.com/dashboard/developer

Request

  • Method: POST
  • Endpoint: {{base_url}}/get-shipping-rates

Request Body

The request body should be in JSON format and include the following parameters:

box_dimension (Array of Objects)

An array containing box dimensions and items.

ParameterTypeRequiredDescription
lengthNumberYesThe length of the box
widthNumberYesThe width of the box
heightNumberYesThe height of the box
weightNumberYesThe weight of the box
itemsArray of ObjectsYesAn array of items contained within the box

items (Array of Objects)

Each item object contains:

ParameterTypeRequiredDescription
nameStringYesThe name of the item
quantityStringYesThe quantity of the item
unit_priceStringYesThe price per unit of the item

Other Parameters

ParameterTypeRequiredDescription
product_typeStringYesThe type of product being shipped (e.g., "1" for commercial)
weightNumberYesThe total weight of the shipment
weight_unitStringYesThe unit of weight (e.g., "LBS" for pounds)
senderObjectYesInformation about the sender
receiverObjectYesInformation about the receiver
delivery_typeStringYesThe type of delivery (e.g., "commercial")

sender/receiver Object

ParameterTypeRequiredDescription
addressStringYesThe complete address of the sender/receiver
stateStringYesThe sender/receiver's state
state_short_codeStringYesThe short code for the sender/receiver's state
cityStringYesThe sender/receiver's city
zip_codeStringYesThe sender/receiver's zip code
country_codeStringYesThe sender/receiver's country code (e.g., "US", "BD")

Example Request

curl -X POST "https://api.woowbd.com/get-shipping-rates" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "box_dimension": [
      {
        "length": 10,
        "width": 8,
        "height": 6,
        "weight": 2.5,
        "items": [
          {
            "name": "Sample Product",
            "quantity": "2",
            "unit_price": "29.99"
          }
        ]
      }
    ],
    "product_type": "1",
    "weight": 2.5,
    "weight_unit": "LBS",
    "sender": {
      "address": "11370 Anderson St, Loma Linda, CA 92354, USA",
      "state": "California",
      "state_short_code": "CA",
      "city": "Loma Linda",
      "zip_code": "92354",
      "country_code": "US"
    },
    "receiver": {
      "address": "1143 Coleman Avenue, Queens, NY 11413, USA",
      "state": "New York",
      "state_short_code": "NY",
      "city": "Queens",
      "zip_code": "11413",
      "country_code": "US"
    },
    "delivery_type": "commercial"
  }'

Response

The response will be in JSON format and includes the following structure:

  • status (Boolean): Indicates whether the request was successful.
  • message (String): A message providing additional information about the request.
  • data (Array of Objects): Contains shipping rate information.

data Object Structure

ParameterTypeDescription
idStringThe unique identifier for the shipping rate
request_idStringThe identifier for the request
courier_nameStringThe name of the courier service
courier_typeStringThe type of courier service
delivery_timeNumberEstimated delivery time in hours
delivery_time_textStringTextual representation of delivery time
descriptionStringDescription of the shipping option
home_delivery_feeNumberFee for home delivery
import_taxStringApplicable import tax information
logoStringURL to the courier's logo
shipping_chargeNumberThe charge for shipping
  • errors (Array): An array containing any errors that occurred during the request.
  • response_code (String): The response code associated with the request.

Example Response

{
  "status": true,
  "message": "Shipping rates calculated successfully",
  "data": [
    {
      "id": "rate_123456789",
      "request_id": "req_987654321",
      "courier_name": "FedEx",
      "courier_type": "Express",
      "delivery_time": 24,
      "delivery_time_text": "1-2 business days",
      "description": "FedEx Express shipping",
      "home_delivery_fee": 5.00,
      "import_tax": "Included",
      "logo": "https://api.woowbd.com/logos/fedex.png",
      "shipping_charge": 25.99
    },
    {
      "id": "rate_987654321",
      "request_id": "req_123456789",
      "courier_name": "UPS",
      "courier_type": "Ground",
      "delivery_time": 72,
      "delivery_time_text": "3-5 business days",
      "description": "UPS Ground shipping",
      "home_delivery_fee": 0.00,
      "import_tax": "Not applicable",
      "logo": "https://api.woowbd.com/logos/ups.png",
      "shipping_charge": 15.50
    }
  ],
  "errors": [],
  "response_code": "200"
}

Notes

This endpoint is essential for businesses looking to calculate shipping costs effectively based on various parameters and conditions.

Code Examples

JavaScript

const response = await fetch('https://api.woowbd.com/get-shipping-rates', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    box_dimension: [
      {
        length: 10,
        width: 8,
        height: 6,
        weight: 2.5,
        items: [
          {
            name: "Sample Product",
            quantity: "2",
            unit_price: "29.99"
          }
        ]
      }
    ],
    product_type: "1",
    weight: 2.5,
    weight_unit: "LBS",
    sender: {
      address: "11370 Anderson St, Loma Linda, CA 92354, USA",
      state: "California",
      state_short_code: "CA",
      city: "Loma Linda",
      zip_code: "92354",
      country_code: "US"
    },
    receiver: {
      address: "1143 Coleman Avenue, Queens, NY 11413, USA",
      state: "New York",
      state_short_code: "NY",
      city: "Queens",
      zip_code: "11413",
      country_code: "US"
    },
    delivery_type: "commercial"
  })
});

const data = await response.json();
console.log(data.data); // Array of shipping rates

Python

import requests

data = {
    "box_dimension": [
        {
            "length": 10,
            "width": 8,
            "height": 6,
            "weight": 2.5,
            "items": [
                {
                    "name": "Sample Product",
                    "quantity": "2",
                    "unit_price": "29.99"
                }
            ]
        }
    ],
    "product_type": "1",
    "weight": 2.5,
    "weight_unit": "LBS",
    "sender": {
        "address": "11370 Anderson St, Loma Linda, CA 92354, USA",
        "state": "California",
        "state_short_code": "CA",
        "city": "Loma Linda",
        "zip_code": "92354",
        "country_code": "US"
    },
    "receiver": {
        "address": "1143 Coleman Avenue, Queens, NY 11413, USA",
        "state": "New York",
        "state_short_code": "NY",
        "city": "Queens",
        "zip_code": "11413",
        "country_code": "US"
    },
    "delivery_type": "commercial"
}

response = requests.post(
    'https://api.woowbd.com/get-shipping-rates',
    headers={
        'Authorization': f'Bearer {API_KEY}',
        'Content-Type': 'application/json'
    },
    json=data
)

result = response.json()
rates = result['data']  // Array of shipping rates

PHP

$data = [
    'box_dimension' => [
        [
            'length' => 10,
            'width' => 8,
            'height' => 6,
            'weight' => 2.5,
            'items' => [
                [
                    'name' => 'Sample Product',
                    'quantity' => '2',
                    'unit_price' => '29.99'
                ]
            ]
        ]
    ],
    'product_type' => '1',
    'weight' => 2.5,
    'weight_unit' => 'LBS',
    'sender' => [
        'address' => '11370 Anderson St, Loma Linda, CA 92354, USA',
        'state' => 'California',
        'state_short_code' => 'CA',
        'city' => 'Loma Linda',
        'zip_code' => '92354',
        'country_code' => 'US'
    ],
    'receiver' => [
        'address' => '1143 Coleman Avenue, Queens, NY 11413, USA',
        'state' => 'New York',
        'state_short_code' => 'NY',
        'city' => 'Queens',
        'zip_code' => '11413',
        'country_code' => 'US'
    ],
    'delivery_type' => 'commercial'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.woowbd.com/get-shipping-rates');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $API_KEY,
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
$rates = $result['data'];  // Array of shipping rates