Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc(webhooks): Add header definitions #326

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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
@@ -1,6 +1,10 @@
post:
deprecated: true
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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,5 +1,9 @@
post:
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
4 changes: 4 additions & 0 deletions src/webhooks/payment_provider_error.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
post:
description: An error was raised by 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 payment provider and of the error
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/payment_request_created.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
post:
description: An new payment request 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 payment request
content:
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/payment_request_payment_failure.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
post:
description: A payment attempt for a payment request 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 payment request and of the provider error
content:
Expand Down
Loading
Loading