> ## 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 (Card)

### Body parameters

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

<ParamField body="CardId" type="string" required>
  The unique identifier of the Card object, obtained during the card registration process.
</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="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">
  **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">
    <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">
  **Default value:** FirstName, LastName, and Address information of the Billing object, if supplied, otherwise of the user (author).

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

  <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="EndDate" type="Unix timestamp">
  The date and time at which the recurring pay-ins will end. This value has no impact on the recurring registration `Status`.\
  Caution: If the `EndDate` is left unspecified, please bear in mind that one could be defined by default and be displayed to your end users (not taken into account in the payment recurrence).
</ParamField>

<ParamField body="Frequency" type="string">
  **Allowed values:** `Daily`, `Weekly`, `TwiceAMonth`, `Monthly`, `Bimonthly`, `Quarterly`, `Semiannual`, `Annual`, `Biannual`

  The frequency at which the recurring pay-ins will occur:

  * `Daily` – 1 transaction per day.
  * `Weekly` – 1 transaction every 7 days.
  * `TwiceAMonth` – 2 transactions per month.
  * `Monthly` – 1 transaction per month.
  * `Bimonthly` – 1 transaction every 2 months.
  * `Quarterly` – 1 transaction every 3 months.
  * `Semiannual` – 1 transaction every 6 months.
  * `Annual` – 1 transaction per year.
  * `Biannual` – 1 transaction every 2 years.
</ParamField>

<ParamField body="FixedNextAmount" type="boolean">
  Whether or not the recurring pay-ins’ debited amounts remain the same for all the pay-ins linked to the recurring registration object.
</ParamField>

<ParamField body="FractionedPayment" type="boolean">
  Whether or not the recurring pay-ins are being made to split a payment in several installments.
</ParamField>

<ParamField body="FreeCycles" type="integer">
  The number of initial consecutive pay-ins where there will be no debited funds nor fees.\
  This value cannot exceed the `CycleNumber` value (for recurring objects with an `EndDate`, `FixedNextAmount`, and `Frequency`).\
  Note: When creating a recurring pay-in (CIT or MIT) for a pay-in subject to a free cycle, the `DebitedFunds` and `Fees` parameters cannot be sent.
</ParamField>

<ParamField body="Migration" type="boolean" deprecated>
  Whether or not to attempt the first recurring pay-in as a merchant-initiated transaction (MIT).

  **Caution:** Migration is no longer supported. You can only use objects with `Migration` set to `false`. When Mangopay decommissions this parameter (date communicated by email), the `false` value will be forced on all objects, including existing ones. Before decommissioning, you need to re-create the object; after decommissioning, you can re-authenticate the same object.

  The need to re-authenticate may be indicated by the `Status` changing to `AUTHENTICATION_NEEDED` or by errors on the pay-in request, for example: non-existent card account (<a href="/errors/codes/008008">008008</a>), soft decline (<a href="/errors/codes/101305">101305</a>), expired card (<a href="/errors/codes/101105">101105</a>), or stolen card (<a href="/errors/codes/008003">008003</a>).
</ParamField>

