0

我想通过 REST 创建发票。我发送了所有必需的参数,但它显示“您正在寻找的资源不可用”。

我使用的端点“ http://mydomain.amazonaws.com/api/resource/Sales Invoice”。请帮助我。对不起我的英语不好。

{
  "naming_series": "SINV-ST",
  "docstatus":1,
  "customer": "Ayan Bera",
  "customer_name": "Ayan Bera",
  "is_pos": "1",
  "company": "Succeed Technologies",
  "posting_date": "2017-12-23",
  "due_date": "2017-12-23",
  "currency": "INR",
  "selling_price_list": "Standard Selling",
  "price_list_currency": "INR",
  "discount_amount": 0,
  "apply_discount_on": "Grand Total",
  "cash_bank_account": "Cash - ST",
  "write_off_amount": 0,
  "debit_to": "Accounts Receivable - ST",
  "remarks": "via b2b mobile app",
  "customer_group": "Individual",
  "submit_on_creation": 1,
  "against_income_account": "Accounts Receivable - ST",
  "paid_amount": 360,
  "mode_of_payment": "Cash",
  "is_opening": "No",
  "status": "Paid",
  "amount_received": "360",
  "amount_returned": "0.0",
  "update_stock": 1,
  "items": [{
  "item_code": "f-r-02",
  "item_name": "Orange",
  "qty": "2",
  "rate": "80.0",
  "expense_account": "Accounts Receivable - ST",
  "cost_center": "Main - ST",
  "warehouse": "All Warehouses - ST",
  "parenttype": "SalesInvoice",
  "parentfield": "items"
  }, {
  "cost_center": "Main - ST",
  "qty": "2",
  "warehouse": "All Warehouses - ST",
  "item_code": "f-r-01",
  "item_name": "Orange Big",
  "rate": "100.0",
  "expense_account": "Accounts Receivable - ST",
  "parenttype": "Sales Invoice",
  "parentfield": "items",
  "base_paid_amount": 360
  }],
  "payments": [{
        "mode_of_payment": "Cash",
        "amount": 360,
        "account": "Cash - ST",
        "base_amount": 360
  }]
 }
4

1 回答 1

0

每当发生这种情况时,这意味着您的 DocType 的依赖项之一被错误命名。

找出答案的唯一方法是实际尝试获取每一个,直到找到不存在的那个(无论出于何种原因)。

  "naming_series": "SINV-ST",
  "customer": "Ayan Bera",
  "company": "Succeed Technologies",
  "currency": "INR",
  "selling_price_list": "Standard Selling",
  "cash_bank_account": "Cash - ST",
  "customer_group": "Individual",
  "mode_of_payment": "Cash",
  "item_code": "f-r-02",
  "item_code": "f-r-01",
  "cost_center": "Main - ST",
  "warehouse": "All Warehouses - ST",
  "expense_account": "Accounts Receivable - ST",
  "mode_of_payment": "Cash",

以上任何一项都可能丢失,但您的商品代码对我来说看起来很不寻常。我会先检查他们。

我有 Postman 并使用它来预测试我希望在我的应用程序中使用的所有 API 调用。我已经建立了它们的库,这样可以快速轻松地测试上述依赖项列表中的每个项目。

于 2020-07-25T11:36:11.997 回答