Skip to content

Commit

Permalink
misc(webhooks): Add header definitions (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet authored Jan 24, 2025
1 parent e2baa5e commit 9a19763
Show file tree
Hide file tree
Showing 50 changed files with 425 additions and 6 deletions.
208 changes: 208 additions & 0 deletions openapi.yaml

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions src/parameters/_index.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
external_customer_id:
$ref: './external_customer_id.yaml'
$ref: "./external_customer_id.yaml"
external_subscription_id:
$ref: './external_subscription_id.yaml'
$ref: "./external_subscription_id.yaml"
lago_invoice_id:
$ref: './lago_invoice_id.yaml'
$ref: "./lago_invoice_id.yaml"
months:
$ref: './months.yaml'
$ref: "./months.yaml"
page:
$ref: './page.yaml'
$ref: "./page.yaml"
per_page:
$ref: './per_page.yaml'
$ref: "./per_page.yaml"
webhook_signature:
$ref: "./webhook_signature.yaml"
webhook_signature_algorithm:
$ref: "./webhook_signature_algorithm.yaml"
webhook_unique_key:
$ref: "./webhook_unique_key.yaml"
7 changes: 7 additions & 0 deletions src/parameters/webhook_signature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "X-Lago-Signature"
in: header
description: Signature of the webhook payload
required: true
schema:
type: string
example: "Ap\xB65\xC9\xBF\x9D\x9F\xCE\xA36\xD0fV\xA3\xC4\x15\x15\xBA\xF5\xD4\xF5\xD4[D\x8B\xE6A\xE2\xFF\xFC\xDA"
10 changes: 10 additions & 0 deletions src/parameters/webhook_signature_algorithm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "X-Lago-Signature-Algorithm"
in: header
description: Algorithm used to generate the signature
required: true
schema:
type: string
enum:
- jwt
- hmac
example: hmac
8 changes: 8 additions & 0 deletions src/parameters/webhook_unique_key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: "X-Lago-Unique-Key"
in: header
description: Unique id of the webhook. It can be used for idempotency
required: true
schema:
type: string
format: uuid
example: "1a901a90-1a90-1a90-1a90-1a901a901a90"
4 changes: 4 additions & 0 deletions src/webhooks/credit_note_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: creditNoteCreated
description: A new credit note has been created
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new credit note
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/credit_note_generated.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: creditNoteGenerated
description: A new credit note PDF has been generated
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the credit note
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/credit_note_provider_refund_failure.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: creditNoteProviderRefundFailure
description: The refund of a credit note has failed on a payment provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the credit note and of the provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_accounting_provider_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerAccountingProviderCreated
description: A customer was created on an accouting integration
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_accounting_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerAccountingProviderError
description: An error was encountered while syncing a customer to an accounting provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer and of the provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_checkout_url_generated.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerCheckoutUrlGenerated
description: A checkout URL was generated for a customer
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer with the generated checkout URL
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerCreated
description: A new customer has been created
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new customer
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_crm_provider_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerCrmProviderCreated
description: A customer has been created in the CRM provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_crm_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerCrmProviderError
description: An error was encountered while syncing a customer to a CRM provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer and of the CRM provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_payment_provider_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerPaymentProviderCreated
description: A customer has been created on a payment provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_payment_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerPaymentProviderError
description: An error was encountered while syncing a customer to a payment provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer and of the payment provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_tax_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerTaxProviderError
description: An error was encountered while fetching taxes for a customer on a tax provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer and of the tax provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_updated.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerUpdated
description: A customer has been updated
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/customer_vies_check.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: customerViesCheck
description: VIES VAT number has been checked for a customer
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the customer with the VIES VAT check status
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/event_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ post:
deprecated: true
operationId: eventError
description: An error has been detected on an event
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the event and of the error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/events_errors.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: eventsErrors
description: Errors were encountered while post-processing some events
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the events errors
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/fee_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: feeCreated
description: A pay in advance fee has been created
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new fee
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/fee_tax_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: feeTaxProviderError
description: An error was encountered while fetching taxes for a fee on a tax provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the fee and of the tax provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/integration_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: integrationProviderError
description: An error was encountered while processing data on an integration
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the integration and of the integration error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_add_on_added.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceAddOnAdded
description: A new add on invoice has been emitted
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceCreated
description: A new invoice has been emitted
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_drafted.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceDrafted
description: A new draft invoice has been emitted
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_generated.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceGenerated
description: A new invoice PDF has been generated
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_one_off_created.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceOneOffCreated
description: A new one off invoice has been emitted
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_paid_credit_added.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoicePaidCreditAdded
description: A new prepaid credit invoice has been emitted
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the new invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_payment_dispute_lost.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoicePaymentDisputeLost
description: A payment dispute has been lost for an invoice payment
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice and of the payment dispute
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_payment_failure.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoicePaymentFailure
description: A payment attempt for an invoice has failed on a payment provider
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice and of the payment provider error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_payment_overdue.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoicePaymentOverdue
description: An invoice payment is overdue
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_payment_status_updated.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoicePaymentStatusUpdated
description: The payment status of an invoice has been updated
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_resynced.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceResynced
description: An invoice has been resynced with salesforce
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/invoice_voided.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
post:
operationId: invoiceVoided
description: An invoice has been voided
parameters:
- $ref: "../parameters/webhook_signature.yaml"
- $ref: "../parameters/webhook_signature_algorithm.yaml"
- $ref: "../parameters/webhook_unique_key.yaml"
requestBody:
description: Details of the invoice
content:
Expand Down
Loading

0 comments on commit 9a19763

Please sign in to comment.