QuickBooks API error when updating - php

I'm attempting to use the QuickBooks API to sync up my company's product list with the workbook's item list. I have gotten through the OAuth system to be able to make read/write requests to the API, but always get an error while attempting to update an object.
The reference that I have been using is here, and within the same documentation is a reference to retrieving an object that I have been able to use just fine. This is the XML that I'm sending. I have been tweaking the XML for a few hours now to no avail.
The error message that I get is "QB item name already exists ERI=420962215". That ERI is my realm ID. It seems like QuickBooks thinks I am trying to add a new item, when I'm trying to modify an existing one. If I omit the name field or leave it null, it gives me an error as well.
The item that I am attempting to modify was created in QuickBooks, then synced through QuickBook's Sync Manager. I then authenticated my app to that workbook and have been able to read data easily. I only have an issue when I attempt to write. I have yet to try creating or deleting an object since I've been stalling out on updating.
I am trying to just set up a simple form on my company's site that will hit the API and update data when saving, but I can't find a way around this error.
Any help would be greatly appreciated. I began to have trouble on Friday and feel like I'm just spinning in circles now. I found a QuickBooks / PHP library and tried looking through it to see if I could find useful information, but it was a bit too large for me to locate what I was looking for, since I think the error is just some incorrect XML.
I have followed all the directions within the update reference and just can't make progress. I've double and triple checked that my authentication works, that the URL is correct, that I'm sending POST and not GET and that my XML matches the XML shown in that example.
UPDATE 2012-03-15
It seems the problem is that the API is not able to update an item that was created through QuickBooks. Ever item has an id and an idDomain, which indicates if it was made through the API (NG) or Quickbooks (QB). An example id/idDomain would be 1/QB or 2556587/NG.
Whenever I was doing this, I was able to perfectly update an item that was made through the API, but not one made through Quickbooks. After looking into the Supported Object Reference, I noticed that item assembly update/create is listed as beta.

It seems that what I wrote in the update is correct. I am not able to update items that were made in quickbooks through the API. I can read items made in quickbooks, I can create items and I can edit items made through the API, but editing an item made in quickbooks through the API returns this error.

A few things:
What URL are you POSTing to?
Can you show the full HTTP response you're getting? IDS has a bad
habit of returning error messages/codes that are sometimes ambiguous
if you don't look at the full XML response.
Some of these fields are not updateable: QtyOnPurchaseOrder,
QtyOnSalesOrder
You do know you can only use IDS/Sync Manager for applications you're
going to resell to other companies, right? i.e. you can't use it for
internal/one-off apps.
You're going to get much better support if you post these questions
to Intuit's developer forums: https://idnforums.intuit.com/

You may consider migrating to QBO V3 it is way better and easy to work with.
there is a very good api made to for this purpose. which you can get here.
https://github.com/consolibyte/quickbooks-php (Made By : Keith Palmer)
i am using this and am very satisfied with it.

Related

How to prevent duplicate invoice in Quickbooks Online API?

I have been trying to integrate Quickbooks Online API with PHP in to my website and I have found an issue where I could keep on creating the same invoice.
Although there have been accepted answer in this forum however it is really being vague not exact.
"If you don't have the TxnID, there really isn't a way to detect a "duplicate" invoice in QuickBooks.Does this mean that upon creation of invoce there is no way to check if an invoice was already create via API?
https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice
When creating an invoice the values returned under "LinkedTxn" field is always empty
"The closest you can get is querying by RefNumber ...there's no guarantee that the invoice that you get back from that query is the invoice that you created."
Still same as first but I have been searching RefNumber under the documentation but I can't seem to find it.
If "RefNumber's" cannot be gauranteed then what are the other
alternatives?
Do I have to handle this on my local or at least add a column on my
local table for indicating if item is already sync?
PS: I also tried to insert txnid on the create invoice field however I wasn't successful.
While testing on sandbox I realized there is this number, what is this called? Can I use this for checking the existing invoice?
The NO. column you're showing in your screenshot is the DocNumber field. It's in the documentation here:
https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/invoice#the-invoice-object
In most cases, the DocNumber is a unique field. But not in all cases (you'll see some exceptions noted in the docs related to France and also to custom document numbers).
The best way to avoid duplicates is to keep track of what you send to QuickBooks on your end. On your end, maintain a list of what you sent to QuickBooks. Don't send it again if you've already sent it.

Laravel 5.4 Cashier - bridging the gap in documentation

I've been working my way through the documentation on Laravels website regarding Cashier. From the sounds of it, it seems like it is exactly what I need. A basic subscription configuration that integrates with Stripe. I am able to follow along fairly easily through the configuration section. Then it switches gears and talks about BrainTree integration for a bit. And then it hops right into creating subscriptions, citing the following code:
$user = User::find(1);
$user->newSubscription('main', 'monthly')->create($stripeToken);
So my first question is - where is "$stripeToken" coming from? I feel like there's a fairly large gap in explanations here. Even when I run the code, it errors out saying $stripeToken could not be found.
Where am I setting/getting the $stripeToken from?
I have attempted to follow other video tutorials on setting up Cashier with Laravel, but these all seem to be outdated, as many of the steps to set it up are no longer relevant in Laravel 5.4. For example:
In the one tutorial, it says that you can check to see if a user is already subscribed to a plan in Stripe via the following:
$user->subscribed('main')
And in the video series, it shows him changing a database field (stripe_active) from 0 to 1, to show a different message in the view. With the new process however, there is no "stripe_active" field even created anymore.
So - at the risk of this being an open-ended vague question, I pose 3 questions to kick things off.
a.) Can anybody tell me how/where I set $stripeToken for the code in the documentation to work?
b.) Can anybody tell me how I can check to see if a subscription exists within Stripe using Cashier 7.0 & Laravel 5.4?
c.) Does anybody know of any good tutorials/videos that walk through this process using the latest versions of each?
You're right-- there's a huge gap in the docs.
A) you need to create a form on the front end view, and generate the token yourself, which you capture via javascript and then submit via POST. It's easiest to do this with Stripe Checkout, but it's more customizable with Stripe Elements.
B) you can see if a User has a subscription in Laravel using the built in methods described here: https://laravel.com/docs/5.4/billing#checking-subscription-status. If you're asking about how to grab Stripe subscriptions by calling Stripe from Laravel, it appears you can do this using $plans = Plan::getStripePlans(); from the stripe/stripe-php library which is a dependency of Laravel Cashier.
C) I found this tutorial to be very helpful, and at the moment it's up to date, though that may change: http://www.qcode.in/subscription-with-coupon-using-laravel-cashier-stripe/