<ParamField body="NextTransactionDebitedFunds" type="object">
  The amount of the subsequent recurring pay-ins.
  If this field is empty and either `FixedNextAmount` or `FractionedPayment` are `true`, the subsequent amount will be the same as `FirstTransactionDebitedFunds` amount.

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

      * `CREATED` – The recurring registration was created, but no recurring pay-in has yet been made.
      * `AUTHENTICATION_NEEDED` – The latest recurring pay-in linked to the registration object was refused. The registration object can still be used, but you need to execute a new customer-initiated transaction (CIT) for the end user to reauthenticate.
      * `IN_PROGRESS` – The recurring registration object is in use and the subsequent corresponding recurring pay-ins can be made.
      * `ENDED` – The recurrence ended: the registration can no longer be modified nor reused.
    </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:** `CLASSIC_SUBSCRIPTION`, `FRACTIONED_PAYMENT`, `CUSTOM`

      The type of recurrence, which can be one of the following:

      * `CLASSIC_SUBSCRIPTION` – For fixed-amount subscriptions. The `Amount` of each pay-in and the subscription’s `EndDate` are known, and these values cannot be modified during the recurrence.
      * `FRACTIONED_PAYMENT` – For payments in 3 or 4 times. The `Amount` of each pay-in and the registration’s `EndDate` are known, and these values cannot be modified during the recurrence.
      * `CUSTOM` – For recurring registrations where the `Amount` and `EndDate` are unknown.
    </ResponseField>

    <ResponseField name="TotalAmount" type="object">
      The total amount in the registration.

      This value is automatically calculated based on the `EndDate`, `FixedNextAmount`, and `Frequency` parameters (if defined).

      <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="CycleNumber" type="integer">
      The number of cycles in the registration (and therefore the number of payments).\
      This value is automatically calculated based on the `EndDate`, `FixedNextAmount`, and `Frequency` parameters (if defined).
    </ResponseField>

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

    <ResponseField name="CardId" type="string">
      The unique identifier of the Card object, obtained during the card registration process.
    </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">
      **Default value:** FirstName, LastName, and Address information of the Billing object, if supplied, otherwise of the user (author).

      Information about the end user’s shipping 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 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">
      The date and time at which the recurring pay-ins will end. This value has no impact on the recurring registration `Status`.\
      Caution: If the `EndDate` is left unspecified, please bear in mind that one could be defined by default and be displayed to your end users (not taken into account in the payment recurrence).
    </ResponseField>

    <ResponseField name="Frequency" type="string">
      **Returned values:** `Daily`, `Weekly`, `TwiceAMonth`, `Monthly`, `Bimonthly`, `Quarterly`, `Semiannual`, `Annual`, `Biannual`

      The frequency at which the recurring pay-ins will occur:

      * `Daily` – 1 transaction per day.
      * `Weekly` – 1 transaction every 7 days.
      * `TwiceAMonth` – 2 transactions per month.
      * `Monthly` – 1 transaction per month.
      * `Bimonthly` – 1 transaction every 2 months.
      * `Quarterly` – 1 transaction every 3 months.
      * `Semiannual` – 1 transaction every 6 months.
      * `Annual` – 1 transaction per year.
      * `Biannual` – 1 transaction every 2 years.
    </ResponseField>

    <ResponseField name="FixedNextAmount" type="boolean">
      Whether or not the recurring pay-ins’ debited amounts remain the same for all the pay-ins linked to the recurring registration object.
    </ResponseField>

    <ResponseField name="FractionedPayment" type="boolean">
      Whether or not the recurring pay-ins are being made to split a payment in several installments.
    </ResponseField>

    <ResponseField name="FreeCycles" type="integer">
      The number of initial consecutive pay-ins where there will be no debited funds nor fees.\
      This value cannot exceed the `CycleNumber` value (for recurring objects with an `EndDate`, `FixedNextAmount`, and `Frequency`).\
      Note: When creating a recurring pay-in (CIT or MIT) for a pay-in subject to a free cycle, the `DebitedFunds` and `Fees` parameters cannot be sent.
    </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.
      If this field is empty and either `FixedNextAmount` or `FractionedPayment` are `true`, the subsequent amount will be the same as `FirstTransactionDebitedFunds` amount.

      <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>
      Whether or not to attempt the first recurring pay-in as a merchant-initiated transaction (MIT).

      **Caution:** Migration is no longer supported. You can only use objects with `Migration` set to `false`. When Mangopay decommissions this parameter (date communicated by email), the `false` value will be forced on all objects, including existing ones. Before decommissioning, you need to re-create the object; after decommissioning, you can re-authenticate the same object.

      The need to re-authenticate may be indicated by the `Status` changing to `AUTHENTICATION_NEEDED` or by errors on the pay-in request, for example: non-existent card account (<a href="/errors/codes/008008">008008</a>), soft decline (<a href="/errors/codes/101305">101305</a>), expired card (<a href="/errors/codes/101105">101105</a>), or stolen card (<a href="/errors/codes/008003">008003</a>).
    </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>

