Skip to content

Commit d3d2b83

Browse files
authored
Merge branch 'master' into patch-4
2 parents cb816a5 + 018baf9 commit d3d2b83

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

xero-webhooks.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,43 @@ webhooks:
6464
$ref: "#/components/responses/200WebhookDataReceivedOk"
6565
"401":
6666
$ref: "#/components/responses/401InvalidWebhookData"
67+
creditNotes:
68+
post:
69+
summary: Credit Notes Webhook Endpoint
70+
description: Credit Note (Create, Update)
71+
operationId: publishCreditNoteEvent
72+
tags:
73+
- Events
74+
requestBody:
75+
content:
76+
application/json:
77+
schema:
78+
$ref: "#/components/schemas/CreditNoteWebhookEvent"
79+
examples:
80+
creditNoteCreate:
81+
summary: Credit Note Create Event
82+
value:
83+
events:
84+
- resourceUrl: https://api.xero.com/api.xro/2.0/CreditNotes/55d84274-a3da-4829-a7c0-0cab601b95cc
85+
resourceId: 55d84274-a3da-4829-a7c0-0cab601b95cc
86+
tenantId: aef86862-2015-4b6b-88bc-d89032cecc50
87+
tenantType: ORGANISATION
88+
eventCategory: CREDITNOTE
89+
eventType: CREATE
90+
eventDateUtc: 2025-12-02T00:44:09.923
91+
data:
92+
Type: ACCPAYCREDIT
93+
Status: DRAFT
94+
firstEventSequence: 76
95+
lastEventSequence: 76
96+
entropy: FXNGWLCCGVANWHKILRUB
97+
responses:
98+
"200":
99+
$ref: "#/components/responses/200WebhookDataReceivedOk"
100+
"401":
101+
$ref: "#/components/responses/401InvalidWebhookData"
102+
103+
67104
components:
68105
headers:
69106
x-xero-signature:
@@ -119,6 +156,9 @@ components:
119156
- type: string
120157
const: SUBSCRIPTION
121158
description: For application subscription-related events
159+
- type: string
160+
const: CREDITNOTE
161+
description: For organisation credit note-related events
122162
tenantId:
123163
type: string
124164
format: uuid
@@ -155,6 +195,65 @@ components:
155195
entropy:
156196
type: string
157197
description: A random string used for security or validation purposes
198+
CreditNoteWebhookEvent:
199+
allOf:
200+
- $ref: "#/components/schemas/WebhookEvent"
201+
- type: object
202+
properties:
203+
events:
204+
type: array
205+
items:
206+
allOf:
207+
- $ref: "#/components/schemas/WebhookEvent/properties/events/items"
208+
- type: object
209+
properties:
210+
eventCategory:
211+
const: CREDITNOTE
212+
data:
213+
type: object
214+
description: Additional data for credit note events
215+
required:
216+
- Type
217+
- Status
218+
properties:
219+
Type:
220+
type: string
221+
description: The type of credit note
222+
externalDocs:
223+
url: https://developer.xero.com/documentation/api/accounting/types#credit-notes
224+
oneOf:
225+
- type: string
226+
const: ACCPAYCREDIT
227+
description: An Accounts Payable(supplier) Credit Note
228+
- type: string
229+
const: ACCRECCREDIT
230+
description: An Account Receivable(customer) Credit Note
231+
Status:
232+
type: string
233+
description: The status of the credit note
234+
externalDocs:
235+
url: https://developer.xero.com/documentation/api/accounting/types#invoice-status-codes
236+
oneOf:
237+
- type: string
238+
const: DRAFT
239+
description: Draft credit note
240+
- type: string
241+
const: SUBMITTED
242+
description: Submitted credit note
243+
- type: string
244+
const: DELETED
245+
description: Deleted credit note
246+
- type: string
247+
const: AUTHORISED
248+
description: Authorised credit note
249+
- type: string
250+
const: PAID
251+
description: Paid credit note
252+
- type: string
253+
const: VOIDED
254+
description: Voided credit note
255+
required:
256+
- data
158257
responses:
159258
401InvalidWebhookData:
160259
description: Return a 401 status to indicate that the webhook subscription failed

0 commit comments

Comments
 (0)