---
title: "Invoice Payment Created Webhook"
source_url: https://docs.rapyd.net/en/invoice-payment-created-webhook.html
lang: en
---

# Invoice Payment Created Webhook

The **INVOICE_PAYMENT_CREATED** webhook is sent when a payment against an invoice is created.

> **Note:**
>
> The endpoint for webhooks is unique for each client. To set up a webhook endpoint, see [Defining a Webhook Endpoint](https://docs.rapyd.net/en/defining-a-webhook-endpoint.md "Defining a Webhook Endpoint").

### Parameters

### Webhook Header Parameters

- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt
  - Random string.
- - signature
  - Signature calculated for each webhook individually.

    See [Webhook Authentication](https://docs.rapyd.net/en/webhook-authentication.md "Webhook Authentication").
- - timestamp
  - Timestamp for the webhook, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Webhook Root Parameters

- - created_at
  - Time that the webhook was created, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").

    > **Note:**
    >
    > Inside the `data` object, some webhooks have another `created_at` field that refers to a different event.
- - data
  - Contains the actual data of the webhook.

    For details, see below.
- - extended_timestamp
  - Time in milliseconds that the webhook was created, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - id
  - ID of the webhook. String starting with **wh_**.
- - status
  - Status of the webhook. One of the following:

    - **NEW**
    - **CLO** - Closed.
    - **ERR** - Error.
    - **RET** - Re-sent.

    > **Note:**
    >
    > Inside the `data` object, some webhooks have another `status` field that refers to a different event.
- - trigger_operation_id
  - ID of the operation that triggered the webhook. UUID.
- - type
  - Name of the webhook type.

    > **Note:**
    >
    > The name in the Client Portal is different.

### Webhook Data Parameters

- - attempt_count
  - Total number of attempts made to pay this invoice.
- - attempted
  - Indicates whether an attempt has been made to pay the invoice automatically.
- - automatic_attempt_count
  - Number of automatic attempts that Rapyd made to retry paying this invoice if it failed.
- - billing
  - Determines the method of billing at the end of the billing cycle. Set to **pay_automatically** - Rapyd generates a `payment` object, then attempts to pay it using the designated payment method.
- - billing_reason
  - The reason for billing. One of the following:

    - **subscription_cycle** - A new cycle for the subscription.
    - **subscription_create** - A new subscription has been created.
    - **manual** - Customer was billed manually.
    - **upcoming** - Customer has an upcoming billing invoice.
- - created_at
  - The time the invoice was created, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - currency
  - Three-letter ISO 4217 currency code for the currency used in all fields that refer to a monetary amount.
- - customer
  - ID of the customer that pays this invoice. String starting with **cus_**.
- - days_until_due
  - Number of days the customer has for paying this invoice. Integer.
- - description
  - Description of the invoice.
- - discount
  - Describes the discount that applies to this invoice. The source of the discount is one of the following:

    - If the invoice is generated manually, the discount is taken from the Customer object.
    - If the invoice is generated automatically from a subscription, the discount is taken from the Subscription object if it is defined there. Otherwise, it is taken from the Customer object.
- - discount_amount
  - The amount of the discount that was applied to this invoice.
- - due_date
  - The date payment is due on this invoice. This value is calculated from the date the invoice is created, plus the number of days specified in the `days_until_due` field. Relevant when `billing` is **send_invoice**. Format is in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - id
  - ID of the invoice. String starting with **invoice_**.
- - lines
  - The individual line items that make up the invoice. These items are added with [Create Invoice](https://docs.rapyd.net/en/create-invoice.md "Create Invoice") or [Update Invoice](https://docs.rapyd.net/en/update-invoice.md "Update Invoice"). For details o the fields in the 'invoice_item' object, see [Create Invoice Item](https://docs.rapyd.net/en/create-invoice-item.md "Create Invoice Item").
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - next_payment_attempt
  - The time when the next payment attempt will be made, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - number
  - Invoice number, starting with the `invoice_prefix` specified in the Customer object.
- - payment
  - The 'payment' object that was generated for this invoice. For details of the fields in the 'payment' object, see [Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment").
- - payment_fields
  - Additional `payment_options`.
- - payment_method
  - ID of the payment method for paying the invoice.
- - payout
  - Reserved.
- - payout_fields
  - Reserved.
- - period_end
  - Last date in the period covered by the invoice, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - period_start
  - First date in the period covered by the invoice, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - statement_descriptor
  - Description of the invoice for the customer's credit card statement. Limited to 22 characters.
- - status
  - An invoice moves through a series of statuses.

    - **draft** - Starting status for all invoices. The invoice can still be edited or deleted. The subscription's 'simultaneous_invoice' field determines when the status automatically moves to **open**. At any time, payment of the invoice via the 'Pay Invoice' method can move the invoice to another status.
    - **deleted** - An invoice can be deleted only when its status is **draft**. This action is usually done after an invoice is created due to an error.
    - **open** - The invoice has been finalized, and the system is now waiting for the payment to be completed by the customer. The invoice can no longer be edited.
    - **paid** - The paid status is used for invoices that are paid. Invoices are automatically marked as paid when payments are processed by Rapyd.
    - **void** - Voiding is similar to deleting an invoice, but keeps a record of when it was created, finalized, and voided. Invoices with a void status cannot be paid.
    - **uncollectible** - This invoice cannot be paid by the customer.
- - subscription
  - ID of the subscription that generates charges to this customer. String starting with **sub_**.
- - subtotal
  - Total of all line items before discount and before tax. Decimal.
- - tax
  - The amount of tax charged. Decimal. This is calculated as**T = R x (S - D)**, where:

    - **T** is the tax.
    - **R** is the tax rate in `tax_percent`.
    - **S** is the subtotal.
    - **D** is the discount.
- - tax_percent
  - The percentage tax rate that is applied to the subtotal of the invoice, after subtracting all discounts. Decimal, up to four decimal places. Range: 0-100
- - total
  - Total after discount and tax. Decimal.
- - type
  - The type of the subscription: **payment**

- INVOICE_PAYMENT_CREATED Webhook
- ```json
  {
      "id": "wh_83311530262abb943ac9ae3b6e34a441",
      "data": {
          "id": "invoice_fdbe5157cff4e25480611da238922e46",
          "tax": 0,
          "type": "payment",
          "lines": [],
          "total": 800,
          "payout": null,
          "status": "paid",
          "billing": "pay_automatically",
          "payment": {
              "id": "payment_93bdf7d314a246a3b41024890c15c33d",
              "mid": "",
              "paid": true,
              "order": null,
              "amount": 800,
              "escrow": null,
              "status": "CLO",
              "address": null,
              "dispute": null,
              "fx_rate": 1,
              "invoice": "invoice_fdbe5157cff4e25480611da238922e46",
              "outcome": null,
              "paid_at": 1702536994,
              "refunds": null,
              "captured": true,
              "ewallets": [{
                      "amount": 800,
                      "percent": 100,
                      "ewallet_id": "ewallet_e2150f478c15d97b807b9ed179b798a0",
                      "refunded_amount": 0
                  }
              ],
              "metadata": {},
              "refunded": false,
              "auth_code": null,
              "flow_type": "",
              "created_at": 1702536989,
              "error_code": "",
              "ewallet_id": "ewallet_e2150f478c15d97b807b9ed179b798a0",
              "expiration": 1703141790,
              "fixed_side": "",
              "is_partial": false,
              "description": "",
              "next_action": "not_applicable",
              "country_code": "MX",
              "failure_code": "",
              "instructions": [],
              "payment_fees": null,
              "redirect_url": "",
              "visual_codes": {},
              "cancel_reason": null,
              "currency_code": "MXN",
              "group_payment": "",
              "receipt_email": "",
              "textual_codes": {},
              "customer_token": "cus_c2499761d00f5f7130d57a67baaf2af2",
              "payment_method": "card_89f7ff14b57651628d7ef470562bb75c",
              "receipt_number": "",
              "transaction_id": "",
              "failure_message": "",
              "initiation_type": "recurring",
              "original_amount": 800,
              "refunded_amount": 0,
              "error_payment_url": "",
              "payment_method_data": {
                  "id": "card_89f7ff14b57651628d7ef470562bb75c",
                  "name": "John Doe",
                  "type": "mx_visacredit_card",
                  "image": "",
                  "last4": "0060",
                  "category": "card",
                  "metadata": {},
                  "acs_check": "unchecked",
                  "cvv_check": "pass",
                  "bin_details": {
                      "type": "CREDIT",
                      "brand": "MASTERCARD",
                      "level": "PLATINUM",
                      "issuer": "MAYBANK SINGAPORE LIMITED",
                      "country": "SG",
                      "bin_number": "518834"
                  },
                  "next_action": "not_applicable",
                  "webhook_url": "",
                  "expiration_year": "25",
                  "expiration_month": "01",
                  "fingerprint_token": "ocfp_11ECFC393995502381220EC01B2F2B1B",
                  "supporting_documentation": ""
              },
              "payment_method_type": "mx_visacredit_card",
              "complete_payment_url": "",
              "remitter_information": {},
              "statement_descriptor": "",
              "merchant_reference_id": "",
              "payment_method_options": {},
              "merchant_requested_amount": null,
              "merchant_requested_currency": null,
              "payment_method_type_category": "card"
          },
          "currency": "MXN",
          "customer": "cus_c2499761d00f5f7130d57a67baaf2af2",
          "discount": null,
          "due_date": 1705128818,
          "metadata": {},
          "subtotal": 800,
          "created_at": 1702536818,
          "period_end": 1705215218,
          "description": "",
          "tax_percent": 0,
          "period_start": 1702536818,
          "subscription": "sub_efae7e085ecff92d0c9a7f41ecd0a169",
          "attempt_count": 1,
          "payout_fields": null,
          "billing_reason": "subscription_create",
          "days_until_due": 30,
          "payment_fields": null,
          "payment_method": "card_89f7ff14b57651628d7ef470562bb75c",
          "discount_amount": 0,
          "next_payment_attempt": null,
          "statement_descriptor": "",
          "automatic_attempt_count": 0
      },
      "type": "INVOICE_PAYMENT_CREATED",
      "status": "NEW",
      "created_at": 1702537025,
      "extended_timestamp": 1702537025462,
      "trigger_operation_id": "ba8a00d8-8a08-4763-b6b6-fb85e953e99c"
  }
  ```
