UNPKG

roicmedya-api

Version:

RoicMedya.com SMM Modülü ile Instagram ve diğer platformlar için takipçi ve beğeni entegrasyonlarını zahmetsizce yapın.

20 lines (17 loc) 575 B
const axios = require('axios'); async function cancelOrder(apiKey, baseURL, orderId) { try { const response = await axios.post(baseURL, { key: apiKey, action: 'cancel', order: orderId }); if (!response.data || response.data.status !== 'active') { throw new Error('Sipariş iptali aktif değil veya API null yanıt döndü.'); } return response.data; } catch (error) { throw new Error(`Sipariş iptal edilemedi: ${error.response?.data?.error || error.message}`); } } module.exports = { cancelOrder };