DataConnector | ComponentOne
In This Topic
    Invoices
    In This Topic

    Insert

    To insert a new invoice, there are two required fields, the Customer and the Line field. There could be one Customer and at least one Line item. Below there is an insert query that inserts an Invoice with CustomerRef=2 and one Line item:

    Example Title
    Copy Code
    INSERT INTO Invoices(CustomerRef, Line)
    VALUES ('2', [
    {
            “DetailType”: “SalesItemLineDetail”,
             "Id": "1",
             "SalesItemLineDetail": {
                 "TaxCodeRef": {
                     "value": "TAX"
                  },
                 "Qty": 8.0,
                 "UnitPrice": 99.99,
                 "ItemRef": {
                     "value": "1",
                     "name": "Services"
                 }
           },
           "LineNum": 1,
           "Amount": 399.99
       }
    ]);

    Table reference

     

    Name Type ReadOnly Filterable Description
    Id [KEY] string true true The Id of the invoice.
    SyncToken string false false The sync token. This must be specified when executing an update or delete.
    MetaData_CreateTime datetime true true The time the record was created.
    MetaData_LastUpdatedTime datetime true true The time the record was last updated.
    CustomField string false false A json aggregate of custom field information.
    DocNumber string false true The reference number for the transaction.
    TxnDate date false true The date entered by the user when this transaction occurred.
    PrivateNote string false false A private note that does not appear on the transaction records.
    TxnStatus string false false The status of the transaction.
    LinkedTxn string false false A json aggregate of transactions linked to the estimate.
    Line string false false A json aggregate of line items associated with the transaction.
    TxnTaxDetail_TxnTaxCodeRef string false false The tax code of the transaction.
    TxnTaxDetail_TxnTaxCodeRef_Name string true false The name of the tax code of the transaction.
    TxnTaxDetail_TotalTax string false false Total tax calculated for the transaction, excluding any tax lines manually inserted into the transaction line list.
    TxnTaxDetail_TaxLine string false false A json aggregate of tax line items.
    CustomerRef string false true The Id of the customer.
    CustomerRef_Name string true false The name of the customer.
    CustomerMemo string false false The message to the customer that appears in the invoice and in the printed invoice.
    BillAddr_Id string false false The Id of the entity for the billing address, mainly used for modifying the address. This field is assigned by the data service.
    BillAddr_Line1 string false false First line of the address.
    BillAddr_Line2 string false false Second line of the address.
    BillAddr_Line3 string false false Third line of the address.
    BillAddr_Line4 string false false Fourth line of the address.
    BillAddr_Line5 string false false Fifth line of the address.
    BillAddr_City string false false City name.
    BillAddr_Country string false false Country name.
    BillAddr_CountrySubDivisionCode string false false Region within a country. For example, the state name for the USA or the province name for Canada.
    BillAddr_PostalCode string false false Postal code. For example, the zip code for the USA and Canada.
    BillAddr_Note string false false Note for the customer.
    BillAddr_Lat string false false The latitude coordinate of the geocoded billing address.
    BillAddr_Long string false false The longitude coordinate of the geocoded billing address.
    ShipAddr_Id string false false The Id of the entity for the shipping address, mainly used for modifying the address. This field is assigned by the data service.
    ShipAddr_Line1 string false false First line of the address.
    ShipAddr_Line2 string false false Second line of the address.
    ShipAddr_Line3 string false false Third line of the address.
    ShipAddr_Line4 string false false Fourth line of the address.
    ShipAddr_Line5 string false false Fifth line of the address.
    ShipAddr_City string false false City name.
    ShipAddr_Country string false false Country name.
    ShipAddr_CountrySubDivisionCode string false false Region within a country. For example, the state name for the USA or the province name for Canada.
    ShipAddr_PostalCode string false false Postal code. For example, the zip code for the USA and Canada.
    ShipAddr_Note string false false Note for the customer.
    ShipAddr_Lat string false false The latitude coordinate of the geocoded shipping address.
    ShipAddr_Long string false false The longitude coordinate of the geocoded shipping address.
    ShipFromAddr_Id string false false The Id of the entity for the address where the goods are shipped from, mainly used for modifying the address. This field is assigned by the data service.
    ShipFromAddr_Line1 string false false First line of the address.
    ShipFromAddr_Line2 string false false Second line of the address.
    ShipFromAddr_Line3 string false false Third line of the address.
    ShipFromAddr_Line4 string false false Fourth line of the address.
    ShipFromAddr_Line5 string false false Fifth line of the address.
    ShipFromAddr_City string false false City name.
    ShipFromAddr_Country string false false Country name.
    ShipFromAddr_CountrySubDivisionCode string false false Region within a country. For example, the state name for the USA or the province name for Canada.
    ShipFromAddr_PostalCode string false false Postal code. For example, the zip code for the USA and Canada.
    ShipFromAddr_Note string false false Note for the customer.
    ShipFromAddr_Lat string false false The latitude coordinate of the geocoded shipping address.
    ShipFromAddr_Long string false false The longitude coordinate of the geocoded shipping address.
    ClassRef string false true The Id of the class associated with the transaction.
    ClassRef_Name string true false The name of the class associated with the transaction.
    SalesTermRef string false false The Id of the sales term associated with the transaction.
    SalesTermRef_Name string true false The name of the sales term associated with the transaction.
    DueDate date false true The date when the invoice is to be paid, not including any early payment discount incentives or late payment penalties. If the date is not supplied, the current date on the server is used.
    ShipMethodRef string false false The Id of the shipping method associated with the transaction.
    ShipMethodRef_Name string true false The name of the shipping method associated with the transaction.
    ShipDate date false false The date for delivery of goods or services.
    TrackingNum string false false The tracking number for the shipping provider for the delivery of the goods associated with the transaction.
    TotalAmt decimal true true This field indicates the total amount of the transaction. This includes the total of all the charges, allowances, and taxes.
    PrintStatus string false false The print status of the invoice.
    EmailStatus string false false The email status of the invoice.
    BillEmail_Address string false false The email address where the invoice is sent. If the value of EmailStatus is NeedToSend, BillEmail is a required input.
    BillEmailCc_Address string false false The email address where the invoice is sent as CC.
    BillEmailBcc_Address string false false The email address where the invoice is sent as BCC.
    Balance decimal true true This field indicates whether the transaction is a finance charge.
    PaymentRefNum string false false The reference number for the payment.
    PaymentMethodRef string false false The Id of the payment method.
    PaymentMethodRef_Name string true false The name of the payment method.
    DepositToAccountRef string false false The asset account where the payment money is deposited. If you do not specify this account, QuickBooks Online uses the Undeposited Funds account.
    DepositToAccountRef_Name string true false Name of the asset account where the payment money is deposited. If you do not specify this account, QuickBooks Online uses the Undeposited Funds account.
    DeliveryInfo_DeliveryType string false false Type of the delivery. Used to confirm that email has been sent via the send operation.
    DeliveryInfo_DeliveryTime datetime false false Delivery date and time.
    Deposit decimal false false The deposit made towards this invoice.
    DepartmentRef string false false The Id of the department, which stores the location of the transaction as defined using location tracking in QuickBooks Online.
    DepartmentRef_Name string true false The name of the department, which store the location of the transaction as defined using location tracking in QuickBooks Online.
    AllowIPNPayment boolean false false This field indicates whether the invoice can be paid online using the Intuit Payment Network.
    ApplyTaxAfterDiscount boolean false false This field sets whether discounts are applied before the tax is calculated.
    CurrencyRef string false false The Id of the currency used in the transaction.
    CurrencyRef_Name string true false The name of the currency used in the transaction.
    ExchangeRate decimal false false The currency exchange rate. This field is valid only if the company file is set up to use the multicurrency feature. In QuickBooks, exchange rates are always recorded as the number of home currency units it takes to equal one foreign currency unit.This field is available for the UK, AU, IN, and CA editions.
    GlobalTaxCalculation string false false The method in which tax is applied. This field is valid in the UK, AU, IN, and CA editions.
    HomeTotalAmt decimal true false Total amount of the transaction in the home currency. Includes the total of all the charges, allowances, and taxes. This field is valid in the UK, AU, IN, and CA editions.
    HomeBalance decimal true false Convenience field containing the amount in Balance expressed in terms of the home currency. Calculated by QuickBooks business logic. Value is valid only when CurrencyRef is specified.
    InvoiceLink string true false Sharable link for the invoice sent to external customers.