A payment attempt for a payment request has failed on a payment provider

A payment attempt for a payment request has failed on a payment provider

postWebhookpayment_request_payment_failure

Headers

X-Lago-Signaturestring required
Example:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=

Signature of the webhook payload. The format depends on X-Lago-Signature-Algorithm: hmac is the Base64 encoding of an HMAC-SHA256 digest of the payload, jwt is an RS256 JSON Web Token (a string starting with eyJ).

X-Lago-Signature-Algorithm'jwt' | 'hmac' required
Example:hmac

Algorithm used to generate the signature

X-Lago-Unique-Keystring uuid required
Example:1a901a90-1a90-1a90-1a90-1a901a901a90

Unique id of the webhook. It can be used for idempotency

Payload

webhook_type'payment_request.payment_failure' required
object_type'payment_provider_payment_request_payment_error' required
organization_idstring uuid required

Unique identifier of the organization, created by Lago.

Example payload

{
  "organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
  "payment_provider_payment_request_payment_error": {
    "lago_payment_request_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "lago_invoice_ids": [
      "1a901a90-1a90-1a90-1a90-1a901a901a90"
    ],
    "lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
    "external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
    "provider_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
    "payment_provider": "stripe",
    "payment_provider_code": "Stripe Prod"
  }
}

Response

Return a 200 status to indicate that the data was received successfully

Changes

Webhooks have no change history: a webhook is keyed by its event name rather than a path and method, so no recorded change can name it.