【问题标题】:QuickBook API integration ,Issue Adding Bill Payment at US companyQuickBook API 集成,在美国公司问题添加账单支付
【发布时间】:2016-11-25 06:21:17
【问题描述】:

我正在尝试从我的应用程序中添加账单支付,验证错误来了: 请求中缺少必需的参数 CheckPayment/CreditCardPayment

无法获得解决方案。参考图片

整个连接进展顺利,但缺少参数的问题即将到来。 我只是编写以下代码:

protected void btnBillPayment_Click(object sender, EventArgs e)
        {
            try
            {
                var dataService = GetDataService();
                var context = GetServiceContext();

                decimal _amount = 200m;

                BillPayment billPayment = new BillPayment
                {
                    VendorRef = new ReferenceType
                    {
                        Value = "71",
                        name = "Lotus"
                    },
                    APAccountRef = new ReferenceType
                    {
                        name = "Fuel",
                        Value = "56"
                    },
                    PayType = BillPaymentTypeEnum.Check,
                    PayTypeSpecified = true,
                    BillPaymentEx = new IntuitAnyType
                    {
                    },
                    TotalAmt = _amount,
                    TotalAmtSpecified = true,
                    domain = "QBO",
                    MetaData = new ModificationMetaData
                    {
                        CreateTime = DateTime.Now,
                        LastUpdatedTime = DateTime.Now
                    },
                    TxnDate = DateTime.Now,
                    TxnDateSpecified = true,
                    //DepartmentRef=new ReferenceType
                    //{

                    //},
                    CurrencyRef = new ReferenceType()
                                {
                                    //name = ?,
                                    //Value = ?
                                },
                    PrivateNote = "Private Note",
                    Line = new Line[] 
                    {
                        new Line
                        {
                            Amount=_amount,
                            AmountSpecified=true,

                            LinkedTxn=new LinkedTxn[]
                            {
                                new LinkedTxn
                                {
                                    TxnId="234",
                                    TxnType="Bill"
                                }
                            }
                        }
                    },


                };
                BillPayment resultBillPayment = dataService.Add<BillPayment>(billPayment);
            }
            catch (Exception ex1)
            {
                throw ex1;
            }
        }

提前感谢您的正确指导

【问题讨论】:

  • 我终于发现不是 CheckPayment 而是 BillPaymentCheck 属性,我失踪了。

标签: asp.net quickbooks


【解决方案1】:

您的对象中需要一个子对象CheckPayment 来提供特定于支票付款的付款详细信息。

换句话说,您告诉 QuickBooks 这是通过支票支付的:

PayType = BillPaymentTypeEnum.Check,

但你没有告诉它这张支票付款的详细信息:

  "PayType": "Check",
  "CheckPayment": {
    "BankAccountRef": {
      "value": "35",
      "name": "Checking"
    }
  },

如果您参考 Intuit 的文档,您会在他们的示例中看到这一点:

并记录在案:

CheckPayment:
required if PayType is Check
BillPaymentCheck 
Reference to the vendor for this transaction.

CreditCardPayment:
required if PayType is CreditCard
BillPaymentCreditCard, filterable via CCAccountRef, sortable 
Information about a credit card payment for the transaction. Not applicable to Estimate and SalesOrder. Used when PayType is CreditCard.

连同指示的子属性:

BillPaymentCheck 
Reference to the vendor for this transaction.

Child attributes

BankAccountRef:
required
ReferenceType, filterable, sortable 
Reference to the bank account. Query the Account name list resource to determine the appropriate Account object to reference here. Use Account.Id and Account.Name from that object for APAccountRef.value and APAccountRef.name, respectively. The specified account must have Account.AccountType set to Bank and Account.AccountSubType set to Checking.

PrintStatus:
optional
PrintStatusEnum, default is NeedToPrint 
Printing status of the invoice. 
Valid values: NotSet, NeedToPrint, PrintComplete.

【讨论】:

  • 我已经尝试过了,但 CheckPayment 元素不可用。我已经阅读了这些文档。
  • 现在经过很多努力,我发现它不是 CheckPayment 而是 BillPaymentCheck 属性。这是必需的参数。真正的 QuickBooks 对 API 的记录很糟糕.. :(
猜你喜欢
  • 2021-05-03
  • 1970-01-01
  • 2014-07-08
  • 1970-01-01
  • 1970-01-01
  • 2018-09-11
  • 2012-09-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多