Buy For Me Order Create
Create a new buy-for-me order with product details and shipping information
Buy For Me Order Create
This endpoint allows users to create a new buy-for-me order. This service enables customers to request specific products to be purchased and shipped to them.
API Tester - Create Buy For Me Order
Create a new buy-for-me order with product details and delivery information
Environment:
POST
https://dev-api.woowbd.com/api/v1/developer/create-buy-for-me-order
Get your token from: http://dev-app.woowbd.com/dashboard/developer
Request Format
- Method: POST
- Endpoint:
{{base_url}}/create-buy-for-me-order - Request Body: The request body must be in JSON format and should include the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
products | array | Yes | Array of products to be purchased |
delivery | object | Yes | Delivery information |
Products Array
| Parameter | Type | Required | Description |
|---|---|---|---|
products[].url | string | Yes | URL of the product to be purchased |
products[].name | string | Yes | Name of the product |
products[].description | string | No | Detailed description of the product |
products[].price | string | Yes | Expected price of the product |
products[].quantity | string | Yes | Quantity of the product to purchase |
Delivery Object
| Parameter | Type | Required | Description |
|---|---|---|---|
delivery.sender | object | Yes | Sender information |
delivery.receiver | object | Yes | Receiver information |
delivery.delivery_method | string | Yes | Delivery method: "warehouse_pickup" or "home_delivery" |
delivery.delivery_provider | string | Yes | Delivery provider: "woow", "fedex", "DHL", "UPS" |
Sender Object
| Parameter | Type | Required | Description |
|---|---|---|---|
delivery.sender.country_code | string | Yes | Sender's country code (e.g., "US") |
Receiver Object
| Parameter | Type | Required | Description |
|---|---|---|---|
delivery.receiver.country_code | string | Yes | Receiver's country code (US, IN, BD, GB) |
delivery.receiver.name | string | Yes* | Recipient's full name (Required when delivery_method = "home_delivery") |
delivery.receiver.email | string | Yes* | Recipient's email address (Required when delivery_method = "home_delivery") |
delivery.receiver.phone_number | string | Yes* | Recipient's phone number (Required when delivery_method = "home_delivery") |
delivery.receiver.city | string | Yes* | City name (Required when delivery_method = "home_delivery") |
delivery.receiver.state | string | Yes* | State/Province name (Required when delivery_method = "home_delivery") |
delivery.receiver.address | string | Yes* | Primary address line (Required when delivery_method = "home_delivery") |
delivery.receiver.address_2 | string | No | Secondary address line (optional) |
delivery.receiver.zip_code | string | Yes* | Postal/ZIP code (Required when delivery_method = "home_delivery") |
Request Body Example
{
"products": [
{
"url": "string", // URL of the product to be purchased
"name": "string", // Name of the product
"description": "string", // Detailed description of the product
"price": "string", // Expected price of the product
"quantity": "string" // Quantity of the product to purchase
}
],
"delivery": {
"sender": {
"country_code": "string" // Sender's country code
},
"receiver": {
"country_code": "string", // Receiver's country code
"name": "string", // Recipient's full name
"email": "string", // Recipient's email address
"phone_number": "string", // Recipient's phone number
"city": "string", // City name
"state": "string", // State/Province name
"address": "string", // Primary address line
"address_2": "string", // Secondary address line (optional)
"zip_code": "string" // Postal/ZIP code
},
"delivery_method": "string", // Delivery method: "warehouse_pickup" or "home_delivery"
"delivery_provider": "string" // Delivery provider: "woow", "fedex", "DHL", "UPS"
}
}Example Request
curl -X POST "{{base_url}}/create-buy-for-me-order" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"products": [
{
"url": "https://www.amazon.com/dp/B0CMZ1PQV6/ref=sspa_dk_detail_6?psc=1&pd_rd_i=B0CMZ1PQV6&pd_rd_w=JUWa2&content-id=amzn1.sym.386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_p=386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_r=8W1C7G6TVTMGS5STZEC0&pd_rd_wg=Adeud&pd_rd_r=787b8a9a-e594-420a-8fe0-06861dfc6c19&s=pc&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM",
"name": "Product 1",
"description": "",
"price": "815",
"quantity": "8"
}
],
"delivery": {
"sender": {
"country_code": "US"
},
"receiver": {
"country_code": "BD",
"name": "komor",
"email": "test@gmail.com",
"phone_number": "+8801234567890",
"city": "NY",
"state": "New York",
"address": "test address",
"address_2": "Building 123, Floor 2",
"zip_code": "1212"
},
"delivery_method": "home_delivery",
"delivery_provider": "UPS"
}
}'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": {
"order_id": ["string"] // Array of unique identifiers for the buy-for-me orders
},
"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": {
"order_id": [
"LS8800004367"
]
},
"errors": [],
"response_code": "68bd97af9c1cf"
}This endpoint is essential for managing buy-for-me orders and tracking shipments effectively.
Error Responses
400 Bad Request
{
"status": false,
"message": "Invalid request parameters",
"data": [],
"errors": [
"Product URL is required",
"Product price must be a positive number"
],
"response_code": "validation_error"
}401 Unauthorized
{
"status": false,
"message": "Authentication required",
"data": [],
"errors": [
"Invalid or missing API key"
],
"response_code": "unauthorized"
}422 Unprocessable Entity
{
"status": false,
"message": "Order creation failed",
"data": [],
"errors": [
"Product is currently out of stock",
"Shipping address is not supported"
],
"response_code": "order_failed"
}Code Examples
JavaScript
const createBuyForMeOrder = async (orderData) => {
try {
const response = await fetch('{{base_url}}/create-buy-for-me-order', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify(orderData)
});
const result = await response.json();
if (result.status) {
console.log('Order created successfully:', result.data);
return result.data;
} else {
console.error('Order creation failed:', result.errors);
throw new Error(result.message);
}
} catch (error) {
console.error('Error creating buy-for-me order:', error);
throw error;
}
};
// Example usage
const orderData = {
products: [
{
url: "https://www.amazon.com/dp/B0CMZ1PQV6/ref=sspa_dk_detail_6?psc=1&pd_rd_i=B0CMZ1PQV6&pd_rd_w=JUWa2&content-id=amzn1.sym.386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_p=386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_r=8W1C7G6TVTMGS5STZEC0&pd_rd_wg=Adeud&pd_rd_r=787b8a9a-e594-420a-8fe0-06861dfc6c19&s=pc&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM",
name: "Product 1",
description: "",
price: "815",
quantity: "8"
}
],
delivery: {
sender: {
country_code: "US"
},
receiver: {
country_code: "BD",
name: "komor",
email: "test@gmail.com",
phone_number: "+8801234567890",
city: "NY",
state: "New York",
address: "test address",
address_2: "Building 123, Floor 2",
zip_code: "1212"
},
delivery_method: "home_delivery",
delivery_provider: "UPS"
}
};
createBuyForMeOrder(orderData);Python
import requests
import json
def create_buy_for_me_order(order_data):
url = "{{base_url}}/create-buy-for-me-order"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
try:
response = requests.post(url, headers=headers, json=order_data)
result = response.json()
if result["status"]:
print("Order created successfully:", result["data"])
return result["data"]
else:
print("Order creation failed:", result["errors"])
raise Exception(result["message"])
except requests.exceptions.RequestException as e:
print("Error creating buy-for-me order:", e)
raise
# Example usage
order_data = {
"products": [
{
"url": "https://www.amazon.com/dp/B0CMZ1PQV6/ref=sspa_dk_detail_6?psc=1&pd_rd_i=B0CMZ1PQV6&pd_rd_w=JUWa2&content-id=amzn1.sym.386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_p=386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_r=8W1C7G6TVTMGS5STZEC0&pd_rd_wg=Adeud&pd_rd_r=787b8a9a-e594-420a-8fe0-06861dfc6c19&s=pc&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM",
"name": "Product 1",
"description": "",
"price": "815",
"quantity": "8"
}
],
"delivery": {
"sender": {
"country_code": "US"
},
"receiver": {
"country_code": "BD",
"name": "komor",
"email": "test@gmail.com",
"phone_number": "+8801234567890",
"city": "NY",
"state": "New York",
"address": "test address",
"address_2": "Building 123, Floor 2",
"zip_code": "1212"
},
"delivery_method": "home_delivery",
"delivery_provider": "UPS"
}
}
create_buy_for_me_order(order_data)PHP
<?php
function createBuyForMeOrder($orderData) {
$url = "{{base_url}}/create-buy-for-me-order";
$headers = [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($orderData));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($response === false) {
throw new Exception("cURL error: " . curl_error($ch));
}
$result = json_decode($response, true);
if ($result["status"]) {
echo "Order created successfully: " . json_encode($result["data"]);
return $result["data"];
} else {
echo "Order creation failed: " . json_encode($result["errors"]);
throw new Exception($result["message"]);
}
}
// Example usage
$orderData = [
"products" => [
[
"url" => "https://www.amazon.com/dp/B0CMZ1PQV6/ref=sspa_dk_detail_6?psc=1&pd_rd_i=B0CMZ1PQV6&pd_rd_w=JUWa2&content-id=amzn1.sym.386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_p=386c274b-4bfe-4421-9052-a1a56db557ab&pf_rd_r=8W1C7G6TVTMGS5STZEC0&pd_rd_wg=Adeud&pd_rd_r=787b8a9a-e594-420a-8fe0-06861dfc6c19&s=pc&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWxfdGhlbWF0aWM",
"name" => "Product 1",
"description" => "",
"price" => "815",
"quantity" => "8"
]
],
"delivery" => [
"sender" => [
"country_code" => "US"
],
"receiver" => [
"country_code" => "BD",
"name" => "komor",
"email" => "test@gmail.com",
"phone_number" => "+8801234567890",
"city" => "NY",
"state" => "New York",
"address" => "test address",
"address_2" => "Building 123, Floor 2",
"zip_code" => "1212"
],
"delivery_method" => "home_delivery",
"delivery_provider" => "UPS"
]
];
try {
createBuyForMeOrder($orderData);
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
?>Notes
- Product Verification: Our team will verify the product availability and price before processing the order
- Budget Limits: If the actual product price exceeds your budget limit, we'll contact you for approval
- Processing Time: Buy-for-me orders typically take 1-3 business days to process
- Shipping: Standard shipping rates apply based on the destination and product weight
- Tracking: You'll receive tracking information once the order is shipped
- Cancellation: Orders can be cancelled within 24 hours of creation if not yet processed
Related Endpoints
- Get Order Details - Retrieve details of your buy-for-me order
- Track Order - Track the status of your order
- Cancel Order - Cancel an existing order