![]() ![]() Add an invoice $invoice = new IPPInvoice () $invoice -> Deposit = 0 $invoice -> domain = "QBO" $invoice -> AutoDocNumber = true $invoice -> TxnDate = date ( 'Y-m-d', time ()) $invoice -> CustomerRef = "66" $invoice -> PrivateNote = "SomeNote" $invoice -> TxnStatus = "Payable" $line = new IPPLine () $line -> Id = "0" $line -> LineNum = "1" $line -> Description = "test" $line -> Amount = 1000 $line -> DetailType = "DescriptionOnly" $sub_line = new IPPLine () $sub_line -> Id = "0" $sub_line -> LineNum = "2" $sub_line -> Description = "Sub Total" $sub_line -> Amount = 2000 $sub_line -> DetailType = "SubtotalLineDetail" $invoice -> Line = array ( $line, $sub_line ) $invoice -> RemitToRef = "66" $invoice -> TotalAmt = 1000 $invoice -> FinanceCharge = 'false' // Add a invoice $resultingInvoiceObj = $dataService -> Add ( $invoice ) Our Invoice has been updated successfully. We put this body in our code, and make an update call. ![]() Use QuickBooksOnline\API\Core\ServiceContext use QuickBooksOnline\API\DataService\DataService use QuickBooksOnline\API\Core\Http\Serialization\XmlObjectSerializer use QuickBooksOnline\API\Facades\Invoice // Prep Data Services $dataService = DataService :: Configure ( array ( 'auth_mode' => 'oauth1', 'consumerKey' => "qyprdUSoVpIHrtBp0eDMTHGz8UXuSz", 'consumerSecret' => "TKKBfdlU1I1GEqB9P3AZlybdC8YxW5qFSbuShkG7", 'accessTokenKey' => "qyprdxccscoNl7KRbUJoaJQIhUvyXRzD9tNOlXn4DhRDoj4g", 'accessTokenSecret' => "JqkHSBKzNHbqjMq0Njbcq8fjgJSpfjMvqHVWnDOW", 'QBORealmID' => "193514464689044", 'baseUrl' => "Development" )) $dataService -> setLogLocation ( "/location/to/newFolderForLog" ) $dataService -> throwExceptionOnError ( true ) //Add a new Invoice $invoiceToCreate = Invoice :: create ( ] ] ], "CustomerRef" => ]) $resultObj = $dataService -> Add ( $invoiceToCreate ) $error = $dataService -> getLastError () if ( $error ) To find out what information we need to provide in the SalesItemLine, we refer back to the API reference page again: For our Invoice, we will use SalesItemLine to represent the sewing service we provide to Alex. QuickBooks Online has five types of Line Item: SalesItemLine, GroupItemLine, DescriptionOnly, DiscountLine, and SubtotalLine. QuickBooks Online identifies the goods/services for an entity by extracting information from what it called Line Item. Refer to the Query and access resources (GET) section for how to find the Id of a Name list resourcesĪfter the Customer is provided, QuickBooks Online will need information about the goods/services we provide.The field name is not required here, only value is.For all the keys we use in the QuickBooks V3 SDK, they all have the same name as our docs. The key, CustomerRef we use in our array has the SAME name displayed on our documentation page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |