> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mangopay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server.

# Create an Extended Preauthorized PayIn

POST https://api.sandbox.mangopay.com/v2.01/{ClientId}/payins/extended-preauthorized/direct/full-capture
Content-Type: application/json

This endpoint lets you capture funds against the `ExtendedPreauthorizationId` (or the deprecated `DepositId`) of a preauthorization made on a card or a PayPal account.

The payment method is indicated by the `PaymentType` of the [Extended Preauthorization](/api-reference/extended-preauthorizations/cancel-extended-preauthorization) object:

* `CARD` – Single capture possible within 29.5 days
* `PAYPAL` – Single capture recommended within 3 days, but possible up to 29 days (not 29.5)

The shape of the pay-in object is the same – specific data points for card or PayPal authorizations are available via [GET View an Extended Preauthorization](/api-reference/extended-preauthorizations/view-extended-preauthorization).

**Best practice - For PayPal, capture funds within 3 days**

PayPal recommends that you capture preauthorized funds within 3 days. This is because the success of the capture is subject to risk and the availability of funds on the card (or other funding instrument) that the user has linked to their PayPal account.

Reference: https://docs.mangopay.com/api-reference/extended-preauthorizations/create-extended-preauthorized-payin

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token. If your platform is using a [proxy](/guides/sca/proxy-management) to take SCA-triggering action on behalf of users, you also need to integrate [mTLS authentication](/guides/sca/platform) and use the `api-mtls` base URL.

## Servers

- `https://api.sandbox.mangopay.com` (Sandbox, default)
- `https://api.mangopay.com` (Production)
- `https://api-mtls.sandbox.mangopay.com` (mTLS Sandbox)
- `https://api-mtls.mangopay.com` (mTLS Production)

## Request

### Path parameters

- `ClientId` (string, required) — Platform's API account identifier, associated with the API key.

### Body (application/json)

This endpoint expects a CreateAnExtendedPreauthorizedPayInRequest.

- `AuthorId` (string, required) — The unique identifier of the user at the source of the transaction.
- `CreditedWalletId` (string, required) — The unique identifier of the credited wallet.
- `DebitedFunds` (CreateAnExtendedPreauthorizedPayInRequestDebitedFunds, required) — Information about the debited funds.
- `Fees` (CreateAnExtendedPreauthorizedPayInRequestFees, required) — Information about the fees.
- `ExtendedPreauthorizationId` (string, optional) — Required if `DepositId` is not provided. The unique identifier of the extended preauthorization.
- `DepositId` (string, optional) — **Deprecated** – use `ExtendedPreauthorizationId` instead. Required if `ExtendedPreauthorizationId` is not provided. The unique identifier of the extended preauthorization.
- `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`.

## Response

### 200

Success

