---
title: "A payment attempt for an invoice has failed on a payment provider"
method: POST
path: "invoice_payment_failure"
---

# A payment attempt for an invoice has failed on a payment provider

`POST invoice_payment_failure` (webhook)

A payment attempt for an invoice has failed on a payment provider

## Headers

- `X-Lago-Signature` string, required
- `X-Lago-Signature-Algorithm` 'jwt' | 'hmac', required
- `X-Lago-Unique-Key` string, uuid, required

## Payload

- object
  - `webhook_type` 'invoice.payment_failure', required
  - `object_type` 'payment_provider_invoice_payment_error', required
  - `organization_id` string, uuid, required: Unique identifier of the organization, created by Lago.
  - `payment_provider_invoice_payment_error` InvoicePaymentFailureObject, required
    - `lago_invoice_id` string, uuid, required: Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system.
    - `lago_customer_id` string, uuid, required: Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system.
    - `external_customer_id` string, required: The customer external unique identifier (provided by your own application)
    - `provider_customer_id` string, nullable, required: Unique identifier of the customer within the payment provider. It is `null` when the payment failed before the payment provider was called.
    - `payment_provider` 'adyen' | 'cashfree' | 'gocardless' | 'moneyhash' | 'stripe' | 'null', nullable, required: The payment provider of the customer. It is `null` when the customer has no payment provider.
    - `payment_provider_code` string, nullable, required: Code of the payment provider connection of the customer. It is `null` when the customer has no payment provider.
    - `provider_error` object, nullable, required: The error returned by the payment provider. It is `null` when the payment failed before the payment provider was called.
      - `message` string, nullable: The error message returned by the payment provider.
      - `error_code` string, nullable: The error code returned by the payment provider.
    - `error_details` object, nullable, required: Extra details about the failure. It carries `code` set to `customer_must_have_payment_provider` when a payment is retried for a customer without a payment provider, and the details of the provider exception when one was raised. It is `null` when the failure carries no extra details.

## Acknowledgement `200`

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

---

[API](https://skmtc.dev/getlago/apis/lago-api-documentation.md) - [All operations](https://skmtc.dev/getlago/apis/lago-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/getlago/apis/lago-api-documentation/revisions/29aef7967e61?raw)
