> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Direct Debit PayIn

### Body parameters

<ParamField body="AuthorId" type="string" required>
  The unique identifier of the user at the source of the transaction.
</ParamField>

<ParamField body="CreditedUserId" type="string">
  **Default value:** The unique identifier of the owner of the credited wallet.

  The unique identifier of the user whose wallet is credited.
</ParamField>

<ParamField body="CreditedWalletId" type="string" required>
  The unique identifier of the credited wallet.
</ParamField>

<ParamField body="DebitedFunds" type="object" required>
  Information about the debited funds.

  <Expandable title="properties">
    <ParamField body="Currency" type="string" required>
      **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

      The currency of the debited funds.
    </ParamField>

    <ParamField body="Amount" type="integer" required>
      An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="Fees" type="object" required>
  Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).

  <Expandable title="properties">
    <ParamField body="Currency" type="string" required>
      **Allowed values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

      The currency of the fees.
    </ParamField>

    <ParamField body="Amount" type="integer" required>
      An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="Tag" type="string">
  Max. length: 255 characters

  Custom data that you can add to this object.\
  For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
</ParamField>

<ParamField body="MandateId" type="string" required>
  The unique identifier of the mandate.
</ParamField>

<ParamField body="StatementDescriptor" type="string">
  Max. length: SEPA: 100 characters, BACS: truncated after 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 <a href="/bank-statements">Customizing bank statement references</a> article for details.

  **Note:** On BACS Direct Debit pay-ins, the length is truncated at 10 alphanumeric characters or spaces, but the technical limit is 100.
</ParamField>