<ResponseExample>
  ```json 200 theme={null}
  {
      "Id": "recpayinreg_m_01JJP2KS2A47A0P7S7CEBQPHT9",
      "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_01JHX34N3Y9BCQP7KR9QWWETDQ",
      "CardId": "card_m_UsklnOoXBWyyqhsN",
      "CreditedUserId": "user_m_01JHX34N3Y9BCQP7KR9QWWETDQ",
      "CreditedWalletId": "wlt_m_01JJ70WZ9JRAZ9GE0DA36Q84NQ",
      "Billing": {
          "FirstName": "Alex",
          "LastName": "Smith",
          "Address": {
              "AddressLine1": "6 rue de la Cité",
              "AddressLine2": "Appartement 3",
              "City": "Paris",
              "Region": "île-de-France",
              "PostalCode": "75003",
              "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": "Monthly",
      "FixedNextAmount": true,
      "FractionedPayment": false,
      "FreeCycles": 0,
      "FirstTransactionDebitedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "FirstTransactionFees": {
          "Currency": "EUR",
          "Amount": 500
      },
      "NextTransactionDebitedFunds": null,
      "NextTransactionFees": null,
      "Migration": false,
      "PaymentType": "CARD_DIRECT"
  }
  ```

  ```json 200 - Blocked by fraud policy theme={null}
  {
      "Id": "payin_m_01HPHHMCN6WDH7NH1C63005DK5",
      "Status": "ENDED",
      "ResultCode": "008500",
      "ResultMessage": "Transaction blocked by Fraud Policy",
      "CurrentState": {
          "PayinsLinked": 0,
          "CumulatedDebitedAmount": {
              "Currency": "EUR",
              "Amount": 0
          },
          "CumulatedFeesAmount": {
              "Currency": "EUR",
              "Amount": 0
          },
          "LastPayinId": null
      },
      "RecurringType": "CUSTOM",
      "TotalAmount": null,
      "CycleNumber": null,
      "AuthorId": "206433201",
      "CardId": "card_m_01HPHHKEEND3HN0DR4XS4RST2E",
      "CreditedUserId": "213407540",
      "CreditedWalletId": "214818911",
      "Billing": {
          "FirstName": "Tristin",
          "LastName": "Towne",
          "Address": {
              "AddressLine1": "18758 Hermiston Mall",
              "AddressLine2": "Wilford Cliff",
              "City": "Paris",
              "Region": "Île-de-France",
              "PostalCode": "75001",
              "Country": "FR"
          }
      },
      "Shipping": {
          "FirstName": "Kaia",
          "LastName": "Wilkinson",
          "Address": {
              "AddressLine1": "69241 Chaya Ports",
              "AddressLine2": "Ebert Ports",
              "City": "Paris",
              "Region": "Île-de-France",
              "PostalCode": "75001",
              "Country": "FR"
          }
      },
      "EndDate": null,
      "Frequency": "Monthly",
      "FixedNextAmount": true,
      "FractionedPayment": false,
      "FreeCycles": 0,
      "FirstTransactionDebitedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "FirstTransactionFees": {
          "Currency": "EUR",
          "Amount": 1000
      },
      "NextTransactionDebitedFunds": null,
      "NextTransactionFees": null,
      "Migration": false,
      "PaymentType":"CARD_DIRECT"
  }  
  ```
</ResponseExample>

