Create
1 min
The following is an example of creating an Invoice where we are setting every possible field (See Invoice for the available fields). The response will return the exact request data, the new QuickBooks Invoice ID (Id), and the newly created Salesforce Invoice ID (salesforceRecordId). Refer to this example if you want to send invoice as an email during invoice creation. Refer to this example if you want to create an invoice with Bundle items
Note: You can only create one record at a time.
{
action=createInvoice,
responseJSON={
"statusCode": 200,
"invoices": [
{
"TxnTaxDetail": {
"TotalTax": 0
},
"TxnDate": "2021-08-11",
"TotalAmt": 110.00,
"SyncToken": "0",
"sparse": false,
"SFRecordID": "a0A5j000000u97uEAA",
"MetaData": {
"LastUpdatedTime": "2021-11-01T02:40:26-07:00",
"CreateTime": "2021-11-01T02:40:26-07:00"
},
"Line": [
{
"SalesItemLineDetail": {
"UnitPrice": 50,
"TaxCodeRef": {
"value": "TAX"
},
"ServiceDate": "1993-05-25",
"Qty": 2,
"ItemRef": {
"value": "1",
"name": "Services"
}
},
"LineNum": 1,
"Id": "1",
"DetailType": "SalesItemLineDetail",
"Description": "Description",
"Amount": 100.00
},
{
"DetailType": "SubTotalLineDetail",
"Amount": 100.00
},
{
"DetailType": "SalesItemLineDetail",
"Amount": 10.00,
"SalesItemLineDetail": {
"TaxCodeRef": {
"value": "TAX"
},
"ItemRef": {
"value": "SHIPPING_ITEM_ID",
}
}
}
],
"Id": "158",
"EmailStatus": "NotSet",
"DueDate": "2021-09-11",
"DocNumber": "Inv-1201",
"CustomField": [
{
"Type": "StringType",
"StringValue": "Received",
"Name": "Crew #",
"DefinitionId": "1"
}
],
"CustomerRef": {
"value": "29",
"name": "Weiskopf Consulting"
},
"CurrencyRef": {
"value": "USD",
"name": "United States Dollar"
},
"BillAddr": {
"PostalCode": "508238",
"Line3": "Kodad",
"Line2": "First Lane",
"Line1": "1-24",
"Id": "132",
"Country": "India",
"City": "Suryapet"
},
"Balance": 110.00,
"AllowOnlineCreditCardPayment": false,
"AllowOnlineACHPayment": false
}
]
},
timestamp=1635759628120,
validRequest=true,
version=1.0
}