> ## 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 PayPal Preauthorized PayIn

This call allows you to capture funds against a `DepositId` which was preauthorized using a registered card or a PayPal account. This is indicated by the response `PaymentType` of the [Deposit Preauthorization](/api-reference/deposit-preauthorizations/deposit-preauthorization-object):

* `CARD` – Single capture possible up to 29.5 days after
* `PAYPAL` card or  on a card or a PayPal account (indicated by the `PaymentType` of the Deposit Preauthorization)

<Check>
  **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.
</Check>

### Body parameters

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

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

<ParamField body="DepositId" type="string" required>
  The unique identifier of the PayPal preauthorization.
</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 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.

  <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>

### Responses

<Accordion title="200">
  <ResponseField name="AuthorId" type="string">
    **Default values:** The `AuthorId` of the Deposit Preauthorization object.

    **Returned values:** The `AuthorId` of the Deposit Preauthorization object.

    The unique identifier of the user at the source of the transaction. On the Deposit Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Deposit Preauthorization object, regardless of the value sent.
  </ResponseField>

  <ResponseField name="CreditedUserId" type="string">
    **Default value:** The `AuthorId` of the Deposit Preauthorization object.

    The unique identifier of the user whose wallet is credited. On the Deposit Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Deposit Preauthorization object, regardless of the value sent.
  </ResponseField>

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

  <ResponseField name="DepositId" type="string">
    The unique identifier of the deposit preauthorization.
  </ResponseField>

  <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="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="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="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="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="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 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="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 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.

    <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="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="AuthenticationResult" type="object | null" defaultOpen>
    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).

    <Expandable title="properties">
      <ResponseField name="AuthenticationType" type="string | null">
        Response 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.
      </ResponseField>
    </Expandable>
  </ResponseField>
</Accordion>

<ResponseExample>
  ```json 200 theme={null}
  {
      "AuthorId": "user_m_01KMD5PX2KPDVQ0C37XR375MPP",
      "CreditedUserId": "user_m_01KMD5PX2KPDVQ0C37XR375MPP",
      "CreditedWalletId": "wlt_m_01KMD5SMMF7ZXQ8JM0W9DG8WZJ",
      "DepositId": "deposit_wt_05e5e212-fa97-4d67-8c5e-1495eb91d8b4",
      "Id": "wt_2d749eb5-90c6-4c3c-9146-bda5ffa65d3f",
      "CreationDate": 1774264176,
      "ResultCode": "000000",
      "ResultMessage": "Success",
      "Status": "SUCCEEDED",
      "ExecutionDate": 1774264178,
      "Type": "PAYIN",
      "Nature": "REGULAR",
      "PaymentType": "PREAUTHORIZED",
      "ExecutionType": "WEB",
      "DebitedFunds": {
          "Currency": "GBP",
          "Amount": 1000
      },
      "CreditedFunds": {
          "Currency": "GBP",
          "Amount": 1000
      },
      "Fees": {
          "Currency": "GBP",
          "Amount": 0
      },
      "Tag": "Created using Mangopay API Postman Collection",
      "StatementDescriptor": null,
      "AuthenticationResult": {
          "AuthenticationType": null
      }
  }
  ```
</ResponseExample>

<RequestExample>
  ```json REST theme={null}
  {
      "AuthorId": "user_m_01KMD5PX2KPDVQ0C37XR375MPP",
      "CreditedWalletId": "wlt_m_01KMD5SMMF7ZXQ8JM0W9DG8WZJ",
      "DebitedFunds": {
          "Currency": "GBP",
          "Amount": 1000
      },
      "Fees": {
          "Currency": "GBP",
          "Amount": 0
      },
      "DepositId": "deposit_wt_05e5e212-fa97-4d67-8c5e-1495eb91d8b4",
      "Tag": "Created using Mangopay API Postman Collection"
  }  
  ```
</RequestExample>
