首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zoho Books API添加估计数

Zoho Books API添加估计数
EN

Stack Overflow用户
提问于 2015-08-25 10:31:41
回答 1查看 1.3K关注 0票数 2

我非常新的Zoho以及卷曲。我正在尝试开发一个类,它能够使用Zoho为客户创建估计值,但是当我运行代码时,我总是得到一个布尔错误响应>>

。请告诉我,我做错了什么,也指导我到一个网站与适当的教程为这一点。

代码语言:javascript
复制
    $data = array(
        'authtoken'         => 'xxxxxxxxxx',
        'JSONString'        => '{
  "customer_id": "157691000000041090",
  "contact_persons": [
    "157691000000041090"
  ],
  "template_id": "157691000000041077",
  "estimate_number": "EST-000001",
  "reference_number": "QRT-123456",
  "date": "2015-08-25",
  "expiry_date": "2015-08-27"
  "exchange_rate": 1.0,
  "discount": 0.0,
  "is_discount_before_tax": true,
  "discount_type": "item_level",
  "salesperson_name": "John Michael",
  "is_inclusive_tax": "false",
  "custom_fields": [
    {
      "index": 1,
      "value": "25 Aug 2015"
    }
  ],
  "line_items": [
    {
      "item_id": "157691000000041080",
      "name": "Book1",
      "description": "book",
      "rate": 50.00,
      "item_order": 0,
      "quantity": 1.0,
      "discount": 0.0,
      "tax_id": "",
    }
  ],
  "notes": "Looking forward for your business.",
  "terms": "Terms and conditions apply.",
  "shipping_charge": 0.0,
  "adjustment": 0.0,
  "adjustment_description": "Adjustment"
}',
        "organization_id"   => '57408606'
    );

    $curl = curl_init($url);

    curl_setopt_array($curl, array(
      CURLOPT_POST => 1,
      CURLOPT_POSTFIELDS => $data,
      CURLOPT_RETURNTRANSFER => true
    ));

    $estimate = curl_exec($curl);
var_dump($estimate)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-26 02:16:03

看起来JSON的格式不太好。请做以下更改,并让我知道它是否有效

1)在",“之后加上”,“

"expiry_date":"2015-08-27“

2)删除",“之后

"tax_id":“

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32201636

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档