| POST | /qbowebhook |
|---|
"use strict";
/** @typedef {number} */
export var QBOEntityName;
(function (QBOEntityName) {
QBOEntityName[QBOEntityName["Customer"] = 20] = "Customer"
QBOEntityName[QBOEntityName["Department"] = 21] = "Department"
QBOEntityName[QBOEntityName["Vendor"] = 21] = "Vendor"
QBOEntityName[QBOEntityName["Deposit"] = 22] = "Deposit"
QBOEntityName[QBOEntityName["Invoice"] = 23] = "Invoice"
QBOEntityName[QBOEntityName["Bill"] = 24] = "Bill"
QBOEntityName[QBOEntityName["Item"] = 24] = "Item"
QBOEntityName[QBOEntityName["JournalCode"] = 25] = "JournalCode"
QBOEntityName[QBOEntityName["PurchaseOrder"] = 25] = "PurchaseOrder"
QBOEntityName[QBOEntityName["JournalEntry"] = 26] = "JournalEntry"
QBOEntityName[QBOEntityName["Estimate"] = 26] = "Estimate"
QBOEntityName[QBOEntityName["RefundReceipt"] = 26] = "RefundReceipt"
QBOEntityName[QBOEntityName["Employee"] = 27] = "Employee"
QBOEntityName[QBOEntityName["SalesReceipt"] = 27] = "SalesReceipt"
QBOEntityName[QBOEntityName["TaxAgency"] = 28] = "TaxAgency"
QBOEntityName[QBOEntityName["Term"] = 29] = "Term"
QBOEntityName[QBOEntityName["TimeActivity"] = 30] = "TimeActivity"
QBOEntityName[QBOEntityName["Account"] = 30] = "Account"
QBOEntityName[QBOEntityName["Transfer"] = 31] = "Transfer"
QBOEntityName[QBOEntityName["VendorCredit"] = 31] = "VendorCredit"
QBOEntityName[QBOEntityName["CreditMemo"] = 32] = "CreditMemo"
QBOEntityName[QBOEntityName["Purchase"] = 33] = "Purchase"
QBOEntityName[QBOEntityName["Currency"] = 33] = "Currency"
QBOEntityName[QBOEntityName["Payment"] = 35] = "Payment"
QBOEntityName[QBOEntityName["PaymentMethod"] = 36] = "PaymentMethod"
QBOEntityName[QBOEntityName["BillPayment"] = 36] = "BillPayment"
QBOEntityName[QBOEntityName["Preferences"] = 37] = "Preferences"
QBOEntityName[QBOEntityName["Budget"] = 37] = "Budget"
QBOEntityName[QBOEntityName["Class"] = 38] = "Class"
})(QBOEntityName || (QBOEntityName = {}));
/** @typedef {'Update'|'Create'|'Merge'|'Delete'|'Emailed'|'Void'} */
export var QBOOperation;
(function (QBOOperation) {
QBOOperation["Update"] = "Update"
QBOOperation["Create"] = "Create"
QBOOperation["Merge"] = "Merge"
QBOOperation["Delete"] = "Delete"
QBOOperation["Emailed"] = "Emailed"
QBOOperation["Void"] = "Void"
})(QBOOperation || (QBOOperation = {}));
export class QBOEntity {
/** @param {{name?:QBOEntityName,id?:string,operation?:QBOOperation,lastUpdated?:string,deletedId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {QBOEntityName} */
name;
/** @type {string} */
id;
/** @type {QBOOperation} */
operation;
/** @type {string} */
lastUpdated;
/** @type {string} */
deletedId;
}
export class QBODataChangeEvent {
/** @param {{entities?:QBOEntity[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {QBOEntity[]} */
entities;
}
export class QBOEventNotification {
/** @param {{realmId?:string,dataChangeEvent?:QBODataChangeEvent}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
realmId;
/** @type {QBODataChangeEvent} */
dataChangeEvent;
}
export class QboWebhooksRequest {
/** @param {{eventNotifications?:QBOEventNotification[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {QBOEventNotification[]} */
eventNotifications;
}
JavaScript QboWebhooksRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /qbowebhook HTTP/1.1
Host: wh.entersecurity.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<QboWebhooksRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ESI.Service.QBOWebhooksListener">
<eventNotifications>
<QBOEventNotification>
<DataChangeEvent>
<Entities>
<QBOEntity>
<DeletedId>String</DeletedId>
<Id>String</Id>
<LastUpdated>0001-01-01T00:00:00</LastUpdated>
<Name>Customer</Name>
<Operation>Update</Operation>
</QBOEntity>
</Entities>
</DataChangeEvent>
<RealmId>String</RealmId>
</QBOEventNotification>
</eventNotifications>
</QboWebhooksRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length (string)