<RequestExample>
  ```json REST   theme={null}
  {
      "AuthorId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
      "CardId": "card_wt_HodULFWKVRMEecCa",
      "CreditedWalletId": "wlt_m_01KHXAHH2NA3AAMPGE1SJPHJDJ",
      "FirstTransactionDebitedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "FirstTransactionFees": {
          "Currency": "EUR",
          "Amount": 1000
      },
      "Billing": {
          "FirstName": "Alex",
          "LastName": "Smith",
          "Address": {
              "AddressLine1": "6 rue de la Cité",
              "AddressLine2": "Appartement 3",
              "City": "Paris",
              "Region": "île-de-France",
              "PostalCode": "75003",
              "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"
          }
      },
      "Frequency": "Monthly",
      "FixedNextAmount": true,
      "FractionedPayment": false   
  }
  ```

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

  $api = new MangoPayApi();

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

  try {
      $payIn = new \MangoPay\PayInRecurringRegistration();

      $payIn->AuthorId = "user_m_01J2CBKKMQJ95BGHCW0A2F9DE1";
      $payIn->CardId = "card_m_01J2CBM93A3R36V2T2HFC2RRW4";
      $payIn->CreditedUserId = "user_m_01J2CBPBE80P5Z8BTY9GJWQTVM";
      $payIn->CreditedWalletId = "wlt_m_01J2CBPWWRKK4G65X4MTBVNWPS";

      $payIn->FirstTransactionDebitedFunds = new \MangoPay\Money();
      $payIn->FirstTransactionDebitedFunds->Amount = 12;
      $payIn->FirstTransactionDebitedFunds->Currency = 'EUR';
      $payIn->FirstTransactionFees = new \MangoPay\Money();
      $payIn->FirstTransactionFees->Amount = 1;
      $payIn->FirstTransactionFees->Currency = 'EUR';

      $adress = new \MangoPay\Address();
      $adress->AddressLine1 = '4 rue de la Tour des Dames';
      $adress->AddressLine2 = 'Mangopay office';
      $adress->City = 'Paris';
      $adress->Country = 'FR';
      $adress->PostalCode = '75009';
      $adress->Region = 'Île-de-France';

      $billing = new \MangoPay\Billing();
      $billing->FirstName = 'John';
      $billing->LastName = 'Doe';
      $billing->Address = $adress;

      $shipping = new \MangoPay\Shipping();
      $shipping->FirstName = 'John';
      $shipping->LastName = 'Doe';
      $shipping->Address = $adress;

      $payIn->Shipping = $shipping;
      $payIn->Billing = $billing;

      $payIn->FreeCycles = 0;

      $response = $api->PayIns->CreateRecurringRegistration($payIn);

      print_r($response);
  } 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 myRecurringRegistration = {
    PaymentType: 'CARD',
    ExecutionType: 'DIRECT',
    AuthorId: '146476890',
    CardId: '169687329',
    CreditedUserId: '146476890',
    CreditedWalletId: '148968396',
    FirstTransactionDebitedFunds: {
      Currency: 'EUR',
      Amount: 1000,
    },
    FirstTransactionFees: {
      Currency: 'EUR',
      Amount: 10,
    },
    Billing: {
      FirstName: 'Alex',
      LastName: 'Smith',
      Address: {
        AddressLine1: 'Rue des plantes',
        AddressLine2: 'The Oasis',
        City: 'Paris',
        Region: 'IDF',
        PostalCode: '75000',
        Country: 'FR',
      },
    },
    Shipping: {
      FirstName: 'Alex',
      LastName: 'Smith',
      Address: {
        AddressLine1: 'Rue des plantes',
        AddressLine2: 'The Oasis',
        City: 'Paris',
        Region: 'IDF',
        PostalCode: '75000',
        Country: 'FR',
      },
    },
    EndDate: 1698923634,
    Frequency: 'Monthly',
    FixedNextAmount: false,
    FractionedPayment: false,
    FreeCycles: 0,
    NextTransactionDebitedFunds: {
      Currency: 'EUR',
      Amount: 1000,
    },
    NextTransactionFees: {
      Currency: 'EUR',
      Amount: 10,
    },
  }

  const createRecurringRegistration = async (recurringRegistration) => {
    return await mangopay.PayIns.createRecurringPayment(recurringRegistration)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  createRecurringRegistration(myRecurringRegistration)  
  ```

  ```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 createRecurringRegistration(recurringRegistrationObject)
      begin
          response = MangoPay::PayIn::RecurringPayments::Recurring.create(recurringRegistrationObject)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to create recurring registration: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  my_recurring_registration = {
    AuthorId: '146476890',
    CardId: '169687329',
    CreditedUserId: '146476890',
    CreditedWalletId: '148968396',
    FirstTransactionDebitedFunds: {
      Currency: 'EUR',
      Amount: 1000,
    },
    FirstTransactionFees: {
      Currency: 'EUR',
      Amount: 10,
    },
    Billing: {
      FirstName: 'Alex',
      LastName: 'Smith',
      Address: {
        AddressLine1: 'Rue des plantes',
        AddressLine2: 'The Oasis',
        City: 'Paris',
        Region: 'IDF',
        PostalCode: '75000',
        Country: 'FR',
      },
    },
    Shipping: {
      FirstName: 'Alex',
      LastName: 'Smith',
      Address: {
        AddressLine1: 'Rue des plantes',
        AddressLine2: 'The Oasis',
        City: 'Paris',
        Region: 'IDF',
        PostalCode: '75000',
        Country: 'FR',
      },
    },
    EndDate: 1698923634,
    Frequency: 'Monthly',
    FixedNextAmount: false,
    FractionedPayment: false,
    FreeCycles: 0,
    NextTransactionDebitedFunds: {
      Currency: 'EUR',
      Amount: 1000,
    },
    NextTransactionFees: {
      Currency: 'EUR',
      Amount: 10,
    },
  }

  createRecurringRegistration(my_recurring_registration)  
  ```

  ```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.RecurringPayment;

  public class CreateRecurringPayinRegistration {
      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 cardId = "card_m_01HZ6YAQF4MR0VRQ06YG06SD99";
          var walletId = "wlt_m_01HTHTXEF4BJCTKMXNWMSZ6KP5";
          
          RecurringPayment recurringPayinRegistration = new RecurringPayment();
          recurringPayinRegistration.setAuthorId(userId);
          recurringPayinRegistration.setCardId(cardId);
          recurringPayinRegistration.setCreditedWalletId(walletId);

          recurringPayinRegistration.setFirstTransactionDebitedFunds(new Money());
          recurringPayinRegistration.getFirstTransactionDebitedFunds().setAmount(1000);
          recurringPayinRegistration.getFirstTransactionDebitedFunds().setCurrency(CurrencyIso.EUR);

          recurringPayinRegistration.setFirstTransactionFees(new Money());
          recurringPayinRegistration.getFirstTransactionFees().setAmount(0);
          recurringPayinRegistration.getFirstTransactionFees().setCurrency(CurrencyIso.EUR);

          RecurringPayment createRecurringPayinRegistration = mangopay.getPayInApi().createRecurringPayment(null, recurringPayinRegistration);
          
          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(createRecurringPayinRegistration);

          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, RecurringPayInRegistration
  from mangopay.utils import Money

  natural_user = NaturalUser.get('210513027')

  recurring_payin_registration = RecurringPayInRegistration(
      author_id = natural_user.id,
      card_id = '213857548',
      credited_wallet_id = '210514820',
      first_transaction_debited_funds = Money(amount=1000, currency='EUR'),
      first_transaction_fees = Money(amount=10, currency='EUR'),
      tag = 'Created using Mangopay Python SDK'
  )

  create_recurring_payin_registration = recurring_payin_registration.save()

  pprint(create_recurring_payin_registration)  
  ```

  ```csharp .NET theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Core.Enumerations;
  using MangoPay.SDK.Entities;
  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_01J30991BXBB7VF28PBS82EWD3";
          var cardId = "card_m_01J3049JBA2XPA7GC7GEFJRQG4";

          var recurringPayInRegistration = new RecurringPayInRegistrationPostDTO
          {
              AuthorId = userId,
              CardId = cardId,
              CreditedUserId = userId,
              CreditedWalletId = walletId,
              FirstTransactionDebitedFunds = new Money { Amount = 5000, Currency = CurrencyIso.EUR },
              FirstTransactionFees = new Money { Amount = 50, Currency = CurrencyIso.EUR },
              Billing = new Billing {
                  FirstName = "Joe",
                  LastName = "Blogs",
                  Address = new Address
                  {
                      AddressLine1 = "1 MangoPay Street",
                      AddressLine2 = "The Loop",
                      City = "Paris",
                      Region = "Ile de France",
                      PostalCode = "75001",
                      Country = CountryIso.FR
                  }
              },
              Shipping = new Shipping {
                  FirstName = "Joe",
                  LastName = "Blogs",
                  Address = new Address
                  {
                      AddressLine1 = "1 MangoPay Street",
                      AddressLine2 = "The Loop",
                      City = "Paris",
                      Region = "Ile de France",
                      PostalCode = "75001",
                      Country = CountryIso.FR
                  }
              },
              EndDate = DateTime.Now.AddDays(365),
              Migration = true,
              NextTransactionDebitedFunds = new Money { Amount = 1000, Currency = CurrencyIso.EUR },
              NextTransactionFees = new Money { Amount = 10, Currency = CurrencyIso.EUR },
              Frequency = "Monthly",
              FixedNextAmount = true,
              FractionedPayment = false
          };

          var createRecurringPayInRegistration = await api.PayIns.CreateRecurringPayInRegistration(recurringPayInRegistration);

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