---
title: "Initializes an APM transaction."
method: POST
path: "/v2/moneyins/apm/init"
tags: ["MoneyIns | APM"]
---

# Initializes an APM transaction.

`POST /v2/moneyins/apm/init`

## Request

- Base URL: `https://ws.lemonway.fr/mb/env-name/prod/directkitrest`
- URL: `https://ws.lemonway.fr/mb/env-name/prod/directkitrest/v2/moneyins/apm/init`
- Auth: none declared. Required headers: `Authorization`, `PSU-IP-Address`

## Headers

- `Authorization` string, required
- `PSU-Accept-Language` string
- `PSU-IP-Address` string, required
- `PSU-User-Agent` string

## Request body

- InitApmTransactionInput: Represents the input data for initializing an APM transaction.
  - `transaction` ApmTransaction: Transaction
    - `reference` string: Reference
    - `accountId` string, required: AccountId (required)
    - `totalAmount` integer, required: TotalAmount (required)
    - `PaymentMethod` string, required: PaymentMethod: ideal/bancontact/multibanco/mbway
    - `commissionAmount` integer: CommissionAmount
    - `comment` string: Comment
    - `autoCommission` boolean: AutoCommission
  - `paymentUrls` PaymentUrls: PaymentUrls
    - `redirections` ApmRedirections: Redirections
      - `returnUrl` string: Gets the URL to which the user will be redirected after a successful payment. ReturnUrl
      - `errorUrl` string: Gets the URL to which the user will be redirected if the payment fails. ErrorUrl
      - `cancelUrl` string: Gets the URL to which the user will be redirected if the payment is canceled. CancelUrl
  - `customer` ApmCustomer: Customer
    - `civility` string: Civility
    - `gender` 1 | 2: Gender<br/>1 = Male.<br/>2 = Female.<br/>
    - `firstName` string, required: FirstName (required)
    - `lastName` string, required: LastName (required)
    - `email` string: Email
    - `mobilePhone` string: MobilePhone
    - `birthDate` string: BirthDate
    - `countryCode` string, required: Country code of the payer (required). For iDEAL: only NL is accepted. For Bancontact: only BE is accepted. For Multibanco: only PT is accepted. For MBWay: only PT is accepted.
  - `preferredLanguage` string: Preferred language for the payment flow (e.g., fr, nl, de, en).
  - `appToAppUrl` string: URL used for app-to-app redirection.
  - `timeoutInMinutes` integer: Timeout for the transaction in minutes.

## Response `200`

OK

- InitApmTransactionOutput: Represents the output of an APM transaction initialization.
  - `id` integer, required: Gets or sets the Lemonway transaction ID.
  - `redirectUrl` string, required: Gets or sets the redirection URL.
  - `error` Error
    - `code` integer
    - `message` string
    - `psp` PSP
      - `message` string: Get the Error Message from PSP

## Other responses

- `401`: Unauthorized
- `500`: InternalServerError

---

[API](https://skmtc.dev/lemonway/apis/lemonway-directkit-api-2-0.md) - [All operations](https://skmtc.dev/lemonway/apis/lemonway-directkit-api-2-0/llms.txt) - [OpenAPI document](https://skmtc.dev/lemonway/apis/lemonway-directkit-api-2-0/revisions/82551a0a77b8?raw)
