wOow Global

Create Shipping Order

Create a new shipping order

Create Shipping Order

This endpoint allows you to create a new order within the system. It requires specific information about the sender and receiver, as well as a rate ID to process the order.

API Tester - Create Order

Create a new order with sender, receiver, and rate ID

Environment:
POST
https://dev-api.woowbd.com/api/v1/developer/create-order

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

Request Format

  • Method: POST
  • Endpoint: {{base_url}}/create-order
  • Request Body: The request body must be in JSON format and should include the following parameters:
ParameterTypeRequiredDescription
rate_idstringYesUnique identifier for the rate
senderobjectYesSender information
receiverobjectYesReceiver information

Sender Object

ParameterTypeRequiredDescription
country_codestringYesSender's country code (e.g., "US", "BD", "CA")
namestringYesName of the sender
emailstringYesEmail address of the sender
phone_numberstringYesPhone number of the sender
addressstringYesPrimary address of the sender
address_2stringNoSecondary address of the sender (optional)

Receiver Object

ParameterTypeRequiredDescription
country_codestringYesReceiver's country code (e.g., "US", "BD", "CA")
namestringYesName of the receiver
emailstringYesEmail address of the receiver
phone_numberstringYesPhone number of the receiver
addressstringYesPrimary address of the receiver
address_2stringNoSecondary address of the receiver (optional)

Request Body Example

{
  "rate_id": "string", // Unique identifier for the rate
  "sender": {
    "country_code": "string", // Sender's country code
    "name": "string", // Name of the sender
    "email": "string", // Email address of the sender
    "phone_number": "string", // Phone number of the sender
    "address": "string", // Primary address of the sender
    "address_2": "string" // Secondary address of the sender (optional)
  },
  "receiver": {
    "country_code": "string", // Receiver's country code
    "name": "string", // Name of the receiver
    "email": "string", // Email address of the receiver
    "phone_number": "string", // Phone number of the receiver
    "address": "string", // Primary address of the receiver
    "address_2": "string" // Secondary address of the receiver (optional)
  }
}

Example Request

curl -X POST "https://api.woowbd.com/create-order" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rate_id": "rate_123456789",
    "sender": {
      "country_code": "US",
      "name": "John Doe",
      "email": "john.doe@example.com",
      "phone_number": "+12025550175",
      "address": "123 Main St",
      "address_2": "Apt 4B"
    },
    "receiver": {
      "country_code": "BD",
      "name": "Jane Smith",
      "email": "jane.smith@example.com",
      "phone_number": "+8801712345678",
      "address": "456 Oak Ave",
      "address_2": "Suite 100"
    }
  }'

Response Format

On a successful order creation, the response will be in JSON format and will include the following structure:

{
  "status": true, // Indicates if the request was successful
  "message": "string", // Optional message providing additional information
  "data": {
    "tracking_number": "string" // Tracking number for the created order
  },
  "errors": [], // Array of errors if any occurred during the request
  "response_code": "string" // Response code indicating the status of the request
}

Example Response

{
  "status": true,
  "message": "Order created successfully",
  "data": {
    "tracking_number": "WOOW123456789"
  },
  "errors": [],
  "response_code": "200"
}

This endpoint is essential for managing orders and tracking shipments effectively.

Code Examples

JavaScript

const response = await fetch('https://api.woowbd.com/create-order', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    rate_id: 'rate_123456789',
    sender: {
      country_code: 'US',
      name: 'John Doe',
      email: 'john.doe@example.com',
      phone_number: '+12025550175',
      address: '123 Main St',
      address_2: 'Apt 4B'
    },
    receiver: {
      country_code: 'BD',
      name: 'Jane Smith',
      email: 'jane.smith@example.com',
      phone_number: '+8801712345678',
      address: '456 Oak Ave',
      address_2: 'Suite 100'
    }
  })
});

const data = await response.json();
console.log(data.data.tracking_number); // Tracking number

Python

import requests

data = {
    'rate_id': 'rate_123456789',
    'sender': {
        'country_code': 'US',
        'name': 'John Doe',
        'email': 'john.doe@example.com',
        'phone_number': '+12025550175',
        'address': '123 Main St',
        'address_2': 'Apt 4B'
    },
    'receiver': {
        'country_code': 'BD',
        'name': 'Jane Smith',
        'email': 'jane.smith@example.com',
        'phone_number': '+8801712345678',
        'address': '456 Oak Ave',
        'address_2': 'Suite 100'
    }
}

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

result = response.json()
tracking_number = result['data']['tracking_number']  // Tracking number

PHP

$data = [
    'rate_id' => 'rate_123456789',
    'sender' => [
        'country_code' => 'US',
        'name' => 'John Doe',
        'email' => 'john.doe@example.com',
        'phone_number' => '+12025550175',
        'address' => '123 Main St',
        'address_2' => 'Apt 4B'
    ],
    'receiver' => [
        'country_code' => 'BD',
        'name' => 'Jane Smith',
        'email' => 'jane.smith@example.com',
        'phone_number' => '+8801712345678',
        'address' => '456 Oak Ave',
        'address_2' => 'Suite 100'
    ]
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.woowbd.com/create-order');
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);
$tracking_number = $result['data']['tracking_number'];  // Tracking number