> ## 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 Recurring PayIn Registration (PayPal)

<Note>
  **Note – Only one registration per user on PayPal**

  On PayPal, only one recurring pay-in registration can be used per `UserId`. You can [end a user's existing registration](/api-reference/recurring-payin-registrations/update-recurring-payin-registration-paypal) object to create a new one with the same user.
</Note>

### 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="FirstTransactionDebitedFunds" type="object" required>
  The amount of the first recurring pay-in.\
  This value can be different from the `NextTransactionDebitedFunds`

  <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="FirstTransactionFees" type="object" required>
  The fees of the first recurring pay-in.\
  This amount can be different from the `NextTransactionDebitedFunds`.

  <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="Billing" type="object">
  Information about the end user's billing address.

  <Expandable title="properties">
    <ParamField body="FirstName" type="string">
      The first name of the user.
    </ParamField>

    <ParamField body="LastName" type="string">
      Max. length: 100 characters

      The last name of the user.
    </ParamField>

    <ParamField body="Address" type="object">
      Information about the billing address.

      <Expandable title="properties">
        <ParamField body="AddressLine1" type="string" required>
          Max. length: 255 characters

          The first line of the address.
        </ParamField>

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

          The second line of the address.
        </ParamField>

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

          The city of the address.
        </ParamField>

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

          Required if `Country` is US, CA, or MX.

          The region of the address.
        </ParamField>

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

          The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
        </ParamField>

        <ParamField body="Country" type="string" required>
          Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

          The country of the address.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="Shipping" type="object">
  Information about the end user's shipping address.

  <Expandable title="properties">
    <ParamField body="FirstName" type="string">
      The first name of the user.
    </ParamField>

    <ParamField body="LastName" type="string">
      Max. length: 100 characters

      The last name of the user.
    </ParamField>

    <ParamField body="Address" type="object" required>
      Information about the shipping address.

      <Expandable title="properties">
        <ParamField body="AddressLine1" type="string" required>
          Max. length: 255 characters

          The first line of the address.
        </ParamField>

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

          The second line of the address.
        </ParamField>

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

          The city of the address.
        </ParamField>

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

          Required if `Country` is US, CA, or MX.

          The region of the address.
        </ParamField>

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

          The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
        </ParamField>

        <ParamField body="Country" type="string" required>
          Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

          The country of the address.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="FixedNextAmount" type="boolean">
  For PayPal recurring registrations, this value is ignored if sent and automatically returned `false`. However, you can specify `NextTransactionDebitedFunds` and `NextTransactionFees` to set up a fixed-amount recurrence.
</ParamField>

<ParamField body="NextTransactionDebitedFunds" type="object">
  The amount of the subsequent recurring pay-ins.

  <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="NextTransactionFees" type="object">
  The fees of the subsequent recurring pay-ins.

  <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">
      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="PaymentType" type="string">
  **Allowed values:** `CARD_DIRECT`, `PAYPAL`

  **Default value:** `CARD_DIRECT`

  The type of recurring pay-in registration (which must correspond to the pay-ins requested against it).

  **Note:** Multiple active `CARD_DIRECT` registrations can exist for a user, but only one `PAYPAL` registration.
</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="Status" type="string">
      **Returned values:** `CREATED`, `AUTHENTICATION_NEEDED`, `IN_PROGRESS`, `ENDED`

      The status of the recurring registration for PayPal:

      * `CREATED` – The recurring registration was created, but no recurring pay-in has yet been made.
      * `AUTHENTICATION_NEEDED` – A customer-initiated transaction (CIT) has been initiated against the registration but not authenticated. Note that there is no re-authentication process with PayPal: this status is only returned after the CIT is initiated but not yet successful.
      * `IN_PROGRESS` – The CIT has was successful and subsequent merchant-initiated transactions (MIT) can be requested.
      * `ENDED` – The registration can no longer be modified nor reused. A new one can be created for the same user.
    </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="CurrentState" type="object">
      Information about the recurring pay-ins related to the registration object.

      **Note:** If the `LastPayinId` references a transaction older than 13 months, it may have been <a href="/api-reference/overview/data-availability-periods">archived</a>.

      <Expandable title="properties">
        <ResponseField name="PayinsLinked" type="integer">
          The number of recurring pay-ins already made for the registration object.
        </ResponseField>

        <ResponseField name="CumulatedDebitedAmount" type="object">
          The sum of the `DebitedFunds` amounts of the recurring pay-ins made for the registration.

          <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="CumulatedFeesAmount" type="object">
          The sum of the `Fees` amounts of the recurring pay-ins made for the registration.

          <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="LastPayinId" type="string">
          The unique identifier of the last recurring pay-in made for the registration.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="RecurringType" type="string">
      **Returned values:** `CUSTOM`

      For PayPal recurring registrations, this value is always `CUSTOM`.
    </ResponseField>

    <ResponseField name="TotalAmount" type="object">
      For PayPal recurring registrations, this value is returned `null`.
    </ResponseField>

    <ResponseField name="CycleNumber" type="integer">
      For PayPal recurring registrations, this value is returned `null`.
    </ResponseField>

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

    <ResponseField name="CardId" type="string">
      For PayPal recurring registrations, this value is returned `null`.
    </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="CreditedWalletId" type="string">
      The unique identifier of the credited wallet.
    </ResponseField>

    <ResponseField name="Billing" type="object">
      **Default value:** FirstName, LastName, and Address information of the Shipping object if any, otherwise the user (author).

      Information about the end user billing address. If left empty, the default values will be automatically taken into account.

      <Expandable title="properties">
        <ResponseField name="FirstName" type="string">
          The first name of the user.
        </ResponseField>

        <ResponseField name="LastName" type="string">
          Max. length: 100 characters

          The last name of the user.
        </ResponseField>

        <ResponseField name="Address" type="object">
          Information about the billing address.

          <Expandable title="properties">
            <ResponseField name="AddressLine1" type="string">
              Max. length: 255 characters

              The first line of the address.
            </ResponseField>

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

              The second line of the address.
            </ResponseField>

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

              The city of the address.
            </ResponseField>

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

              The region of the address. This field is optional except if the `Country` is US, CA, or MX.
            </ResponseField>

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

              The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
            </ResponseField>

            <ResponseField name="Country" type="string">
              Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

              The country of the address.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Shipping" type="object">
      Information about the end user's shipping address.

      <Expandable title="properties">
        <ResponseField name="FirstName" type="string">
          The first name of the user.
        </ResponseField>

        <ResponseField name="LastName" type="string">
          Max. length: 100 characters

          The last name of the user.
        </ResponseField>

        <ResponseField name="Address" type="object">
          Information about the shipping address.

          <Expandable title="properties">
            <ResponseField name="AddressLine1" type="string">
              Max. length: 255 characters

              The first line of the address.
            </ResponseField>

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

              The second line of the address.
            </ResponseField>

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

              The city of the address.
            </ResponseField>

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

              The region of the address. This field is optional except if the `Country` is US, CA, or MX.
            </ResponseField>

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

              The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
            </ResponseField>

            <ResponseField name="Country" type="string">
              Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

              The country of the address.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="EndDate" type="Unix timestamp">
      For PayPal recurring registrations, this value is returned `null`.
    </ResponseField>

    <ResponseField name="Frequency" type="string">
      For PayPal recurring registrations, this value is returned `null`.
    </ResponseField>

    <ResponseField name="FixedNextAmount" type="boolean">
      For PayPal recurring registrations, this value is ignored if sent and automatically returned `false`. However, you can specify `NextTransactionDebitedFunds` and `NextTransactionFees` to set up a fixed-amount recurrence.
    </ResponseField>

    <ResponseField name="FractionedPayment" type="boolean">
      For PayPal recurring registrations, this value is returned `null`.
    </ResponseField>

    <ResponseField name="FreeCycles" type="integer">
      For PayPal recurring registrations, this value is returned `0`.
    </ResponseField>

    <ResponseField name="FirstTransactionDebitedFunds" type="object">
      The amount of the first recurring pay-in.\
      This value can be different from the `NextTransactionDebitedFunds`

      <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="FirstTransactionFees" type="object">
      The fees of the first recurring pay-in.\
      This amount can be different from the `NextTransactionDebitedFunds`.

      <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="NextTransactionDebitedFunds" type="object">
      The amount of the subsequent recurring pay-ins.

      <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="NextTransactionFees" type="object">
      The fees of the subsequent recurring pay-ins.

      <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="Migration" type="boolean" deprecated>
      For PayPal recurring registrations, this value is returned `false`.
    </ResponseField>

    <ResponseField name="PaymentType" type="string">
      **Returned values:** `CARD_DIRECT`, `PAYPAL`

      **Default value:** `CARD_DIRECT`

      The type of recurring pay-in registration (which must correspond to the pay-ins requested against it).
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="400 - One live PayPal registration allowed per user">
    ```json theme={null}
    {
        "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
        "Type": "param_error",
        "Id": "be73db6f-f78e-4e71-9602-11633626dc9a",
        "Date": 1731941788,
        "errors": {
            "AuthorId": "RecurringPayInRegistration already exists for given AuthorId=user_m_01JCQYRAFZQMN5TD4X5Z3JFZT0 and PaymentType=PAYPAL"
        }
    }
    ```
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200   theme={null}
  {
      "Id": "recpayinreg_wt_c1fb7e3f-8204-4427-9251-df886fbb4e42",
      "Status": "CREATED",
      "ResultCode": null,
      "ResultMessage": null,
      "CurrentState": {
          "PayinsLinked": 0,
          "CumulatedDebitedAmount": {
              "Currency": "EUR",
              "Amount": 0
          },
          "CumulatedFeesAmount": {
              "Currency": "EUR",
              "Amount": 0
          },
          "LastPayinId": null
      },
      "RecurringType": "CUSTOM",
      "TotalAmount": null,
      "CycleNumber": null,
      "AuthorId": "user_m_01J9KR16BG7EDC8RNEY2M18EXK",
      "CardId": null,
      "CreditedUserId": null,
      "CreditedWalletId": "wlt_m_01J9KR4A7BH8KVE4PG6DTNS817",
      "Billing": {
          "FirstName": "Ofelia",
          "LastName": "Kilback",
          "Address": {
              "AddressLine1": "8151 Sipes Turnpike",
              "AddressLine2": "Garfield Meadows",
              "City": "Paris",
              "Region": "Île-de-France",
              "PostalCode": "75001",
              "Country": "FR"
          }
      },
      "Shipping": {
          "FirstName": "Alex",
          "LastName": "Smith",
          "Address": {
              "AddressLine1": "6 rue de la Cité",
              "AddressLine2": "Appartement 3",
              "City": "Paris",
              "Region": "île-de-france",
              "PostalCode": "75003",
              "Country": "FR"
          }
      },
      "EndDate": null,
      "Frequency": null,
      "FixedNextAmount": false,
      "FractionedPayment": false,
      "FreeCycles": 0,
      "FirstTransactionDebitedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "FirstTransactionFees": {
          "Currency": "EUR",
          "Amount": 1000
      },
      "NextTransactionDebitedFunds": null,
      "NextTransactionFees": null,
      "Migration": false,
      "PaymentType": "PAYPAL"
  }
  ```
</ResponseExample>

<RequestExample>
  ```json REST   theme={null}
  {
      "AuthorId": "user_m_01J9KR16BG7EDC8RNEY2M18EXK",
      "CreditedWalletId": "wlt_m_01J9KR4A7BH8KVE4PG6DTNS817",
      "FirstTransactionDebitedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "FirstTransactionFees": {
          "Currency": "EUR",
          "Amount": 1000
      },
      "Billing": {
          "FirstName": "Ofelia",
          "LastName": "Kilback",
          "Address": {
              "AddressLine1": "8151 Sipes Turnpike",
              "AddressLine2": "Garfield Meadows",
              "City": "Paris",
              "Region": "Île-de-France",
              "PostalCode": "75001",
              "Country": "FR"
          }
      },
      "Shipping": {
          "FirstName": "Alex",
          "LastName": "Smith",
          "Address": {
              "AddressLine1": "6 rue de la Cité",
              "AddressLine2": "Appartement 3",
              "City": "Paris",
              "Region": "île-de-france",
              "PostalCode": "75003",
              "Country": "FR"
          }
      },
      "PaymentType": "PAYPAL"
  }
  ```
</RequestExample>
