Documentation for integrating with our products API. This page provides comprehensive information about the products synchronization endpoint.
Get all products from the catalogue in CSV format (according to the current language) for integration with your system.
GET https://www.combatzonetactical.com/api/products/sync-productsThis endpoint returns a complete list of all products available in our system, including their names, descriptions, reference codes, prices, and stock levels.
The API returns a JSON array containing product objects with the following structure:
[
{
"productName": "Extensión para cargador de gas Raccoon - RCT002",
"productDescription": "",
"referenceCode": "5382",
"msrp": 2.7,
"stock": 0
},
{
"productName": "OF PARACORD BRACELET Cierre Acero BK",
"productDescription": "",
"referenceCode": "5140",
"msrp": 0,
"stock": 57
}
]
| Field | Type | Description |
|---|---|---|
productName | string | The name of the product |
productDescription | string | Detailed description of the product (may be empty) |
referenceCode | string | Unique product reference code |
msrp | number | Manufacturer's Suggested Retail Price (0 if not available) |
stock | number | Current stock quantity |
Here are some examples of how to use this API endpoint:
// JavaScript/TypeScript
fetch('https://www.combatzonetactical.com/api/products/sync-products')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
// cURL
curl -X GET "https://www.combatzonetactical.com/api/products/sync-products" \
-H "Content-Type: application/json"POST https://www.combatzonetactical.com/api/cart/addThis endpoint allows you to add products to a customer's shopping cart. It requires authentication and returns detailed information about the cart item and total.
The request must include the following parameters:
{
"productId": "5382",
"quantity": 2,
"customerId": "customer123"
}| Field | Type | Description |
|---|---|---|
productId | string | The unique identifier of the product to add to cart |
quantity | number | The quantity of the product to add (must be a positive integer) |
customerId | string | The unique identifier of the customer |
The API returns a JSON object with the following structure:
{
"success": true,
"message": "Product added to cart successfully",
"cartItem": {
"id": "cart_item_123",
"productId": "5382",
"quantity": 2,
"price": 5.4,
"total": 10.8
},
"cartTotal": 10.8
}Here are some examples of how to use the Add to Cart API:
// JavaScript/TypeScript
const addToCart = async (productId, quantity, customerId) => {
try {
const response = await fetch('https://www.combatzonetactical.com/api/cart/add', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
productId,
quantity,
customerId
})
});
const result = await response.json();
console.log('Product added to cart:', result);
} catch (error) {
console.error('Error adding to cart:', error);
}
};
// cURL
curl -X POST "https://www.combatzonetactical.com/api/cart/add" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"productId": "5382",
"quantity": 2,
"customerId": "customer123"
}'POST https://www.combatzonetactical.com/api/auth/loginThis endpoint authenticates users and returns a JWT token for accessing protected resources. The token must be included in subsequent API requests.
The request must include the following parameters:
{
"email": "customer@example.com",
"password": "your_password"
}| Field | Type | Description |
|---|---|---|
email | string | The user's email address (must be valid email format) |
password | string | The user's password (minimum 6 characters) |
The API returns a JSON object with authentication details:
{
"success": true,
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "customer123",
"email": "customer@example.com",
"name": "John Doe",
"role": "customer"
},
"expiresIn": 3600
}Here are some examples of how to use the Authentication API:
// JavaScript/TypeScript
const login = async (email, password) => {
try {
const response = await fetch('https://www.combatzonetactical.com/api/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email,
password
})
});
const result = await response.json();
if (result.success) {
// Store token for future requests
localStorage.setItem('authToken', result.token);
console.log('Login successful:', result.user);
} else {
console.error('Login failed:', result.message);
}
} catch (error) {
console.error('Error during login:', error);
}
};
// cURL
curl -X POST "https://www.combatzonetactical.com/api/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "customer@example.com",
"password": "your_password"
}'GET https://www.combatzonetactical.com/api/cartThis endpoint retrieves the current shopping cart for the authenticated customer. It returns all cart items with detailed information including prices, quantities, and totals.
The request must include the following header for authentication:
Authorization: Bearer YOUR_JWT_TOKENThe API returns a JSON object with the complete cart information:
{
"success": true,
"cart": {
"id": "cart_123",
"customerId": "customer123",
"items": [
{
"id": "cart_item_123",
"productId": "5382",
"productName": "Extensión para cargador de gas Raccoon - RCT002",
"quantity": 2,
"unitPrice": 2.7,
"totalPrice": 5.4,
"addedAt": "2024-01-15T10:30:00Z"
},
{
"id": "cart_item_124",
"productId": "5140",
"productName": "OF PARACORD BRACELET Cierre Acero BK",
"quantity": 1,
"unitPrice": 0,
"totalPrice": 0,
"addedAt": "2024-01-15T11:15:00Z"
}
],
"subtotal": 5.4,
"taxes": 1.08,
"shipping": 5.0,
"total": 11.48,
"itemCount": 3,
"lastUpdated": "2024-01-15T11:15:00Z"
}
}| Field | Type | Description |
|---|---|---|
cart.id | string | Unique identifier of the shopping cart |
cart.customerId | string | Unique identifier of the customer who owns the cart |
cart.items | array | Array of cart items with product details and quantities |
cart.subtotal | number | Total price of all items before taxes and shipping |
cart.total | number | Final total including taxes and shipping |
Here are some examples of how to use the Get Cart API:
// JavaScript/TypeScript
const getCart = async (token) => {
try {
const response = await fetch('https://www.combatzonetactical.com/api/cart', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});
if (response.ok) {
const result = await response.json();
console.log('Cart retrieved:', result.cart);
return result.cart;
} else {
console.error('Failed to get cart:', response.status);
}
} catch (error) {
console.error('Error getting cart:', error);
}
};
// Usage
const token = localStorage.getItem('authToken');
const cart = await getCart(token);
// cURL
curl -X GET "https://www.combatzonetactical.com/api/cart" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"2026 © Tubalu International Trading All Rights Reserved