<ParamField body="ProfilingAttemptReference" type="string">
  The unique reference generated for the profiling session, used by the <a href="/guides/fraud-prevention">fraud prevention</a> solution to produce recommendations for the transaction using the profiling data.

  **Note:** Parameter not returned by the API. Profiling feature available on request – contact Mangopay <a href="https://hub.mangopay.com/" target="_blank">via the Dashboard</a> for more information.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="Id" type="string">
      Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

      The unique identifier of the object.
    </ResponseField>

    <ResponseField name="CreationDate" type="Unix timestamp">
      The date and time at which the object was created.
    </ResponseField>

    <ResponseField name="AuthorId" type="string">
      The unique identifier of the user at the source of the transaction.
    </ResponseField>

    <ResponseField name="CreditedUserId" type="string">
      **Default value:** The unique identifier of the owner of the credited wallet.

      The unique identifier of the user whose wallet is credited.
    </ResponseField>

    <ResponseField name="Status" type="string">
      **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED`

      The status of the transaction.
    </ResponseField>

    <ResponseField name="ExecutionDate" type="Unix timestamp">
      The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
    </ResponseField>

    <ResponseField name="ChargeDate" type="Unix timestamp">
      The date used to notify the user of the future charge, set at midnight (00:00) on the given day. The user's account is usually debited the following day, but it depends on their bank. For more information on direct debit processing times, see the <a href="/guides/payment-methods/banking/direct-debit">direct debit</a> guide.
    </ResponseField>

    <ResponseField name="Type" type="string">
      **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT`

      The type of the transaction.
    </ResponseField>

    <ResponseField name="Nature" type="string">
      **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.
    </ResponseField>

    <ResponseField name="CreditedWalletId" type="string">
      The unique identifier of the credited wallet.
    </ResponseField>

    <ResponseField name="DebitedWalletId" type="string">
      The unique identifier of the debited wallet.

      In the case of a pay-in, this value is always `null` since there is no debited wallet.
    </ResponseField>

    <ResponseField name="CreditedFunds" type="object">
      Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the credited funds.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="DebitedFunds" type="object">
      Information about the debited funds.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the debited funds.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Fees" type="object">
      Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the fees.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="ResultCode" type="string">
      The code indicating the result of the operation. This information is mostly used to <a href="/errors/codes">handle errors</a> or for filtering purposes.
    </ResponseField>

    <ResponseField name="ResultMessage" type="string">
      The explanation of the result code.
    </ResponseField>

    <ResponseField name="PaymentType" type="string">
      **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE`

      The type of pay-in.
    </ResponseField>

    <ResponseField name="ExecutionType" type="string">
      **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION`

      The type of execution for the pay-in.
    </ResponseField>

    <ResponseField name="Tag" type="string">
      Max. length: 255 characters

      Custom data that you can add to this object.
    </ResponseField>

    <ResponseField name="MandateId" type="string">
      The unique identifier of the mandate.
    </ResponseField>

    <ResponseField name="StatementDescriptor" type="string">
      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 <a href="/bank-statements">Customizing bank statement references</a> article for details.
    </ResponseField>
  </Accordion>

  <Accordion title="200 - Failed due to invalid mandate status">
    <ResponseField name="Id" type="string">
      Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

      The unique identifier of the object.
    </ResponseField>

    <ResponseField name="CreationDate" type="Unix timestamp">
      The date and time at which the object was created.
    </ResponseField>

    <ResponseField name="AuthorId" type="string">
      The unique identifier of the user at the source of the transaction.
    </ResponseField>

    <ResponseField name="CreditedUserId" type="string">
      **Default value:** The unique identifier of the owner of the credited wallet.

      The unique identifier of the user whose wallet is credited.
    </ResponseField>

    <ResponseField name="Status" type="string">
      **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED`

      The status of the transaction.
    </ResponseField>

    <ResponseField name="ExecutionDate" type="Unix timestamp">
      The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
    </ResponseField>

    <ResponseField name="ChargeDate" type="Unix timestamp">
      The date used to notify the user of the future charge, set at midnight (00:00) on the given day. The user's account is usually debited the following day, but it depends on their bank. For more information on direct debit processing times, see the <a href="/guides/payment-methods/banking/direct-debit">direct debit</a> guide.
    </ResponseField>

    <ResponseField name="Type" type="string">
      **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT`

      The type of the transaction.
    </ResponseField>

    <ResponseField name="Nature" type="string">
      **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.
    </ResponseField>

    <ResponseField name="CreditedWalletId" type="string">
      The unique identifier of the credited wallet.
    </ResponseField>

    <ResponseField name="DebitedWalletId" type="string">
      The unique identifier of the debited wallet.

      In the case of a pay-in, this value is always `null` since there is no debited wallet.
    </ResponseField>

    <ResponseField name="CreditedFunds" type="object">
      Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the credited funds.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="DebitedFunds" type="object">
      Information about the debited funds.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the debited funds.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Fees" type="object">
      Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the fees.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="ResultCode" type="string">
      The code indicating the result of the operation. This information is mostly used to <a href="/errors/codes">handle errors</a> or for filtering purposes.
    </ResponseField>

    <ResponseField name="ResultMessage" type="string">
      The explanation of the result code.
    </ResponseField>

    <ResponseField name="PaymentType" type="string">
      **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE`

      The type of pay-in.
    </ResponseField>

    <ResponseField name="ExecutionType" type="string">
      **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION`

      The type of execution for the pay-in.
    </ResponseField>

    <ResponseField name="Tag" type="string">
      Max. length: 255 characters

      Custom data that you can add to this object.\
      For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
    </ResponseField>

    <ResponseField name="MandateId" type="string">
      The unique identifier of the mandate.
    </ResponseField>

    <ResponseField name="StatementDescriptor" type="string">
      Max. length: SEPA: 100 characters, BACS: truncated after 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 <a href="/bank-statements">Customizing bank statement references</a> article for details.

      **Note:** On BACS Direct Debit pay-ins, the length is truncated at 10 alphanumeric characters or spaces, but the technical limit is 100.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="400 - Payment method not activated">
    ```json theme={null}
    {
        "Message":"Error this mean of payment for this asked currency has been disabled",
        "Type":"disabled_mean_of_payment_for_currency",
        "Id":"2c4253ca-dd49-4092-8997-65b20b467b45#1663145348",
        "Date":1663145349.0,
        "errors":{
            "error":"The method payment DIRECT_DEBIT_GOCARDLESS with the ccy EUR is not active for the partner Sandboxtest"
        }
    }  
    ```
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200   theme={null}
  {
      "Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
      "CreationDate": 1728056606,
      "AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
      "CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
      "Status":"CREATED",
      "ExecutionDate": null,
      "ChargeDate": null,
      "Type": "PAYIN",
      "Nature": "REGULAR",
      "CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
      "DebitedWalletId": null,
      "CreditedFunds": {
          "Currency": "EUR",
          "Amount": 1188
      },
      "DebitedFunds": {
          "Currency": "EUR",
          "Amount": 1200
      },
      "Fees": {
          "Currency": "EUR",
          "Amount": 12
      },
      "ResultCode": null,
      "ResultMessage": null,
      "PaymentType": "DIRECT_DEBIT",
      "ExecutionType": "DIRECT",
      "Tag": "Created using Mangopay API Postman Collection",
      "MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
      "StatementDescriptor": "Example123"
  }
  ```

  ```json 200 - Failed due to invalid mandate status   theme={null}
  {
      "Id": "payin_m_01J9C36G3DYBNZEHVZ5HC7WB5D",
      "CreationDate": 1728056606,
      "AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
      "CreditedUserId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
      "Status":"FAILED",
      "ExecutionDate": null,
      "ChargeDate": null,
      "Type": "PAYIN",
      "Nature": "REGULAR",
      "CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
      "DebitedWalletId": null,
      "CreditedFunds": {
          "Currency": "EUR",
          "Amount": 1188
      },
      "DebitedFunds": {
          "Currency": "EUR",
          "Amount": 1200
      },
      "Fees": {
          "Currency": "EUR",
          "Amount": 12
      },
      "ResultCode":"001833",
      "ResultMessage":"The Status of this Mandate does not allow for payments",
      "PaymentType": "DIRECT_DEBIT",
      "ExecutionType": "DIRECT",
      "Tag": "Created using Mangopay API Postman Collection",
      "MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
      "StatementDescriptor": "Example123"
  }
  ```
</ResponseExample>

<RequestExample>
  ```json REST   theme={null}
  {
      "AuthorId": "user_m_01J8SY95DQ5CM7DH43NQCAS65T",
      "CreditedWalletId": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
      "DebitedFunds": {
          "Currency": "EUR",
          "Amount": 1200
      },
      "Fees": {
          "Currency": "EUR",
          "Amount": 12
      },
      "Tag": "Created using the Mangopay API Postman collection",
      "MandateId": "mdt_m_01J999B9HSEDH9CZDEXXYZGHEZ",
      "StatementDescriptor": "Example123"
  }  
  ```

  ```php PHP theme={null}
  <?php 

  require_once 'vendor/autoload.php';

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

  $api = new MangoPayApi();

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

  try {
      $userId = 'user_m_01HYDWQNXC3M655SJXVGNDP91J';
      $walletId = 'wlt_m_01HYDWR4NMAF0GRM2GZ25479EG';
      $mandateId = 'mdt_m_01HYDWRQNDFC7R7P37DWH8C9SP';

      $directDirectDebitPayIn = new \MangoPay\PayIn();
      $directDirectDebitPayIn->AuthorId = $userId;
      $directDirectDebitPayIn->CreditedWalletId = $walletId;

      $directDirectDebitPayIn->DebitedFunds = new Money();
      $directDirectDebitPayIn->DebitedFunds->Amount = 1000;
      $directDirectDebitPayIn->DebitedFunds->Currency = 'EUR';

      $directDirectDebitPayIn->Fees = new Money();
      $directDirectDebitPayIn->Fees->Amount = 0;
      $directDirectDebitPayIn->Fees->Currency = 'EUR';

      $directDirectDebitPayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsDirectDebit();
      $directDirectDebitPayIn->PaymentDetails->MandateId = $mandateId;

      $directDirectDebitPayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect(); 

      $directDirectDebitPayIn->Tag = 'Created using the Mangopay PHP SDK';

      $createPayIn = $api->PayIns->Create($directDirectDebitPayIn);

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

  ```javascript NodeJS  theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk')
  const mangopay = new mangopayInstance({
    clientId: 'your-client-id',
    clientApiKey: 'your-api-key',
  })

  let myPayIn = {
    PaymentType: 'DIRECT_DEBIT',
    ExecutionType: 'DIRECT',
    AuthorId: '168935886',
    Tag: 'Created with Mangopay Node.js SDK',
    CreditedUserId: '168935886',
    DebitedFunds: {
      Currency: 'EUR',
      Amount: 1000,
    },
    Fees: {
      Currency: 'EUR',
      Amount: 100,
    },
    CreditedWalletId: '168935920',
    MandateId: '193168736',
    StatementDescriptor: 'Mangopay',
  }

  const createDirectDirectDebitPayIn = async (payin) => {
    return await mangopay.PayIns.create(payin)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  createDirectDirectDebitPayIn(myPayIn)  
  ```

  ```ruby Ruby   theme={null}
  require 'mangopay'

  MangoPay.configure do |client|
      client.preproduction = true
      client.client_id = 'your-client-id'
      client.client_apiKey = 'your-api-key'
      client.log_file = File.join(Dir.pwd, 'mangopay.log')
  end

  def createDirectDirectDebitPayIn(payInObject)
      begin
          response = MangoPay::PayIn::DirectDebit::Direct.create(payInObject)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to create pay-in: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myPayIn = {
      AuthorId:'195074410',
      Tag: 'Created with Mangopay Ruby SDK',
      CreditedUserId:'195074410',
      DebitedFunds: {
        Currency: 'EUR',
        Amount: 1000,
      },
      Fees: {
        Currency: 'EUR',
        Amount: 100,
      },
      CreditedWalletId: '195074411',
      MandateId: '195074413',
      StatementDescriptor: 'Mangopay',
    }

  createDirectDirectDebitPayIn(myPayIn)  
  ```

  ```java Java  theme={null}
  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.entities.PayIn;
  import com.mangopay.entities.subentities.PayInExecutionDetailsDirect;
  import com.mangopay.entities.subentities.PayInPaymentDetailsDirectDebit;

  public class CreateDirectDirectDebitPayIn {
      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_01HTF5S9MG0XXBZ8A0550MED3Z";
          var mandateId = "mdt_m_01HW30HV697QX2SQN7E500FQBJ";

          PayIn payIn = new PayIn();

          Money debitedFunds = new Money();
          debitedFunds.setAmount(1000);
          debitedFunds.setCurrency(CurrencyIso.EUR);

          Money fees = new Money();
          fees.setAmount(0);
          fees.setCurrency(CurrencyIso.EUR);

          PayInPaymentDetailsDirectDebit paymentDetails = new PayInPaymentDetailsDirectDebit();
          paymentDetails.setMandateId(mandateId);
          paymentDetails.setStatementDescriptor("Apr2024");

          PayInExecutionDetailsDirect executionDetails = new PayInExecutionDetailsDirect();

          payIn.setAuthorId(userId);
          payIn.setCreditedWalletId(walletId);
          payIn.setDebitedFunds(debitedFunds);
          payIn.setFees(fees);
          payIn.setPaymentDetails(paymentDetails);
          payIn.setExecutionDetails(executionDetails);

          PayIn createPayIn = mangopay.getPayInApi().create(payIn);    

          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(createPayIn);

          System.out.println(prettyJson);
      }
  }
  ```

  ```python Python   theme={null}
  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, DirectDebitDirectPayIn, Money

  natural_user = NaturalUser.get('213753890')

  direct_debit_direct_payin = DirectDebitDirectPayIn(
      author_id = natural_user.id,
      credited_wallet_id = '213754077',
      debited_funds = Money(amount='1000', currency='EUR'),
      fees = Money(amount='100', currency='EUR'),
      tag = 'Created using the Mangopay Python SDK',
      mandate_id = '214224837',
      statement_descriptor = 'Jan2024'
  )

  create_direct_debit_direct_payin = direct_debit_direct_payin.save()

  pprint(create_direct_debit_direct_payin)  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Entities.PUT;
  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_01J30991BXBB7VF28PBS82EWD3";
          var returnUrl = "https://www.mangopay.com/docs/please-ignore/";
          var mandateId = "mdt_m_01J3D1C35QZHHAT7XJ4WXTHRTJ";

          var payIn = new PayInMandateDirectPostDTO(
              userId, 
              new Money { Amount = 100, Currency = CurrencyIso.EUR }, 
              new Money { Amount = 0, Currency = CurrencyIso.EUR }, 
              walletId, returnUrl, mandateId);

          var createDirectDirectDebitPayIn = await api.PayIns.CreateMandateDirectDebitAsync(payIn);

          string prettyPrint = JsonConvert.SerializeObject(createDirectDirectDebitPayIn, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
