QBO Webhooks Listener

<back to all web services

QboWebhooksRequest

The following routes are available for this service:
POST/qbowebhook
import Foundation
import ServiceStack

// @DataContract
public class QboWebhooksRequest : Codable
{
    // @DataMember(Name="eventNotifications")
    public var eventNotifications:[QBOEventNotification]

    required public init(){}
}

public class QBOEventNotification : Codable
{
    // @DataMember(Name="realmId")
    public var realmId:String

    // @DataMember(Name="dataChangeEvent")
    public var dataChangeEvent:QBODataChangeEvent

    required public init(){}
}

public class QBODataChangeEvent : Codable
{
    // @DataMember(Name="entities")
    public var entities:[QBOEntity]

    required public init(){}
}

public class QBOEntity : Codable
{
    // @DataMember(Name="name")
    public var name:QBOEntityName

    // @DataMember(Name="id")
    public var id:String

    // @DataMember(Name="operation")
    public var operation:QBOOperation

    // @DataMember(Name="lastUpdated")
    public var lastUpdated:Date

    // @DataMember(Name="deletedId")
    public var deletedId:String

    required public init(){}
}

public enum QBOEntityName : Int, Codable
{
    case Customer = 20
    case Department = 21
    case Vendor = 21
    case Deposit = 22
    case Invoice = 23
    case Bill = 24
    case Item = 24
    case JournalCode = 25
    case PurchaseOrder = 25
    case JournalEntry = 26
    case Estimate = 26
    case RefundReceipt = 26
    case Employee = 27
    case SalesReceipt = 27
    case TaxAgency = 28
    case Term = 29
    case TimeActivity = 30
    case Account = 30
    case Transfer = 31
    case VendorCredit = 31
    case CreditMemo = 32
    case Purchase = 33
    case Currency = 33
    case Payment = 35
    case PaymentMethod = 36
    case BillPayment = 36
    case Preferences = 37
    case Budget = 37
    case Class = 38
}

public enum QBOOperation : String, Codable
{
    case Update
    case Create
    case Merge
    case Delete
    case Emailed
    case Void
}


Swift QboWebhooksRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + 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)