# Fund a batch group via direct debit

Funds all transfers in a batch group via direct debit. The batch group must be in the `COMPLETED` state.
To use this funding method, you need to link an external bank account first. See [direct debit account creation](/api-reference/legacy/direct-debit-account/directdebitaccountcreate) for more information.
This endpoint is SCA protected. SCA requirements apply to profiles registered outside of the following regions: US, AU, NZ, SG, CA, MY.
Review the [Strong Customer Authentication guide](/guides/developer/auth-and-security/sca-and-2fa) for more details.

Endpoint: POST /v1/profiles/{profileId}/batch-groups/{batchGroupId}/payment-initiations
Security: UserToken

## Security:

  - `UserToken` (unknown)
    http bearer JWT

## Path parameters:

  - `profileId` (integer, required)
    The ID of the profile that the batch group is associated with.

  - `batchGroupId` (string, required)
    The batch group ID.

## Header parameters:

  - `X-External-Correlation-Id` (string)
    Optional UUID for correlating requests across systems. If provided, Wise echoes it back in the response. Maximum 36 characters. [Learn more](/guides/developer/headers/correlation-id).

## Request fields (application/json):

  - `type` (string, required)
    The method of payment to use.
    Enum: "DIRECT_DEBIT"

  - `accountId` (integer, required)
    Direct debit account ID. See [direct debit account creation](/api-reference/legacy/direct-debit-account/directdebitaccountcreate).
    Example: 1

  - `reference` (string)
    Optional payment initiation reference. Maximum 10 characters. If not provided, a reference will be generated automatically.
    Example: B1234567

## Response 200:

  - `200` (unknown)
    Payment initiation created successfully. You need to save payment initiation ID for tracking its status later.

## Response 200 fields (application/json):

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

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

  - `reference` (string)
    Payment reference that will be passed to the network. Can be used for reconciliation.
    Example: B1234567

  - `userId` (integer)
    The ID of the user who initiated this payment.
    Example: 33333333

  - `profileId` (integer)
    The ID of the profile this payment belongs to.
    Example: 44444444

  - `type` (string)
    Payment type.
    Enum: "DIRECT_DEBIT"

  - `status` (string)
    Payment initiation status:
- `NEW` — Payment initiation created
- `PROCESSING` — Payment is being processed
- `COMPLETED` — Payment completed successfully
- `FAILED` — Payment failed
- `CHARGED_BACK` — Payment was charged back
    Enum: "NEW", "PROCESSING", "COMPLETED", "FAILED", "CHARGED_BACK"

  - `accountId` (integer)
    External account ID associated with the payment.
    Example: 1

  - `transferId` (integer | null)
    Transfer ID of the direct debit payment. Present only after the direct debit is initiated.
    Example: null

  - `createdTime` (string)
    Date and time when the payment initiation was created.
    Example: 2022-01-01T19:51:41.423404Z

## Response 200 headers (application/json):

  - `X-External-Correlation-Id` (string)
    Echoed back when `X-External-Correlation-Id` was included in the request. [Learn more](/guides/developer/headers/correlation-id).
    Example: f47ac10b-58cc-4372-a567-0e02b2c3d479

  - `x-trace-id` (string)
    Unique trace identifier assigned by Wise. Useful when contacting support about a specific request.
    Example: fba501b6d453b96789f52338f019341f

## Response 429:

  - `429` (unknown)
    Rate limit exceeded. Retry after the number of seconds specified in the `Retry-After` header.

## Response 429 headers (application/json):

  - `Retry-After` (integer)
    Number of seconds to wait before retrying the request.
    Example: 5

  - `X-Rate-Limited-By` (string)
    Identifies the rate limiter that triggered the 429 response.
    Example: wise-public-api

  - `X-External-Correlation-Id` (string)
    Echoed back when `X-External-Correlation-Id` was included in the request. [Learn more](/guides/developer/headers/correlation-id).
    Example: f47ac10b-58cc-4372-a567-0e02b2c3d479

  - `x-trace-id` (string)
    Unique trace identifier assigned by Wise. Useful when contacting support about a specific request.
    Example: fba501b6d453b96789f52338f019341f

