const axios = require('axios');
const BASE_URL = 'YOUR_BASE_URL';
const API_TOKEN = 'YOUR_API_TOKEN';
async function createOrder() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/order`, {
code: 'MLBB_ID_5',
referenceNumber: 'YOUR_UNIQUE_REF_123',
data: '12345678(9012)'
}, {
headers: {
'Authorization': `Bearer ${API_TOKEN}`,
'Content-Type': 'application/json'
}
});
console.log('Response:', response.data);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
createOrder();