在SAGE Accounting API 3.1中创建销售发票时出现问题

时间:2018-12-16 11:44:05

标签: php

当我尝试根据您的手册创建销售发票时,出现了一个错误,该错误既未在关键概念中明确指出,也未在销售发票的API文档中标记为必需

来自Key Concepts

的示例
POST /sales_invoices
Content-Type: application/json
Accept: */*

{
  "sales_invoice": {
    "contact_id": "14d93840783b11e8990a122c8428e4b2",
    "date": "2018-06-24",
    "invoice_lines": [
      {
        "description": "A Minimal Invoice Item",
        "ledger_account_id": "4195173e75db11e8990a122c8428e4b2",
        "quantity": "1",
        "unit_price": "0.99",
        "tax_rate_id": "584793ca75db11e8990a122c8428e4b2"
      },
      {
        "description": "An Invoice Item With Pre-Calculated Tax",
        "ledger_account_id": "4195173e75db11e8990a122c8428e4b2",
        "quantity": "1",
        "unit_price": "110.00",
        "tax_rate_id": "584793ca75db11e8990a122c8428e4b2",
        "discount_amount": "10.00",
        "tax_amount": "9.95"
      },
      {
        "description": "An Invoice Item For A Service",
        "ledger_account_id": "4195173e75db11e8990a122c8428e4b2",
        "quantity": "1",
        "unit_price": "19.99",
        "tax_rate_id": "584793ca75db11e8990a122c8428e4b2",
        "service_id": "086b655f785411e8990a122c8428e4b2"
      }
    ]
  }
}

好吧,我在下面发送数据,并收到错误422,响应正文回收了main_address

{
    "sales_invoice": {
        "contact_id": "4c09466fc0654609bd949e87fe5dc934",
        "date": "2018-03-04",
        "invoice_lines": [{
            "description": "TULIMITE 2009 - mydomain.com (07\/03\/2018 - 06\/06\/2018)",
            "ledger_account_id": "a5257ed71d344757ab24b3438790071e",
            "quantity": "1",
            "unit_price": "90.00",
            "tax_rate_id": "ES_STANDARD"
        }]
    }
}

响应正文

Response Body:
   0:
      $severity:"error"
      $dataCode:"RecordInvalid"
      $message:"This field is required."
      $source:"main_address"

联系人ID 14d93840783b11e8990a122c8428e4b2关联了main_address有什么想法吗?

0 个答案:

没有答案