Logo
Home

Request ID update for QuickBooks Online integration

If you are developing a QuickBooks Online integation, the RequestID uniquely identifies the HTTP request sent from the app to the service and enables the app to correlate requests and responses, in case the app needs to resend a request because of a dropped connection. 

We strongly recommend all developers to send in the RequestID for every API request so that idempotency is guaranteed and we are able to replay the request back to you without any state changes in the event of a service disruption. This also ensures that data is not duplicated in the event of a disruption.

In the request, the app specifies the RequestID as a query string parameter. If the service receives another request with the same RequestID, instead of performing the operation again or returning an error, the service sends the same response as it did for the original request. 

  • The RequestID your app specifies as the query parameter must be unique for all requests for a given company.
  • The RequestID can have a maximum of 50 characters for all operations except batch.
  • For batch operations, the RequestID supports a maximum of 36 characters. For each batch ID, only 10 characters are allowed when RequestID is also specified.
  • To avoid duplicate IDs, the app is responsible for generating a unique ID for each request. It is recommended to generate requestid values with a library such as java.util.UUID or .NET System.GUID.

 The following scenario shows how an app might use the RequestID in a create operation:

  1. The app sends a request to create an invoice, specifying the RequestID 4957: baseURL/company/1234/invoice?requestid=4957
  2. The service processes the request to create the invoice.
  3. The app loses its connection and does not receive the response.
  4. The app sends the request to create the invoice again, specifying the same content and requestid as the first request.
  5. The service determines that the RequestID has been sent before, so it sends the same response as in step 2.  (If the app had not specified a RequestID, the service would create a duplicate invoice with a new entity ID.)
  6. The app receives the response and verifies that it contains no errors.

 Advantages of using RequestID

The following two sequence diagrams depict the advantages of using RequestID and disadvantages of not using RequestID.

 requestid


Posted

in

by

Tags:

Comments

3 responses to “Request ID update for QuickBooks Online integration”

  1. Santosh Giri Avatar
    Santosh Giri

    Hello Intuit,
    Does this work in case of Customers as well?
    What if I send a request to create Invoice with RequestId in parameter as 123(unique) and get the Success response and again I send the same invoice create request with same RequestId. Will it returns with same Invoice XML or duplicate?

  2. Andrew Avatar
    Andrew

    As Stantosh Giri noted, it seems like this doesn’t work for Customers or Items. Your blog post and the docs make it sound like it should work for all requests. If that’s not the case you should make that clear.

  3. Bruce Avatar
    Bruce

    Note – “It doesn’t get expired. It is recommended to generate values with a library such as java.util.UUID or .NET System.GUID”

Leave a Reply

Your email address will not be published. Required fields are marked *