> Documentation index: [Saleor](/llms.txt) · [This section](/api-reference/payments/llms.txt)
> Source: https://docs.saleor.io/api-reference/payments/mutations/transaction-initialize

# transactionInitialize Mutation

Initializes a transaction session. It triggers the webhook `TRANSACTION_INITIALIZE_SESSION`, to the requested `paymentGateways`. There is a limit of 100 transaction items per checkout / order.

```graphql
transactionInitialize(
  action: TransactionFlowStrategyEnum
  amount: PositiveDecimal
  customerIpAddress: String
  id: ID!
  idempotencyKey: String
  paymentGateway: PaymentGatewayToInitialize!
): TransactionInitialize
```

Details

```graphql
type TransactionInitialize {
  transaction: TransactionItem
  transactionEvent: TransactionEvent
  data: JSON
  errors: [TransactionInitializeError!]!
}
```

<a id="arguments"></a>

### Arguments

<a id="action"></a>

#### [`action`](#action) ● [`TransactionFlowStrategyEnum`](/api-reference/payments/enums/transaction-flow-strategy-enum.md)

The expected action called for the transaction. By default, the `channel.paymentSettings.defaultTransactionFlowStrategy` will be used.The field can be used only by app that has `HANDLE_PAYMENTS` permission.

<a id="amount"></a>

#### [`amount`](#amount) ● [`PositiveDecimal`](/api-reference/miscellaneous/scalars/positive-decimal.md)

The amount requested for initializing the payment gateway. If not provided, the difference between checkout.total - transactions that are already processed will be send.

<a id="customer-ip-address"></a>

#### [`customerIpAddress`](#customer-ip-address) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

The customer's IP address. If not provided Saleor will try to determine the customer's IP address on its own. The customer's IP address will be passed to the payment app. The IP should be in ipv4 or ipv6 format. The field can be used only by an app that has `HANDLE_PAYMENTS` permission.

<a id="id"></a>

#### [`id`](#id) ● [`ID!`](/api-reference/miscellaneous/scalars/id.md)

The ID of the checkout or order.

<a id="idempotency-key"></a>

#### [`idempotencyKey`](#idempotency-key) ● [`String`](/api-reference/miscellaneous/scalars/string.md)

The idempotency key assigned to the action. It will be passed to the payment app to discover potential duplicate actions. If not provided, the default one will be generated. If empty string provided, INVALID error code will be raised.

<a id="payment-gateway"></a>

#### [`paymentGateway`](#payment-gateway) ● [`PaymentGatewayToInitialize!`](/api-reference/payments/inputs/payment-gateway-to-initialize.md)

Payment gateway used to initialize the transaction.

<a id="type"></a>

### Type

<a id="transactioninitialize"></a>

#### [`TransactionInitialize`](/api-reference/payments/objects/transaction-initialize.md)

Initializes a transaction session. It triggers the webhook `TRANSACTION_INITIALIZE_SESSION`, to the requested `paymentGateways`. There is a limit of 100 transaction items per checkout / order.
