# Batch payment initiations state change

Triggered when the payment initiation state of a batch group payment changes.
The expected state of a batch payment initiation can be one of:
- `NEW`
- `PROCESSING`
- `COMPLETED`
- `FAILED`
- `CHARGED_BACK`

* Event type: `batch-payment-initiations#state-change`
* Profile level subscriptions: Not Supported
* Application level subscriptions: Supported

Events may not be delivered in the order they occurred. Use `data.occurred_at` to reconcile the order.
See the [Event ordering guide](/guides/developer/webhooks/event-ordering) for details.
See the [Webhooks guide](/guides/developer/webhooks) for setup instructions, signature verification, and best practices.

Endpoint: POST batch-payment-initiations#state-change

## Header parameters:

  - `X-Signature-SHA256` (string)
    RSA-SHA256 signature of the request body, Base64 encoded. Verify this against the [Wise public key](/guides/developer/webhooks/event-handling#requests) to ensure the request is authentic and has not been tampered with.

  - `X-Delivery-Id` (string)
    Unique identifier for this webhook delivery attempt.

  - `X-Test-Notification` (boolean)
    Present with the value `true` if this is a test notification sent to verify your callback URL during subscription setup.

## Request fields (application/json):

  - `schema_version` (string)
    Version of the event schema. Determined by the `schema_version` on your [webhook subscription](/api-reference/webhook).
    Enum: "4.0.0"

  - `subscription_id` (string)
    ID of the webhook subscription that triggered this event.
    Example: 01234567-89ab-cdef-0123-456789abcdef

  - `event_type` (string)
    Event type identifier
    Example: batch-payment-initiations#state-change

  - `sent_at` (string)
    Timestamp when the event was sent.
    Example: 2020-01-01T12:34:56.123Z

  - `data` (object)

  - `data.resource` (object)

  - `data.resource.id` (integer)
    Payment initiation ID
    Example: 12345

  - `data.resource.batch_group_id` (string)
    Batch group ID
    Example: 068e186d-9632-4937-b753-af3e53f4d0b0

  - `data.resource.profile_id` (integer)
    The ID of the profile this payment belongs to.
    Example: 2

  - `data.previous_status` (string)
    Previous payment initiation state.
    Enum: "NEW", "PROCESSING", "COMPLETED", "FAILED", "CHARGED_BACK"

  - `data.current_status` (string)
    Current payment initiation state.
    Enum: "NEW", "PROCESSING", "COMPLETED", "FAILED", "CHARGED_BACK"

  - `data.occurred_at` (string)
    When the payment initiation state change occurred.
    Example: 2021-04-13T19:51:41.423Z

  - `data.return_code` (string)
    Return code of the underlying payment system.
    Example: 200

  - `subscription_id` (string)
    ID of the webhook subscription that triggered this event
    Example: 01234567-89ab-cdef-0123-456789abcdef

  - `sent_at` (string)
    Timestamp when the event was sent
    Example: 2020-01-01T12:34:56Z

## Response 200 fields (application/json):

  - `status` (string)
    Example: ok