- `AuthorId` (string, optional) — **Default values:** The `AuthorId` of the Extended Preauthorization object. The unique identifier of the user at the source of the transaction. On the Extended Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Extended Preauthorization object, regardless of the value sent.
- `CreditedUserId` (string, optional) — **Default value:** The `AuthorId` of the Extended Preauthorization object. The unique identifier of the user whose wallet is credited. On the Extended Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Extended Preauthorization object, regardless of the value sent.
- `CreditedWalletId` (string, optional) — The unique identifier of the credited wallet.
- `ExtendedPreauthorizationId` (string, optional) — The unique identifier of the extended preauthorization. The same unique value is also returned in the deprecated `DepositId` property. The prefix of the unique identifier determines the endpoint used to create the preauthorization: * `ext_auth_wt_<uuid>` – [POST Create a Card Extended Preauthorization](/api-reference/extended-preauthorizations/create-card-extended-preauthorization) or [POST Create a PayPal Extended Preauthorization](/api-reference/extended-preauthorizations/create-paypal-extended-preauthorization) * `deposit_wt_<uuid>` – [POST Create a Card Deposit Preauthorization](/api-reference/deposit-preauthorizations/create-card-deposit-preauthorization) or [POST Create a PayPal Deposit Preauthorization](/api-reference/deposit-preauthorizations/create-paypal-deposit-preauthorization)
- `DepositId` (string, optional) — **Deprecated** – use `ExtendedPreauthorizationId` instead. The unique identifier of the extended preauthorization.
- `Id` (string, optional) — Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details) The unique identifier of the object.
- `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the object was created.
- `ResultCode` (string, optional) — The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes.
- `ResultMessage` (string, optional) — The explanation of the result code.
- `Status` (string, optional) — **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction.
- `ExecutionDate` (integer, optional) — Unix timestamp (UTC) of the date and time the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
- `Type` (string, optional) — **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction.
- `Nature` (string, optional) — **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT` The nature of the transaction, providing more information about the context in which the transaction occurred: - `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow. - `REPUDIATION` – Automatic withdrawal of funds from the platform's repudiation wallet as part of the dispute process (when the user has requested a chargeback). - `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay). - `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute.
- `PaymentType` (string, optional) — **Returned values:** `PREAUTHORIZED` The payment type of the pay-in.
- `ExecutionType` (string, optional) — **Returned values:** `DIRECT` The execution type of the pay-in.
- `DebitedFunds` (ExtendedPreauthorizedPayInResponseDebitedFunds, optional) — Information about the debited funds.
- `CreditedFunds` (ExtendedPreauthorizedPayInResponseCreditedFunds, optional) — Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).
- `Fees` (ExtendedPreauthorizedPayInResponseFees, optional) — Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).
- `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`.
- `AuthenticationResult` (AuthenticationResult, optional) — Information about the authentication result, based on the request made by Mangopay and the decision of the issuer regarding the type of authentication to be enforced (if applicable).
- `StatementDescriptor` (string, optional) — Max. length: 10 characters; only alphanumeric and spaces Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.

## Errors

### 400 Bad Request Error

Bad Request

- `Message` (string, optional) — Description of the error.
- `Type` (string, optional) — The category of the error.
- `Id` (string, optional) — Unique identifier of the error instance, useful when contacting Mangopay for support.
- `Date` (double, optional) — Unix timestamp (UTC) of the date and time the error was triggered.
- `errors` (map from string to string, optional, nullable) — Object containing one or more field-level errors.

## Types

### CreateAnExtendedPreauthorizedPayInRequestDebitedFunds

Information about the debited funds.

- `Currency` (string, required) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount.
- `Amount` (integer, required) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.

### CreateAnExtendedPreauthorizedPayInRequestFees

Information about the fees.

- `Currency` (string, required) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount.
- `Amount` (integer, required) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.

### ExtendedPreauthorizedPayInResponseDebitedFunds

Information about the debited funds.

- `Currency` (string, optional) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount.
- `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.

### ExtendedPreauthorizedPayInResponseCreditedFunds

Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).

- `Currency` (string, optional) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount.
- `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.

### ExtendedPreauthorizedPayInResponseFees

Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).

- `Currency` (string, optional) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount.
- `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`.

### AuthenticationResult

Information about the authentication result, based on the request made by Mangopay and the decision of the issuer regarding the type of authentication to be enforced (if applicable).

- `AuthenticationType` (string, optional, nullable) — **Returned values:** `CHALLENGE`, `FRICTIONLESS`, `DIRECT_AUTHORIZATION` The type of authentication: - `CHALLENGE` – The issuer requested SCA to be enforced (for example, using 3DS). - `FRICTIONLESS` – The transaction was exempted from SCA because an exemption was granted by the issuer. - `DIRECT_AUTHORIZATION` – The transaction was sent to the issuer for authorization without any frictionless or challenge (for example, if SCA doesn't apply). A `null` value typically indicates that authentication was not requested (for example, because the request failed before being sent) or a decision was not received. A `null` value typically indicates that authentication was not requested (for example, because the request failed before being sent) or a decision was not received.

## Examples

**Request**

```json
{
  "body": {
    "AuthorId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
    "CreditedWalletId": "wlt_m_01KHXAHH2NA3AAMPGE1SJPHJDJ",
    "DebitedFunds": {
      "Amount": 20000,
      "Currency": "EUR"
    },
    "ExtendedPreauthorizationId": "ext_auth_wt_073099a9-4e14-42b7-9bc7-d1978f65d8ba",
    "Fees": {
      "Amount": 1000,
      "Currency": "EUR"
    },
    "Tag": "Created using Mangopay API Postman Collection"
  }
}
```

**Response**

```json
{
  "AuthorId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
  "CreditedUserId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
  "CreditedWalletId": "wlt_m_01KHXAHH2NA3AAMPGE1SJPHJDJ",
  "ExtendedPreauthorizationId": "ext_auth_wt_073099a9-4e14-42b7-9bc7-d1978f65d8ba",
  "DepositId": "ext_auth_wt_073099a9-4e14-42b7-9bc7-d1978f65d8ba",
  "Id": "wt_28217024-04e1-400b-b902-15bc2cca8a82",
  "CreationDate": 1771585285,
  "ResultCode": "000000",
  "ResultMessage": "Success",
  "Status": "SUCCEEDED",
  "ExecutionDate": 1771585286,
  "Type": "PAYIN",
  "Nature": "REGULAR",
  "PaymentType": "PREAUTHORIZED",
  "ExecutionType": "DIRECT",
  "DebitedFunds": {
    "Currency": "EUR",
    "Amount": 20000
  },
  "CreditedFunds": {
    "Currency": "EUR",
    "Amount": 19000
  },
  "Fees": {
    "Currency": "EUR",
    "Amount": 1000
  },
  "Tag": "Created using Mangopay API Postman Collection",
  "AuthenticationResult": {
    "AuthenticationType": "CHALLENGE"
  },
  "StatementDescriptor": null
}
```

**SDK Code**

```python
from pprint import pprint
import mangopay

mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'

from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)

from mangopay.resources import NaturalUser, Wallet, PreAuthorizedExtendedPayIn
from mangopay.utils import Money

natural_user = NaturalUser.get('213753890')
wallet = Wallet.get('213960173')

preauthorized_extended_payin = PreAuthorizedExtendedPayIn(
    author_id = natural_user.id,
    credited_wallet_id = wallet.id,
    debited_funds = Money(amount=20000, currency='EUR'),
    fees = Money(amount=1000, currency='EUR'),
    extended_preauthorization_id = '5ac7a986-cf01-47f0-a882-8b0928ae5458',
    tag = 'Created using the Mangopay Python SDK'
)

create_extended_preauthorized_payin = preauthorized_extended_payin.save()

pprint(create_extended_preauthorized_payin)

```

```javascript
const mangopay = require('mangopay4-nodejs-sdk');

const api = new mangopay({
    clientId: 'your-client-id',
    clientApiKey: 'your-api-key',
    baseUrl: 'https://api.sandbox.mangopay.com'
});

api.PayIns.createExtendedPreauthorizedPayIn({
    AuthorId: 'user_m_01HT2NFK7Z2BRQNGNHMY30VVTT',
    CreditedWalletId: 'wlt_m_01HT2P5XZXZXZXZXZXZXZXZXZX',
    DebitedFunds: { Currency: 'EUR', Amount: 20000 },
    Fees: { Currency: 'EUR', Amount: 1000 },
    ExtendedPreauthorizationId: 'preauth_m_01HT2NFK7Z2BRQNGNHMY30VVTT',
    Tag: 'Created using the Mangopay Node.js SDK'
}, (data) => {
    console.log(data);
});

```

```java
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.CurrencyIso;
import com.mangopay.core.enumerations.PayInExecutionType;
import com.mangopay.core.enumerations.PayInPaymentType;
import com.mangopay.entities.PayIn;

public class CreateExtendedPreauthorizedPayIn {
    public static void main(String[] args) throws Exception {
        MangoPayApi mangopay = new MangoPayApi();
        mangopay.getConfig().setClientId("your-client-id");
        mangopay.getConfig().setClientPassword("your-api-key");

        var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT";
        var walletId = "wlt_m_01J1Z1Q2N7T4RZ5V8W0X9YQJ4K";
        var extendedPreauthorizationId = "ext_auth_m_01J333VFZYAYF6QTZ4Q5ENA9F9";

        PayIn payIn = new PayIn();
        payIn.setAuthorId(userId);
        payIn.setCreditedWalletId(walletId);
        payIn.setDebitedFunds(new Money(CurrencyIso.EUR, 20000));
        payIn.setFees(new Money(CurrencyIso.EUR, 1000));
        payIn.setPaymentType(PayInPaymentType.PREAUTHORIZED);
        payIn.setExecutionType(PayInExecutionType.DIRECT);
        payIn.setExtendedPreauthorizationId(extendedPreauthorizationId);

        PayIn createExtendedPreauthorizedPayIn = mangopay.getPayInApi().createExtendedPreauthorizedPayIn(payIn, null);

        Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
        String prettyJson = prettyPrint.toJson(createExtendedPreauthorizedPayIn);
        System.out.println(prettyJson);
    }
}

