开发者 API

面向开发者的 DreamAPI 会计接口

  • 广泛兼容: 轻松对接 QuickBooks Online、Xero、Sage、Zoho Books、Odoo 等平台。
  • 统一数据格式: 所有支持的平台都使用同一种 JSON 格式提交账单和发票。
  • 自动配置: 对接过程中按需自动创建科目、供应商和客户。
  • 多币种处理: 内置汇率换算,轻松处理多币种交易。
  • 税额分摊: 把税额准确分摊到每个明细行,无需手工调整。
  • 开发友好: 一行代码即可完成完整对接。
  • 集中管理: 在 DreamAPI 门户中轻松管理所有连接。

dreamapi.io 已对接

onedriveqboxerozohoodoo
onedriveqboxerozohoodoo
onedriveqboxerozohoodoo
onedriveqboxerozohoodoo

JSON 请求示例

{
  "tax": 5.4,
  "items": [
    {
      "qty": 1,
      "tax": 5.4,
      "total": 92.99,
      "category": "Supplies",
      "currency": "CAD",
      "discount": 0,
      "unit_price": 92.99,
      "description": "SPR INT FL EXTRA",
      "is_tax_line": false
    }
  ],
  "total": 114.4,
  "vendor": {
    "trn": "2345678901",
    "name": "Sherwin-Williams",
    "phone": "(587) 625-0667",
    "address": "65 Shawville Blvd SE, Calgary, AB T2Y3W5",
    "country": "CA"
  },
  "currency": "CAD",
  "customer": {
    "trn": "1234567890",
    "name": "Alexander",
    "phone": "",
    "address": "",
    "country": "CA"
  },
  "discount": 0,
  "subtotal": 108.57,
  "invoice_no": "E007/21678",
  "attachments": [
    {
      "mime_type": "image/jpeg",
      "media_file": "/tmp/bb1285aa-f8df-409e-8496-4a79331851b5.jpg.jpeg"
    }
  ],
  "delivery_fee": 0,
  "invoice_date": "2024-09-07",
  "invoice_summary": "Purchase of paint supplies including SPR INT FL EXTRA, sponges, and spackling."
}

Node.js 代码示例


import axios from 'axios';

async function callApi() {
  try {
    const response = await axios.post('https://your-api-url.com/endpoint', {
    "tax": 5.4,
    "items": ...});
    console.log('Response:', response.data);
  } catch (error) {
    console.error('Error calling API:', error);
  }
}

callApi();