Skip to content

Commit debf191

Browse files
authored
Merge pull request #780 from rpocklin/webhooks-add-credit-notes
feat: add credit notes webhooks schema
2 parents 24bb2a6 + e22ce18 commit debf191

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

xero-webhooks.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,25 @@ 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+
responses:
80+
"200":
81+
$ref: "#/components/responses/200WebhookDataReceivedOk"
82+
"401":
83+
$ref: "#/components/responses/401InvalidWebhookData"
84+
85+
6786
components:
6887
headers:
6988
x-xero-signature:
@@ -155,6 +174,53 @@ components:
155174
entropy:
156175
type: string
157176
description: A random string used for security or validation purposes
177+
CreditNoteWebhookEvent:
178+
allOf:
179+
- $ref: "#/components/schemas/WebhookEvent"
180+
- type: object
181+
properties:
182+
data:
183+
type: object
184+
required:
185+
- Type
186+
- Status
187+
properties:
188+
Type:
189+
type: string
190+
description: The type of credit note
191+
externalDocs:
192+
url: https://developer.xero.com/documentation/api/accounting/types#credit-notes
193+
oneOf:
194+
- type: string
195+
const: ACCPAYCREDIT
196+
description: An Accounts Payable(supplier) Credit Note
197+
- type: string
198+
const: ACCRECCREDIT
199+
description: An Account Receivable(customer) Credit Note
200+
Status:
201+
type: string
202+
description: The status of the credit note
203+
externalDocs:
204+
url: https://developer.xero.com/documentation/api/accounting/types#invoice-status-codes
205+
oneOf:
206+
- type: string
207+
const: DRAFT
208+
description: Draft credit note
209+
- type: string
210+
const: SUBMITTED
211+
description: Submitted credit note
212+
- type: string
213+
const: DELETED
214+
description: Deleted credit note
215+
- type: string
216+
const: AUTHORISED
217+
description: Authorised credit note
218+
- type: string
219+
const: PAID
220+
description: Paid credit note
221+
- type: string
222+
const: VOIDED
223+
description: Voided credit note
158224
responses:
159225
401InvalidWebhookData:
160226
description: Return a 401 status to indicate that the webhook subscription failed

0 commit comments

Comments
 (0)