Request a custom estimate
Please use this page to submit a custom order.
const express = require('express'); const axios = require('axios'); const app = express(); app.use(express.json()); app.post('/api/get-print-estimate', async (req, res) => { try { const { product_type, quantity, width, height, paper_stock } = req.body; // Mapping localized inputs onto GoMake Parametric Rules const goMakePayload = { product_category: product_type, volume: parseInt(quantity), dimensions: { width_in: parseFloat(width), height_in: parseFloat(height) }, components: [ { type: "substrate", id: paper_stock } ], optimize_margin: true // Instructs GoMake to evaluate real-time capacity }; const response = await axios.post('https://api.gomake.net/v1/estimates/calculate', goMakePayload, { headers: { 'Authorization': `Bearer ${process.env.GOMAKE_API_KEY}`, 'Content-Type': 'application/json' } }); // Return the calculated pricing matrix to your frontend res.status(200).json(response.data); } catch (error) { console.error('GoMake Calculation Error:', error.response ? error.response.data : error.message); res.status(500).json({ error: 'Estimation pipeline failed to compute.' }); } }); app.listen(3000, () => console.log('Print estimation server live.'));