This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Request Id support was added in 1.0.9 | |
//https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/010_calling_data_services/00100_requests_and_responses/requestid | |
context = new Context(oauth, appToken, ServiceType.QBD, realmID); | |
Customer customer = new Customer(); | |
customer.setGivenName("Mac Berry"); | |
customer.setDisplayName("L 34"); | |
BatchOperation batchOperation = new BatchOperation(); | |
batchOperation.addEntity(customer, OperationEnum.CREATE, "12"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('../config.php'); | |
require_once(PATH_SDK_ROOT . 'Core/ServiceContext.php'); | |
require_once(PATH_SDK_ROOT . 'PlatformService/PlatformService.php'); | |
require_once(PATH_SDK_ROOT . 'Utility/Configuration/ConfigurationManager.php'); | |
// Tell us whether to use your QBO vs QBD settings, from App.config | |
$serviceType = IntuitServicesType::QBD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Intuit.Ipp.Core; | |
using Intuit.Ipp.Data; | |
using Intuit.Ipp.LinqExtender; | |
using Intuit.Ipp.QueryFilter; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
static class SampleCalls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Intuit.Ipp.Core; | |
using Intuit.Ipp.Data; | |
using Intuit.Ipp.Security; | |
using Intuit.Ipp.Services; | |
using Intuit.Ipp.Data.Extensions; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void CreateQBOInvoice(DataService dataService, ServiceContext context) | |
{ | |
//Find Customer | |
QueryService<Customer> customerQueryService = new QueryService<Customer>(context); | |
Customer customer = customerQueryService.ExecuteIdsQuery("Select * From Customer StartPosition 1 MaxResults 1").FirstOrDefault<Customer>(); | |
//Find Tax Code for Invoice - Searching for a tax code named 'StateSalesTax' in this example | |
QueryService<TaxCode> stateTaxCodeQueryService = new QueryService<TaxCode>(context); | |
TaxCode stateTaxCode = stateTaxCodeQueryService.ExecuteIdsQuery("Select * From TaxCode Where Name='StateSalesTax' StartPosition 1 MaxResults 1").FirstOrDefault<TaxCode>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intuit.Ipp.Data.Qbo.Invoice invoice = new Intuit.Ipp.Data.Qbo.Invoice(); | |
Intuit.Ipp.Data.Qbo.InvoiceHeader invoiceHeader = new Intuit.Ipp.Data.Qbo.InvoiceHeader(); | |
invoiceHeader.DocNumber = "AUTO_GENERATE"; | |
invoiceHeader.TxnDate = new DateTime(2013, 09, 04); | |
invoiceHeader.TxnDateSpecified = true; | |
invoiceHeader.CustomerId = new Intuit.Ipp.Data.Qbo.IdType() { idDomain = Intuit.Ipp.Data.Qbo.idDomainEnum.QBO, Value = "12" }; | |
invoiceHeader.SubTotalAmt = 100; | |
invoiceHeader.SubTotalAmtSpecified = true; | |
invoiceHeader.TotalAmt = 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int institutionLoginId = 3333; //Returned from DiscoverAndAddAccounts call | |
InstitutionLogin institutionLogin = new InstitutionLogin(); //Instantiate the object but do not specify credentials | |
Challenges challenges = new Challenges(); | |
AggregationCategorizationService aggCategorizationService = Services.CADService.GetService(Cache, HttpContext.Current.User.Identity.Name); | |
aggCategorizationService.UpdateInstitutionLogin(institutionLoginId, institutionLogin, true, out challenges); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//List<Item> items = GetQboItemsWithDateTimeFiler(commonService, 1, 100, new DateTime(2013, 6, 30, 11, 0, 0)); | |
public List<Intuit.Ipp.Data.Qbo.Item> GetQboItemsWithDateTimeFiler(DataServices dataServices, int startPage, int resultsPerPage, DateTime filterCreateTimeAfter) | |
{ | |
var filter = "CreateTime :AFTER: " + filterCreateTimeAfter.ToString("yyyy-MM-dd\"T\"HH:mm:sszzz"); | |
var httpWebRequest = WebRequest.Create(dataServices.ServiceContext.BaseUrl + "items/v2/" + dataServices.ServiceContext.RealmId) as HttpWebRequest; | |
if (httpWebRequest != null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string GetQbdPurchaseOrders(DataServices dataServices, int startPage, int chunkSize) | |
{ | |
HttpWebRequest httpWebRequest = WebRequest.Create(dataServices.ServiceContext.BaseUrl + "purchaseorder/v2/" + dataServices.ServiceContext.RealmId) as HttpWebRequest; | |
httpWebRequest.Method = "POST"; | |
httpWebRequest.ContentType = "text/xml"; | |
string requestBody = String.Format("<PurchaseOrderQuery xmlns=\"http://www.intuit.com/sb/cdm/v2\"><StartPage>{0}</StartPage><ChunkSize>{1}</ChunkSize></PurchaseOrderQuery>", startPage, chunkSize); | |
httpWebRequest.Headers.Add("Authorization", GetDevDefinedOAuthHeader(dataServices, httpWebRequest, requestBody.ToString())); | |
UTF8Encoding encoding = new UTF8Encoding(); | |
byte[] content = encoding.GetBytes(requestBody.ToString()); | |
using (var stream = httpWebRequest.GetRequestStream()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable<Customer> customers = GetQboCustomers(dataService, 1, 100, false); | |
public List<Intuit.Ipp.Data.Qbo.Customer> GetQboCustomers(DataServices dataServices, int startPage, int resultsPerPage, bool includeJobs) | |
{ | |
StringBuilder requestXML = new StringBuilder(); | |
StringBuilder responseXML = new StringBuilder(); | |
var requestBody = String.Format("PageNum={0}&ResultsPerPage={1}", startPage, resultsPerPage); | |
if (!includeJobs) { requestBody += "&Filter=IncludeJobs :EQUALS: false"; } |