```

```csharp
using MangoPay.SDK;
using MangoPay.SDK.Entities.POST;
using Newtonsoft.Json;

class Program
{
    static async Task Main(string[] args)
    {
        MangoPayApi api = new MangoPayApi();
        api.Config.ClientId = "your-client-id";
        api.Config.ClientPassword = "your-api-key";

        var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
        var walletId = "wlt_m_01J333VFZYAYF6QTZ4Q5ENA9F9";
        var extendedPreauthorizationId = "preauth_m_01J333VFZYAYF6QTZ4Q5ENA9F9";

        var extendedPreauthorizedPayIn = new ExtendedPreAuthorizedPayInPostDTO
        {
            AuthorId = userId,
            CreditedWalletId = walletId,
            DebitedFunds = new Money { Amount = 20000, Currency = CurrencyIso.EUR },
            Fees = new Money { Amount = 1000, Currency = CurrencyIso.EUR },
            ExtendedPreauthorizationId = extendedPreauthorizationId,
            Tag = "Created using the Mangopay .NET SDK"
        };

        var createExtendedPreauthorizedPayIn = await api.PayIns.CreateExtendedPreauthorizedPayIn(extendedPreauthorizedPayIn);

        string prettyPrint = JsonConvert.SerializeObject(createExtendedPreauthorizedPayIn, Formatting.Indented);
        Console.WriteLine(prettyPrint);
    }
}

```

```php
<?php

require_once 'vendor/autoload.php';

use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;

$api = new MangoPayApi();

$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';

try {
    $userId = 'user_m_01HQK25M6KVHKDV0S36JY9NRKR';
    $walletId = 'wallet_m_01J5R4KZXW8N8H9R0K3VZB1Y7S';
    $extendedPreauthorizationId = 'extendedpreauth_m_01JH5W6ZE4FZFYY583XGK1AJAT';

    $payIn = new MangoPay\CreatePreAuthorizedExtendedPayIn;
    $payIn->AuthorId = $userId;
    $payIn->CreditedWalletId = $walletId;
    $payIn->DebitedFunds = new Money();
    $payIn->DebitedFunds->Amount = 20000;
    $payIn->DebitedFunds->Currency = 'EUR';
    $payIn->Fees = new Money();
    $payIn->Fees->Amount = 1000;
    $payIn->Fees->Currency = 'EUR';
    $payIn->ExtendedPreauthorizationId = $extendedPreauthorizationId;
    $payIn->Tag = 'Created using the API';

    $createPayIn = $api->PayIns->CreatePayInExtendedPreauthorized($payIn);

    print_r($createPayIn);
} catch(MGPResponseException $e) {
    print_r($e);
} catch(MGPException $e) {
    print_r($e);
}

```

```ruby
require 'mangopay'

MangoPay.configure do |c|
  c.client_id     = 'your-client-id'
  c.client_apiKey = 'your-api-key'
end

payin = MangoPay::PayIn::PreAuthorized::Direct.create_pre_authorized_extended_pay_in(
  AuthorId: 'user_m_01HT2NFK7Z2BRQNGNHMY30VVTT',
  CreditedWalletId: 'wlt_m_01HT2NFK7Z2BRQNGNHMY30VVTT',
  DebitedFunds: { Currency: 'EUR', Amount: 20000 },
  Fees: { Currency: 'EUR', Amount: 1000 },
  ExtendedPreauthorizationId: 'preauth_m_01HT2NFK7Z2BRQNGNHMY30VVTT',
  Tag: 'Created using the Mangopay Ruby SDK'
)

pp payin

```