?z      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy Copyright : Maintainer : Portability :None!"&345>CLLmAn invoice transaction entity, that is, a sales form where the customer pays for a product or service later.Business rules:"An invoice must have at least one  that describes an item.An invoice must have a .#In order to create an invoice, use ..#A reference to a customer or a job.Example:A(reference "21") {referenceName = Just "John Doe"} :: CustomerRef[Reference {referenceName = Just "John Doe", referenceType = Nothing, referenceValue = "21"}2A reference. In order to create a reference, use -.)An individual line item of a transaction.Details of a subtotal line.PDetails of a sales item line. In order to create a sales item line detail, use *.Details of a discount line.Details of a description line.  A request or access OAuth token.QuickBooks Application Keys*<Create a sales item line detail with a reference to an item.Example:blet aSalesItemLineDetail = salesItemLineDetail ((reference "1") {referenceName = Just "Services"})/salesItemLineDetailItemRef aSalesItemLineDetailaJust (Reference {referenceName = Just "Services", referenceType = Nothing, referenceValue = "1"})+1Create a sales item line with amount and details.Example:blet aSalesItemLineDetail = salesItemLineDetail ((reference "1") {referenceName = Just "Services"})=let aSalesItemLine = salesItemLine 100.0 aSalesItemLineDetail,cif you are using a salesItemLineDetail that has a Qty and a price it generates amount automatically- Create a reference with a value.Example:reference "21"SReference {referenceName = Nothing, referenceType = Nothing, referenceValue = "21"}. Create an L with the minimum elements.Example:.let customer21 = reference "21" :: CustomerRefblet aSalesItemLineDetail = salesItemLineDetail ((reference "1") {referenceName = Just "Services"})=let aSalesItemLine = salesItemLine 100.0 aSalesItemLineDetail:let anInvoice = defaultInvoice [aSalesItemLine] customer21R  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-.The line items of a transaction Reference to a customer or a job/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS-  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-.j;:9     8()7'6%&5$4"#3 !210/*+,-|}~wxyz{stuvLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr.IJKFGH !"#$%&'()*+,-./0123456789:;<=>?@ABCDE <<==>>??@@AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSc  %!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL&MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~       *+,-./0123 !4"#5$6%&7'8()9:;<=>?@ABCDEFGHIJKLMNOPQRSNone345TUVWzTUVWVWTUTUVWzNone&345INXTemporary OAuthTokenYTemporary Token$OAuthVerifier provided by QuickBooks[OAuthToken Z{Endpoint to request the tokenURL parameter nameURL parameter valueSigning function|[}~\XYZ[\XY[\ZXYZ{|[}~\ Copyright : Maintainer : Portability :None &345]]]] Copyright : Maintainer : Portability :None&'345>IKLN^Create an invoice._Update an invoice.`Read an invoice.aDelete an invoice.bemail and invoice^_`ab^_`ab^`_ab^_`ab Copyright : Maintainer : Portability :None &345ccccNone 345>Ld:{  do eitherQueryCustomer <-: queryCustomer oAuthToken "Rondonuwu Fruit and Vegi" case eitherQueryCustomer of9 Right (QuickBooksCustomerResponse (customer:_)) ->$ print (customerId customer) _ -> putStrLn "Nothing":} Just "21"f:{4 do eitherQueryItem <- queryItem oAuthToken "Hours" case eitherQueryItem of1 Right (QuickBooksItemResponse (item:_)) -> print (itemId item) _ -> putStrLn "Nothing":}Just "2"hCreate an invoice.Example:import Data.Maybe (fromJust):{/do resp <- createInvoice oAuthToken testInvoice case resp of> Left err -> putStrLn $ "My custom error message: " ++ err4 Right (QuickBooksInvoiceResponse invoice) -> dod deleteInvoice oAuthToken (fromJust (invoiceId invoice)) (fromJust (invoiceSyncToken invoice))' putStrLn "I created an invoice!":}I created an invoice!/Note that we deleted the item we created using n.iWLike createInvoice but accepts an APIConfig rather than reading it from the environmentjDRetrieve the details of an invoice that has been previously created.Example:!First, we create an invoice (see h):import Data.Maybe (fromJust)RRight (QuickBooksInvoiceResponse cInvoice) <- createInvoice oAuthToken testInvoiceJThen, we read the invoice and test that it is the same invoice we created:.let cInvoiceId = fromJust (invoiceId cInvoice):{9do eitherReadInvoice <- readInvoice oAuthToken cInvoiceId case eitherReadInvoice of Left _ -> return FalseP Right (QuickBooksInvoiceResponse rInvoice) -> return (cInvoice == rInvoice):}True*Finally, we delete the invoice we created:JdeleteInvoice oAuthToken cInvoiceId (fromJust (invoiceSyncToken cInvoice))kULike readInvoice but accepts an APIConfig rather than reading it from the environmentlUpdate an invoice.Example:!First, we create an invoice (see h):import Data.Maybe (fromJust)RRight (QuickBooksInvoiceResponse cInvoice) <- createInvoice oAuthToken testInvoice6Then, we update the customer reference of the invoice:Nlet nInvoice = cInvoice { invoiceCustomerRef = Reference Nothing Nothing "1" }:{;do eitherUpdateInvoice <- updateInvoice oAuthToken nInvoice case eitherUpdateInvoice of Left _ -> return False2 Right (QuickBooksInvoiceResponse uInvoice) ->J return (invoiceCustomerRef cInvoice == invoiceCustomerRef uInvoice):}False*Finally, we delete the invoice we created:_deleteInvoice oAuthToken (fromJust (invoiceId cInvoice)) (fromJust (invoiceSyncToken cInvoice))mWLike updateInvoice but accepts an APIConfig rather than reading it from the environmentnDelete an invoice.Example:!First, we create an invoice (see h):import Data.Maybe (fromJust)RRight (QuickBooksInvoiceResponse cInvoice) <- createInvoice oAuthToken testInvoiceThen, we delete it:.let cInvoiceId = fromJust (invoiceId cInvoice)<let cInvoiceSyncToken = fromJust (invoiceSyncToken cInvoice):{Odo eitherDeleteInvoice <- deleteInvoice oAuthToken cInvoiceId cInvoiceSyncToken case eitherDeleteInvoice of Left e -> putStrLn e0 Right _ -> putStrLn "I deleted an invoice!":}I deleted an invoice!oWLike deleteInvoice but accepts an APIConfig rather than reading it from the environmentpSend an invoice via email.Example:!First, we create an invoice (see h):import Data.Maybe (fromJust)RRight (QuickBooksInvoiceResponse cInvoice) <- createInvoice oAuthToken testInvoice$Then, we send the invoice via email:.let cInvoiceId = fromJust (invoiceId cInvoice)7let testEmail = fromJust (emailAddress "test@test.com"):{Cdo eitherSendInvoice <- sendInvoice oAuthToken cInvoiceId testEmail case eitherSendInvoice of Left e -> putStrLn e- Right _ -> putStrLn "I sent an invoice!":}I sent an invoice!*Finally, we delete the invoice we created:JdeleteInvoice oAuthToken cInvoiceId (fromJust (invoiceSyncToken cInvoice))r+Get temporary tokens to request permission.Example::{0do eitherTempTokens <- getTempTokens "localhost" case eitherTempTokens of Left e -> putStrLn e3 Right _ -> putStrLn "I got my request tokens!":}...I got my request tokens!t)Exchange oauth_verifier for access tokensv@Invalidate an OAuth access token and disconnect from QuickBooks.defghijklmnopqrstuvwxyC  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-.\defghijklmnopqrstuvwxyturs\vwhijklmnopqxydefgdefghijklmnopqrstuvwxy      !"#$%&''())*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNOPPQRRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrpstuvwxyz{quick_I0vXRuOMIFq84j0q4pBYwz QuickBooksQuickBooks.TypesQuickBooks.LoggingQuickBooks.AuthenticationQuickBooks.CustomerQuickBooks.InvoiceQuickBooks.Itememail_852PUaAoFuMCJCuSp1iWYgText.Email.Validate emailAddressText.Email.Parser EmailAddressItemitemId itemSyncToken itemMetaDataitemNameitemDescription itemActive itemSubItem itemParentRef itemLevelitemFullyQualifiedName itemTaxableitemSalesTaxInclusive itemUnitPriceitemTypeitemIncomeAccountRefitemPurchaseDescitemPurchaseTaxInclusiveitemPurchaseCostitemExpenseAccountRefitemAssetAccountRefitemTrackQtyOnHand itemQtyOnHanditemSalesTaxCodeRefitemPurchaseTaxCodeRefitemInvStartDate ItemResponseitemResponseItemCustomer customerIdcustomerSyncTokencustomerMetaData customerTitlecustomerGivenNamecustomerMiddleNamecustomerFamilyNamecustomerSuffixcustomerFullyQualifiedNamecustomerCompanyNamecustomerDisplayNamecustomerPrintOnCheckNamecustomerActivecustomerPrimaryPhonecustomerAlternatePhonecustomerMobile customerFaxcustomerPrimaryEmailAddresscustomerWebAddrcustomerDefaultTaxCodeRefcustomerTaxablecustomerBillAddrcustomerShipAddr customerNotes customerJobcustomerBillWithParentcustomerParentRef customerLevelcustomerSalesTermRefcustomerPaymentMethodRefcustomerBalancecustomerOpenBalanceDatecustomerBalanceWithJobscustomerCurrencyRefcustomerPreferredDeliveryMethodcustomerResaleNumCustomerResponsecustomerResponseCustomerInvoiceResponseinvoiceResponseInvoiceInvoice invoiceIdinvoiceSyncTokeninvoiceMetaDatainvoiceCustomFieldinvoiceDocNumberinvoiceTxnDateinvoiceDepartmentRefinvoiceCurrencyRefinvoiceExchangeRateinvoicePrivateNoteinvoiceLinkedTxn invoiceLineinvoiceTxnTaxDetailinvoiceCustomerRefinvoiceCustomerMemoinvoiceBillAddrinvoiceShipAddrinvoiceClassRefinvoiceSalesTermRefinvoiceDueDateinvoiceGlobalTaxCalculationinvoiceShipMethodRefinvoiceShipDateinvoiceTrackingNuminvoiceTotalAmtinvoiceHomeTotalAmtinvoiceApplyTaxAfterDiscountinvoicePrintStatusinvoiceEmailStatusinvoiceBillEmailinvoiceDeliveryInfoinvoiceBalanceinvoiceDepositToAccountRefinvoiceDepositinvoiceAllowIPNPayment invoiceDomain invoiceSparseGlobalTaxModel NotApplicable TaxExcluded TaxInclusiveCustomFieldType BooleanTypeDateType NumberType StringType CustomFieldcustomFieldDefinitionIdcustomFieldNamecustomFieldTypecustomFieldStringValuecustomFieldBooleanValuecustomFieldDateValuecustomFieldNumberValue LinkedTxn linkedTxnId linkedTxnTypelinkedTxnLineId DeliveryInfodeliveryInfoDeliveryTypedeliveryInfoDeliveryTime TxnTaxDetailtxnTaxDetailTxnTaxCodeReftxnTaxDetailTotalTaxtxnTaxDetailTaxLineShipAddrBillAddrPhysicalAddressphysicalAddressIdphysicalAddressLine1physicalAddressLine2physicalAddressLine3physicalAddressLine4physicalAddressLine5physicalAddressCityphysicalAddressCountry%physicalAddressCountrySubDivisionCodephysicalAddressPostalCodephysicalAddressNotephysicalAddressLatphysicalAddressLongWebSiteAddress WebAddresswebSiteAddressURITelephoneNumbertelephoneNumberFreeFormNumberModificationMetaDatamodificationMetaDataCreateTime#modificationMetaDataLastUpdatedTime TxnTaxCodeRef TaxCodeRef ShipMethodRef SalesTermRef PriceLevelRefItemRef DiscountRefDiscountAccountRefDepositToAccountRef DepartmentRef CustomerRef CurrencyRefClassRef Reference referenceName referenceTypereferenceValueDeletedInvoicedeletedInvoiceIddeletedInvoicedomaindeletedInvoicestatusDeletedInvoiceIdunDeletedInvoiceIdLinelineId lineLineNumlineDescription lineAmount lineLinkedTxnlineDetailTypelineDescriptionLineDetaillineDiscountLineDetaillineSalesItemLineDetaillineSubTotalLineDetaillineCustomFieldSubTotalLineDetailsubtotalLineDetailItemRefSalesItemLineDetailsalesItemLineDetailItemRefsalesItemLineDetailClassRefsalesItemLineDetailUnitPricesalesItemLineDetailRatePercent salesItemLineDetailPriceLevelRefsalesItemLineDetailMarkupInfosalesItemLineDetailQtysalesItemLineDetailTaxCodeRefsalesItemLineDetailServiceData"salesItemLineDetailTaxInclusiveAmtDiscountLineDetaildiscountLineDetailDiscountRefdiscountLineDetailPercentBased!discountLineDetailDiscountPercent$discountLineDetailDiscountAccountRefDescriptionLineDetail descriptionLineDetailServiceDatedescriptionLineDetailTaxCodeRef SyncToken unSyncTokenLineIdunLineId InvoiceId unInvoiceIdQuickBooksRequest CreateInvoice ReadInvoice UpdateInvoice DeleteInvoice SendInvoice QueryCustomer QueryItemQuickBooksOAuthRequestGetTempOAuthCredentialsGetAccessTokensDisconnectQuickBooksQuickBooksOAuthQueryQuickBooksQueryQuickBooksResponse OAuthTokentoken tokenSecret NetworkEnvAppEnvAPIEnv APIConfig companyId oauthToken oauthSecrethostnameloggingEnabled AppConfig consumerTokenconsumerSecret OAuthVerifierunOAuthVerifier CallbackURLLoggerQuickBooksItemResponsequickBooksResponseItemQuickBooksCustomerResponsequickBooksResponseCustomerQuickBooksVoidResponseQuickBooksAuthResponsetokens QuickBooksDeletedInvoiceResponseQuickBooksInvoiceResponsequickBooksResponseInvoicesalesItemLineDetail salesItemLineemptySalesItemLine referencedefaultInvoice$fFromJSONQuickBooksResponse$fFromJSONQuickBooksResponse0$fFromJSONQuickBooksResponse1$fFromJSONQuickBooksResponse2TFCo:R:QuickBooksResponse[]TFCo:R:QuickBooksResponse[]0TFCo:R:QuickBooksResponse()#TFCo:R:QuickBooksResponseOAuthToken'TFCo:R:QuickBooksResponseDeletedInvoice TFCo:R:QuickBooksResponseInvoice$fToJSONAPIConfig$fFromJSONAPIConfig$fFromJSONAppConfig$fFromJSONCustomer$fFromJSONCustomerResponse$fFromJSONItem$fFromJSONItemResponse$fFromJSONTelephoneNumber$fFromJSONWebSiteAddress$fFromJSONCustomField$fFromJSONCustomFieldType$fFromJSONDeliveryInfo$fFromJSONDescriptionLineDetail$fFromJSONDiscountLineDetail$fFromJSONEmailAddress$fFromJSONGlobalTaxModel$fFromJSONInvoice$fFromJSONInvoiceResponse$fFromJSONLine$fFromJSONLinkedTxn$fFromJSONModificationMetaData$fFromJSONPhysicalAddress$fFromJSONReference$fFromJSONSalesItemLineDetail$fFromJSONSubTotalLineDetail$fFromJSONTxnTaxDetail$fFromJSONDeletedInvoice apiLogger getLogger logAPICall logAPICall'getTempOAuthCredentialsRequestgetAccessTokensRequestdisconnectRequestoauthSignRequestauthorizationURLForTokenqueryCustomerRequestcreateInvoiceRequestupdateInvoiceRequestreadInvoiceRequestdeleteInvoiceRequestsendInvoiceRequestqueryItemRequest queryCustomerqueryCustomer' queryItem queryItem' createInvoicecreateInvoice' readInvoice readInvoice' updateInvoiceupdateInvoice' deleteInvoicedeleteInvoice' sendInvoice sendInvoice' getTempTokensgetTempTokens'getAccessTokensgetAccessTokens'cancelOAuthAuthorizationcancelOAuthAuthorization'readAPIConfigFromFilereadAppConfigFromFilerequestLogLine getTokensoauthSignRequestWithVerifier$oauthSignRequestWithEmptyCredentials disconnectURLaccessTokenURLtemporaryTokenURLauthorizationURLhandleQuickBooksTokenResponsetokensFromResponsequeryURITemplateinvoiceURITemplate postInvoicequeryQuickBooksqueryQuickBooks'queryQuickBooksOAuthqueryQuickBooksOAuth' readAPIConfig readAppConfiglookupAPIConfiglookupAppConfig