You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,12 +63,27 @@ BREAKING CHANGE: use JavaScript features not available in Node 6
63
63
We are using [OpenAPI generator](https://github.com/OpenAPITools/openapi-generator) along with these OAS yaml files to generate our new SDKs.
64
64
65
65
## Preview
66
+
### Online
66
67
There are lots of tools available for viewing and editing OpenAPI descriptions in a nicely formatted way. A popular tool is SwaggerHub - a version of which is [hosted here](https://app.swaggerhub.com/home).
67
68
68
69
Once you sign up or login, you can create a new API under your account and import a Xero API spec.
69
70
70
71

71
72
73
+
### Local
74
+
75
+
#### Node.js
76
+
If you have Node.js you can use the Swagger UI via an NPM package (it will open a webpage in your default browser):
- description: The Xero Webhooks API exposes event notifications relating to entities in the Xero Public API and can be used for a variety of purposes.
12
+
- description: The Xero Webhooks API exposes event notifications relating to entities in the Xero Public API and can be used for a variety of purposes
13
13
url: https://api.xero.com
14
+
security: []
14
15
webhooks:
15
16
invoices:
16
17
post:
@@ -97,17 +98,41 @@ components:
97
98
description: The date and time that event occurred (UTC time)
98
99
eventType:
99
100
type: string
100
-
description: The type of event of that occurred (e.g. Update)
101
+
description: The type of event of that occurred (e.g. UPDATE)
102
+
oneOf:
103
+
- type: string
104
+
const: CREATE
105
+
description: When a new resource is created
106
+
- type: string
107
+
const: UPDATE
108
+
description: When an existing resource is updated (including when they are archived)
101
109
eventCategory:
102
110
type: string
103
-
description: The category of event that occurred (e.g. CONTACT). You will only retrieve events from categories that your webhook is subscribed to.
111
+
description: The category of event that occurred (e.g. CONTACT). You will only retrieve events from categories that your webhook is subscribed to
112
+
oneOf:
113
+
- type: string
114
+
const: CONTACT
115
+
description: For organisation contact-related events
116
+
- type: string
117
+
const: INVOICE
118
+
description: For organisation invoice-related events
119
+
- type: string
120
+
const: SUBSCRIPTION
121
+
description: For application subscription-related events
104
122
tenantId:
105
123
type: string
106
124
format: uuid
107
125
description: The ID of the tenant that the event happened in relation to (OrganisationID or ApplicationID)
108
126
tenantType:
109
127
type: string
110
-
description: The type of tenant, depending on the type of event it will be one of ORGANISATION (for Contact or Invoice events), or APPLICATION (for Subscription events)
128
+
description: The type of tenant
129
+
oneOf:
130
+
- type: string
131
+
const: ORGANISATION
132
+
description: Represents a Xero organisation (for non-Subscription events)
133
+
- type: string
134
+
const: APPLICATION
135
+
description: Represents a Xero application (for Subscription events)
111
136
required:
112
137
- resourceUrl
113
138
- resourceId
@@ -116,20 +141,20 @@ components:
116
141
- eventCategory
117
142
- tenantId
118
143
- tenantType
119
-
description: A list of events that have occurred.
144
+
description: A list of events that have occurred
120
145
lastEventSequence:
121
146
type: integer
122
147
minimum: 1
123
148
maximum: 2147483647
124
-
description: The sequence number of the last event in the list.
149
+
description: The sequence number of the last event in the list
125
150
firstEventSequence:
126
151
type: integer
127
152
minimum: 1
128
153
maximum: 2147483647
129
-
description: The sequence number of the first event in the list.
154
+
description: The sequence number of the first event in the list
130
155
entropy:
131
156
type: string
132
-
description: A random string used for security or validation purposes.
157
+
description: A random string used for security or validation purposes
133
158
responses:
134
159
401InvalidWebhookData:
135
160
description: Return a 401 status to indicate that the webhook subscription failed
0 commit comments