QBO Webhooks Listener

<back to all web services

QboWebhooksRequest

The following routes are available for this service:
POST/qbowebhook
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


class QBOEntityName(IntEnum):
    CUSTOMER = 20
    DEPARTMENT = 21
    VENDOR = 21
    DEPOSIT = 22
    INVOICE = 23
    BILL = 24
    ITEM = 24
    JOURNAL_CODE = 25
    PURCHASE_ORDER = 25
    JOURNAL_ENTRY = 26
    ESTIMATE = 26
    REFUND_RECEIPT = 26
    EMPLOYEE = 27
    SALES_RECEIPT = 27
    TAX_AGENCY = 28
    TERM = 29
    TIME_ACTIVITY = 30
    ACCOUNT = 30
    TRANSFER = 31
    VENDOR_CREDIT = 31
    CREDIT_MEMO = 32
    PURCHASE = 33
    CURRENCY = 33
    PAYMENT = 35
    PAYMENT_METHOD = 36
    BILL_PAYMENT = 36
    PREFERENCES = 37
    BUDGET = 37
    CLASS_ = 38


class QBOOperation(str, Enum):
    UPDATE = 'Update'
    CREATE = 'Create'
    MERGE = 'Merge'
    DELETE = 'Delete'
    EMAILED = 'Emailed'
    VOID = 'Void'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QBOEntity:
    name: Optional[QBOEntityName] = None
    id: Optional[str] = None
    operation: Optional[QBOOperation] = None
    last_updated: datetime.datetime = datetime.datetime(1, 1, 1)
    deleted_id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QBODataChangeEvent:
    entities: Optional[List[QBOEntity]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QBOEventNotification:
    realm_id: Optional[str] = None
    data_change_event: Optional[QBODataChangeEvent] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QboWebhooksRequest:
    event_notifications: Optional[List[QBOEventNotification]] = None

Python QboWebhooksRequest DTOs

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

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	eventNotifications: 
	[
		{
			realmId: String,
			dataChangeEvent: 
			{
				entities: 
				[
					{
						name: Customer,
						id: String,
						operation: Update,
						lastUpdated: 0001-01-01,
						deletedId: String
					}
				]
			}
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

(string)