What is the API to get list of all projects from Podio?

I need assistance getting API, using which I can fetch all projects created in my Podio account.
I want to get the JSON feed from it and display it on my website for a different purpose. I went through their document, but I found APIs oriented around tasks, but not specific to getting project names. Am I missing anything?
Please let me know if anyone has done something similar in past.
Most probably you have an app in Podio that you've named "Projects". To fetch all items in that app you need to use Filter items with your app id as the parameter. You find the app id in the item modal under Actions->Developer Info

Fusion Tables insert row with PHP basic example

Is there is an updated PHP client library for Fusion Tables? or maybe a very concrete copy+paste insert rows example?
I I have visited https://code.google.com/p/google-api-php-client/ and downloaded their latest release file, but while having examples for lots of other google apis, I can't find any mention of fusion tables examples.
Additionally I have been trying to get https://github.com/marciuz/fusion-table-php-api-and-shell fantastic project to work, but keep receiving "invalid credentials" errors when using my fusion tables enabled server api key with his shell or with the php examples he uses. This is even for basic SHOW TABLES commands.
Is there a scope issue here I am missing?
Is there a very simple php example I can use to just copy and paste my credentials (clientID, client secret, redirect uri, api key) into and get right to inserting rows into my Fusion Tables? Maybe something like Invalid Credentials Error when passing Oauth 2.0 Access Token to Fusion Tables API in PHP, only hopefully it includes how to create the access token, and helps to insert rows instead of modifying styling?
I am trying to not reinvent the wheel on this one, and have been looking high and low for a simple working example to insert rows, that is not over my inexperienced head. Thank you, this has been literally driving me crazy.
Here is what worked for me:
"Ok so I finally got this to work and I thought Id share this with everyone In case you get stuck like I did. One step that seems to be missing from all usage examples I've seen is the service account email address needs to be added via Google Docs.
Select the document (FT) in Google Docs Click "Share"
Select "Add People" Enter your service account email address, e.g. myservice...#developer.gserviceaccount.com Ensure "Can Edit" is selected. Un-check "notify people via email" Click "Share and Save"
This was a complete guess on my part but seems to have fixed my problem. I can finally insert into my FT via my service account. Hope this helps."
For anyone else looking out there, I found this code and fix very useful for finally getting a solution with the google-api-php-client. https://groups.google.com/forum/#!msg/google-api-php-client/9d2lQAppTvg/vh8CRhWJb_YJ

Salesforce REST Api missing fields with PHP

I'm using the Salesforce REST API and found it very hard to find decent documentation.
I can successfully log in with OAuth and i can push new accounts to Salesforce.
I use the instance url to make the API calls and i send the following fields to create an account object:
Name
Rating
Description
The problem is that I created a free trial (which sits on na9.salesforce.com) and everything worked fine.
I created a second free trial to check if everything works with another account, but the rating field is not available... I get the following message from Salesforce:
"[{"message":"No such column 'rating' on sobject of Account"}]"
Why is that?
Also, is it possible to add notes to a created account using POST? And is it possible to create Leads instead of Accounts using the API?
Thanks in advance,
A feature called field level security (FLS) can mean that even standard fields are not accessible, check the FLS settings on account in your second org.
Docs for the REST API are on the developer force site

Categories