I'm getting an error when I create a sales receipt with this code:
salesreceipt = Quickbooks::Model::SalesReceipt.new({
customer_id: 99,
txn_date: Date.civil(2013, 11, 20),
payment_ref_number: "111", #optional payment reference number/string - e.g. stripe token
deposit_to_account_id: 222, #The ID of the Account entity you want the SalesReceipt to be deposited to
payment_method_id: 333 #The ID of the PaymentMethod entity you want to be used for this transaction
})
salesreceipt.auto_doc_number! #allows Intuit to auto-generate the transaction number
line_item = Quickbooks::Model::Line.new
line_item.amount = 50
line_item.description = "Plush Baby Doll"
line_item.sales_item! do |detail|
detail.unit_price = 50
detail.quantity = 1
detail.item_id = 500 # Item (Product/Service) ID here
end
salesreceipt.line_items << line_item
oauth_client = OAuth::AccessToken.new(QB_OAUTH_CONSUMER,
current_account.quickbooks_token,
current_account.quickbooks_secret)
service = Quickbooks::Service::Invoice.new
service.access_token = oauth_client
service.company_id = current_account.quickbooks_realm_id
created_receipt = service.create(salesreceipt)
Here is the error I am getting:
Quickbooks::IntuitRequestException (Unsupported Operation:
Operation Bad arguments passed to public com.intuit.schema.finance.v3.IntuitResponse com.intuit.qbo.bl.txns.servicev3.rest.Invoice.doAllOperations(java.lang.String,com.intuit.schema.finance.v3.Invoice,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,javax.servlet.http.HttpServletRequest,java.lang.String) throws com.intuit.qbo.v3.common_lib.FdmException ( java.lang.String 409454416, com.intuit.schema.finance.v3.SalesReceipt com.intuit.schema.finance.v3.SalesReceipt@1c1ace37, null, null, null, null, null, com.sun.proxy.$Proxy107 org.apache.catalina.connector.RequestFacade@31809b41, null ) is not supported.):
I'm getting an error when I create a sales receipt with this code:
Here is the error I am getting:
Here is the request: