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

# Create a Recurring Card PayIn (CIT or MIT)

POST https://api.sandbox.mangopay.com/v2.01/{ClientId}/payins/recurring/card/direct
Content-Type: application/json

Request a recurring card pay-in based on a `RecurringPayinRegistrationId` with `PaymentType` `CARD`, obtained from [POST Create a Recurring PayIn Registration](/api-reference/recurring-payin-registrations/create-recurring-payin-registration).

There are two possible paylods: 
- **CIT** – Customer-initiated transaction when the user is on session, requiring them to authenticate on the `SecureModeRedirectURL` returned.
- **MIT** – Subsequent merchant-initiated transactions in the absence of the user, based on the initial successful authentication, unless and until re-authentication is required.

Reference: https://docs.mangopay.com/api-reference/recurring-card-payins/create-recurring-card-payin

## Authentication

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

## Servers

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

## Request

### Path parameters

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

### Body (application/json)

This endpoint expects a recurringCardPayins_create_recurring_card_payin_Request.

- `recurringCardPayins_create_recurring_card_payin_Request`

## Response

### 200

Success

- `Id` (string, optional) — Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details) The unique identifier of the object.
- `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`.
- `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the object was created.
- `AuthorId` (string, optional) — The unique identifier of the user at the source of the transaction.
- `DebitedFunds` (RecurringCardPayInResponseDebitedFunds, optional) — Information about the debited funds.
- `CreditedFunds` (RecurringCardPayInResponseCreditedFunds, optional) — Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).
- `Fees` (RecurringCardPayInResponseFees, optional) — Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).
- `Status` (string, optional) — **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction.
- `ResultCode` (string, optional) — The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes.
- `ResultMessage` (string, optional) — The explanation of the result code.
- `ExecutionDate` (integer, optional) — Unix timestamp (UTC) of the date and time the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
- `Type` (string, optional) — **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction.
- `Nature` (string, optional) — **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT` The nature of the transaction, providing more information about the context in which the transaction occurred: - `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow. - `REPUDIATION` – Automatic withdrawal of funds from the platform's repudiation wallet as part of the dispute process (when the user has requested a chargeback). - `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay). - `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute.
- `CreditedWalletId` (string, optional) — The unique identifier of the credited wallet.
- `CreditedUserId` (string, optional) — **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited.
- `PaymentType` (string, optional) — **Returned values:** `CARD` The payment type of the pay-in.
- `ExecutionType` (string, optional) — **Returned values:** `DIRECT` The execution type of the pay-in.
- `StatementDescriptor` (string, optional) — Max. length: 22 characters; only alphanumeric and spaces Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.
- `Billing` (Billing_DefaultsShippingUser_Response, optional) — **Default values:** `FirstName`, `LastName`, and `Address` information of the `Shipping` object if sent, otherwise of the `AuthorId` (if address values present). Information about the billing address.
- `Shipping` (Shipping_DefaultsBillingUser_Response, optional) — **Default values:** `FirstName`, `LastName`, and `Address` information of the `Billing` object if sent, otherwise of the `AuthorId` (if address values present). Information about the shipping address.
- `SecureMode` (string, optional) — **Returned values:** `DEFAULT`, `FORCE`, `NO_CHOICE` The mode applied for the 3DS2 protocol for CB, Visa, and Mastercard. The options are: - `DEFAULT` – Requests an exemption to strong customer authentication (SCA), and thus a frictionless payment experience, if allowed by your Mangopay contract and accepted by the issuer. - `FORCE` – Requests SCA. - `NO_CHOICE` – Leaves the choice to the issuer whether to allow for a frictionless payment experience or to enforce SCA.
- `SecureModeNeeded` (boolean, optional) — Whether or not the `SecureMode` was used.
- `SecureModeReturnURL` (string, optional) — Max. length: 255 characters The URL to which users are automatically returned after 3DS2 if it is triggered (i.e., if the `SecureModeNeeded` parameter is set to `true`).
- `SecureModeRedirectURL` (string, optional) — Max. length: 255 characters The URL to which to redirect the user to proceed to 3DS2 validation.
- `SecurityInfo` (AVSResult, optional) — Information regarding security and anti-fraud tools.
- `BrowserInfo` (BrowserInfo, optional) — Information about the browser used by the end user (author) to perform the payment.
- `IpAddress` (string, optional) — The IP address of the end user initiating the transaction, in IPV4 or IPV6 format.
- `CardId` (string, optional) — The unique identifier of the Card object, obtained during the card registration process.
- `CardInfo` (CardInfo, optional) — Information about the card used for the transaction. If the information or data is not available, `null` is returned.
- `Requested3DSVersion` (string, optional) — **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction.
- `Applied3DSVersion` (string, optional) — **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction.
- `RecurringPayinRegistrationId` (string, optional) — The unique identifier of the recurring pay-in registration.
- `PreferredCardNetwork` (string, optional) — **Allowed values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards.
- `Culture` (string, optional) — **Returned values:** One of the supported languages in the [ISO 639-1 format](/api-reference/overview/data-formats): DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed.
- `DebitedWalletId` (string, optional) — 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.
- `PaymentCategory` (string, optional) — **Default value:** `ECommerce` **Allowed values:** `ECommerce`, `TelephoneOrder` The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: - `ECommerce` – Payment received online. - `TelephoneOrder` – Payment received via mail order or telephone order (MOTO).
- `AuthenticationResult` (AuthenticationResult, optional) — Information about the authentication result, based on the request made by Mangopay and the decision of the issuer regarding the type of authentication to be enforced (if applicable).

## Errors

### 400 Bad Request Error

Bad Request

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

## Types

### CreateARecurringCardPayInCITRequest

Request body for a card customer-initiated transcation (CIT).

- `SecureModeReturnURL` (string, required) — Max. length: 255 characters The URL to which users are automatically returned after 3DS2 if it is triggered (i.e., if the `SecureModeNeeded` parameter is set to `true`).
- `BrowserInfo` (BrowserInfo, required) — Information about the browser used by the end user (author) to perform the payment.
- `IpAddress` (string, required) — The IP address of the end user initiating the transaction, in IPV4 or IPV6 format.
- `RecurringPayinRegistrationId` (string, required) — The unique identifier of the recurring pay-in registration.
- `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`.
- `StatementDescriptor` (string, optional) — Max. length: 22 characters; only alphanumeric and spaces Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.
- `PreferredCardNetwork` (string, optional) — **Allowed values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards.
- `PaymentCategory` (string, optional) — **Default value:** `ECommerce` **Allowed values:** `ECommerce`, `TelephoneOrder` The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: - `ECommerce` – Payment received online. - `TelephoneOrder` – Payment received via mail order or telephone order (MOTO).
- `Culture` (string, optional, deprecated) — The language in which the payment page is to be displayed. This deprecated parameter defaults to `EN`.

### CreateARecurringCardPayInMITRequest

Request body for a card merchant-initiated transaction (MIT).

- `RecurringPayinRegistrationId` (string, required) — The unique identifier of the recurring pay-in registration.
- `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`.
- `DebitedFunds` (CreateARecurringCardPayInMitRequestDebitedFunds, optional) — Information about the debited funds. This property overrides the `NextTransactionDebitedFunds` of the Registration, and is **required if** that property is empty. **Caution:** An amount must be provided in either the Registration's `NextTransactionDebitedFunds` or the pay-in's `DebitedFunds`.
- `Fees` (CreateARecurringCardPayInMitRequestFees, optional) — Information about the fees. This property overrides the `NextTransactionFees` of the Registration, and is **required if** that property is empty. **Caution:** An amount must be provided in either the Registration's `NextTransactionFees` or the pay-in's `Fees`.
- `StatementDescriptor` (string, optional) — Max. length: 22 characters; only alphanumeric and spaces Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details.
- `PaymentCategory` (string, optional) — **Default value:** `ECommerce` **Allowed values:** `ECommerce`, `TelephoneOrder` The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments: - `ECommerce` – Payment received online. - `TelephoneOrder` – Payment received via mail order or telephone order (MOTO).

### RecurringCardPayInResponseDebitedFunds

Information about the debited funds.

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

### RecurringCardPayInResponseCreditedFunds

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

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

### RecurringCardPayInResponseFees

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

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

### Billing_DefaultsShippingUser_Response

**Default values:** `FirstName`, `LastName`, and `Address` information of the `Shipping` object if sent, otherwise of the `AuthorId` (if address values present). Information about the billing address.

- `FirstName` (string, optional) — The first name of the user.
- `LastName` (string, optional) — The last name of the user.
- `Address` (Address, optional) — The postal address.

### Shipping_DefaultsBillingUser_Response

**Default values:** `FirstName`, `LastName`, and `Address` information of the `Billing` object if sent, otherwise of the `AuthorId` (if address values present). Information about the shipping address.

- `FirstName` (string, optional) — The first name of the user.
- `LastName` (string, optional) — The last name of the user.
- `Address` (Address_SubPropsRequired, optional) — The postal address.

### AVSResult

Information regarding security and anti-fraud tools.

- `AVSResult` (string, optional) — The result of the Address Verification System check (only available for UK, US, and Canada).

### BrowserInfo

Information about the browser used by the end user (author) to perform the payment.

- `AcceptHeader` (string, required) — The exact content of the HTTP accept headers as sent to the platform from the end user's browser.
- `JavaEnabled` (boolean, required) — Whether or not the end user's browser has the ability to execute Java.
- `Language` (string, required) — Format: Two-letter language code (ISO 639-1 alpha-2) followed by two-letter country code (ISO 3166-1 alpha-2), separated by a hyphen (example: `en-US`; pattern:`^[a-zA-Z]{2}(-[a-zA-Z]{2})?$`) The language of the browser.
- `ColorDepth` (integer, required) — The value representing the depth of the screen's color palette for displaying images, in bits per pixel.
- `ScreenHeight` (integer, required) — The height of the screen in pixels.
- `ScreenWidth` (integer, required) — The width of the screen in pixels.
- `TimeZoneOffset` (integer, required) — The difference in minutes between the browser's timezone and UTC.
- `UserAgent` (string, required) — The exact content of the HTTP User-Agent header.
- `JavascriptEnabled` (boolean, required) — Whether or not the end user's browser has the ability to execute JavaScript.

### CardInfo

Information about the card used for the transaction. If the information or data is not available, `null` is returned.

- `BIN` (string, optional) — The bank identification number (BIN) of the card.
- `IssuingBank` (string, optional) — The name of the bank that issued the card.
- `IssuerCountryCode` (string, optional) — The country code of the card issuer.
- `Type` (string, optional) — The type of card (for example, `CREDIT` or `DEBIT`).
- `SubType` (string, optional, nullable) — The sub-type of the card, if available.
- `Brand` (string, optional) — The card brand (for example, `VISA` or `MASTERCARD`).

### AuthenticationResult

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

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

### CreateARecurringCardPayInMitRequestDebitedFunds

Information about the debited funds. This property overrides the `NextTransactionDebitedFunds` of the Registration, and is **required if** that property is empty. **Caution:** An amount must be provided in either the Registration's `NextTransactionDebitedFunds` or the pay-in's `DebitedFunds`.

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

### CreateARecurringCardPayInMitRequestFees

Information about the fees. This property overrides the `NextTransactionFees` of the Registration, and is **required if** that property is empty. **Caution:** An amount must be provided in either the Registration's `NextTransactionFees` or the pay-in's `Fees`.

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

### Address

The postal address.

- `AddressLine1` (string, optional) — The first line of the address.
- `AddressLine2` (string, optional) — The second line of the address.
- `City` (string, optional) — The city of the address.
- `Region` (string, optional) — Required if `Country` is US, CA, or MX. The region of the address.
- `PostalCode` (string, optional) — The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
- `Country` (string, optional) — Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats)) The country of the address.

### Address_SubPropsRequired

The postal address.

- `AddressLine1` (string, required) — The first line of the address.
- `City` (string, required) — The city of the address.
- `PostalCode` (string, required) — The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
- `Country` (string, required) — Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats)) The country of the address.
- `AddressLine2` (string, optional) — The second line of the address.
- `Region` (string, optional) — Required if `Country` is US, CA, or MX. The region of the address.

## Examples

### Card CIT

**Request**

```json
{
  "body": {
    "BrowserInfo": {
      "AcceptHeader": "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
      "ColorDepth": 4,
      "JavaEnabled": true,
      "JavascriptEnabled": true,
      "Language": "FR-FR",
      "ScreenHeight": 1800,
      "ScreenWidth": 400,
      "TimeZoneOffset": 60,
      "UserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
    },
    "IpAddress": "3a55:f45c:d44e:ff6a:c63b:f2ec:3a31:eb3e",
    "PreferredCardNetwork": "MASTERCARD",
    "RecurringPayinRegistrationId": "recpayinreg_m_01JJP2KS2A47A0P7S7CEBQPHT9",
    "SecureModeReturnURL": "https://example.com",
    "StatementDescriptor": "Example123",
    "Tag": "Created using Mangopay API Postman Collection"
  }
}
```

**Response**

```json
{
  "Id": "wt_2da30870-9786-45f5-96fa-8b6442e818e7",
  "Tag": "Created using Mangopay API Postman Collection",
  "CreationDate": 1771584873,
  "AuthorId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
  "DebitedFunds": {
    "Currency": "EUR",
    "Amount": 10000
  },
  "CreditedFunds": {
    "Currency": "EUR",
    "Amount": 9000
  },
  "Fees": {
    "Currency": "EUR",
    "Amount": 1000
  },
  "Status": "CREATED",
  "ResultCode": null,
  "ResultMessage": null,
  "ExecutionDate": null,
  "Type": "PAYIN",
  "Nature": "REGULAR",
  "CreditedWalletId": "wlt_m_01KHXAHH2NA3AAMPGE1SJPHJDJ",
  "CreditedUserId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
  "PaymentType": "CARD",
  "ExecutionType": "DIRECT",
  "StatementDescriptor": "Example123",
  "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é",
      "City": "Paris",
      "PostalCode": "75003",
      "Country": "FR",
      "AddressLine2": "Appartement 3",
      "Region": "île-de-France"
    }
  },
  "SecureMode": "DEFAULT",
  "SecureModeNeeded": true,
  "SecureModeReturnURL": "http://example.com?transactionId=wt_2da30870-9786-45f5-96fa-8b6442e818e7",
  "SecureModeRedirectURL": "https://api.sandbox.whenthen.co/payment-gateway/whenthen/threeDS/54b0c206-0a67-43d4-ace6-14a25697cf85/challenge?id=2da30870-9786-45f5-96fa-8b6442e818e7&url=aHR0cHM6Ly9hcGkuc2FuZGJveC53aGVudGhlbi5jby9wYXltZW50cy8zRFNlY3VyZS81NGIwYzIwNi0wYTY3LTQzZDQtYWNlNi0xNGEyNTY5N2NmODUvMWZmYjIyNGUtMjcxNi00NzNmLTg2ZDctOWQxZGU2NjE0MTE4&amount=MTAwMDA&currency=RVVS",
  "SecurityInfo": {
    "AVSResult": "NO_CHECK"
  },
  "BrowserInfo": {
    "AcceptHeader": "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
    "JavaEnabled": true,
    "Language": "FR-FR",
    "ColorDepth": 4,
    "ScreenHeight": 1800,
    "ScreenWidth": 400,
    "TimeZoneOffset": 60,
    "UserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
    "JavascriptEnabled": true
  },
  "IpAddress": "0dfa:4248:0148:b497:65f4:98aa:8e69:13e6",
  "CardId": "card_wt_HodULFWKVRMEecCa",
  "CardInfo": {
    "BIN": "497010",
    "IssuingBank": "LA BANQUE POSTALE",
    "IssuerCountryCode": "MA",
    "Type": "CREDIT",
    "SubType": null,
    "Brand": "VISA"
  },
  "Requested3DSVersion": null,
  "Applied3DSVersion": null,
  "RecurringPayinRegistrationId": "recpayinreg_wt_0995a657-85ea-4860-9177-317b2227e2c7",
  "PreferredCardNetwork": null,
  "Culture": "EN",
  "DebitedWalletId": null,
  "PaymentCategory": "ECommerce",
  "AuthenticationResult": {
    "AuthenticationType": "CHALLENGE"
  }
}
```

**SDK Code**

```python Card CIT
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, RecurringPayInCIT
from mangopay.utils import Money, BrowserInfo

natural_user = NaturalUser.get('210513027')

recurring_payin_cit = RecurringPayInCIT(
    debited_funds = Money(amount=1000, currency='EUR'),
    fees = Money(amount=0, currency='EUR'),
    secure_mode_return_url = 'https://docs.mangopay.com/please-ignore',
    browser_info = BrowserInfo(
        user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
        screen_width = 375,
        screen_height = 667,
        color_depth = 32,
        language = 'EN',
        accept_header = 'application/json,text/javascript,*/*;q=0.01<',
        timezone_offset = '-120',
        java_enabled = True,
        javascript_enabled = True
    ),
    ip_address = '159.180.248.187',
    recurring_payin_registration_id = '213879771',
    tag = 'Created using Mangopay Python SDK'
)

create_recurring_payin_cit = recurring_payin_cit.save()

pprint(create_recurring_payin_cit)

```

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

let myRecurringPayinCIT = {
  Tag: 'Created with Mangopay Nodejs SDK',
  DebitedFunds: {
    Currency: 'EUR',
    Amount: 1000,
  },
  Fees: {
    Currency: 'EUR',
    Amount: 10,
  },
  SecureModeReturnURL: 'https://docs.mangopay.com/please-ignore',
  StatementDescriptor: 'Mangopay',
  BrowserInfo: {
    AcceptHeader:
      'text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8',
    JavaEnabled: true,
    Language: 'FR-FR',
    ColorDepth: 4,
    ScreenHeight: 1800,
    ScreenWidth: 400,
    TimeZoneOffset: 60,
    UserAgent:
      'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
    JavascriptEnabled: true,
  },
  IpAddress: '2d1b:f91a:075a:7fc8:0cb7:b471:cd55:017e',
  RecurringPayiNRegistrationId: '192912686',
}

const createRecurringPayIn = async (recurringPayin) => {
  return await mangopay.PayIns.createRecurringPayInRegistrationCIT(recurringPayin)
    .then((response) => {
      console.info(response)
      return response
    })
    .catch((err) => {
      console.log(err)
      return false
    })
}

createRecurringPayIn(myRecurringPayinCIT)

```

```java Card CIT
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.RecurringPayIn;
import com.mangopay.entities.RecurringPayInCIT;
import com.mangopay.entities.subentities.BrowserInfo;

public class CreateCITRecurringPayin {
    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 recurringPayinRegistrationId = "recpayinreg_m_01J28W33B63S26WP9GA9YWJ5N2";
        
        RecurringPayInCIT citPayin = new RecurringPayInCIT();

        citPayin.setDebitedFunds(new Money(CurrencyIso.EUR, 1000));
        citPayin.setFees(new Money(CurrencyIso.EUR, 0));
        citPayin.setSecureModeReturnURL("https://docs.mangopay.com/please-ignore");
        citPayin.setIpAddress("192.158.1.38");
        citPayin.setRecurringPayInRegistrationId(recurringPayinRegistrationId);

        citPayin.setBrowserInfo(new BrowserInfo());
        citPayin.getBrowserInfo().setAcceptHeader("text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8");
        citPayin.getBrowserInfo().setJavaEnabled(true);
        citPayin.getBrowserInfo().setLanguage("EN");
        citPayin.getBrowserInfo().setColorDepth(4);
        citPayin.getBrowserInfo().setScreenHeight(1800);
        citPayin.getBrowserInfo().setScreenWidth(400);
        citPayin.getBrowserInfo().setTimeZoneOffset("60");
        citPayin.getBrowserInfo().setUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148");
        citPayin.getBrowserInfo().setJavascriptEnabled(true);

        RecurringPayIn createCitPayin = mangopay.getPayInApi().createRecurringPayInCIT(null, citPayin);
        
        Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
        String prettyJson = prettyPrint.toJson(createCitPayin);

        System.out.println(prettyJson);
    }
}

```

```csharp Card CIT
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 registrationId = "recpayinreg_m_01J30K243KTJSRXHWJ03MMEE7A";

        var citPayIn = new RecurringPayInCITPostDTO {
            RecurringPayinRegistrationId = registrationId,
            BrowserInfo = new BrowserInfo {
                AcceptHeader = "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
                JavaEnabled = true,
                Language = "FR-FR",
                ColorDepth = 4,
                ScreenHeight = 1800,
                ScreenWidth = 400,
                JavascriptEnabled = true,
                TimeZoneOffset = "+60",
                UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
            },
            IpAddress = "2001:0620:0000:0000:0211:24FF:FE80:C12C",
            SecureModeReturnURL = "http://www.mangopay.com/please-ignore",
            StatementDescriptor = "MGP",
            Tag = "Created using the Mangopay .NET SDK",
            DebitedFunds = new Money { Amount = 500, Currency = CurrencyIso.EUR },
            Fees = new Money { Amount = 0, Currency = CurrencyIso.EUR }
        };

        var createRecurringCitPayIn = await api.PayIns.CreateRecurringPayInRegistrationCIT(citPayIn);

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

```

```php Card CIT

<?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 {
    $cit = new \MangoPay\RecurringPayInCIT();

    $cit->RecurringPayinRegistrationId = 'recpayinreg_m_01J2EA0TAVQPNY4JGGF1J7RD97';
    $cit->SecureModeReturnURL = "https://docs.mangopay.com/please-ignore";
    $cit->StatementDescriptor = "MGP TEST";
    $cit->Tag = "Generated using Mangopay documentation";
    $cit->IpAddress = "2001:0620:0000:0000:0211:24FF:FE80:C12C";

    $browserInfo = new \MangoPay\BrowserInfo();
    $browserInfo->AcceptHeader = "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8";
    $browserInfo->JavaEnabled = true;
    $browserInfo->Language = "FR-FR";
    $browserInfo->ColorDepth = 4;
    $browserInfo->ScreenHeight = 1800;
    $browserInfo->ScreenWidth = 400;
    $browserInfo->TimeZoneOffset = 60;
    $browserInfo->UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148";
    $browserInfo->JavascriptEnabled = true;

    $cit->BrowserInfo = $browserInfo;

    // Required if the registration's NextTransactionDebitedFunds is empty.
    $cit->DebitedFunds = new \MangoPay\Money();
    $cit->DebitedFunds->Amount = 10;
    $cit->DebitedFunds->Currency = 'EUR';
    $cit->Fees = new \MangoPay\Money();
    $cit->Fees->Amount = 1;
    $cit->Fees->Currency = 'EUR';

    $response = $api->PayIns->CreateRecurringPayInRegistrationCIT($cit);

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

```

```ruby Card CIT

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 CreateRecurringPayInCIT(recurringPayinCITObject)
    begin
        response = MangoPay::PayIn::RecurringPayments::CIT.create(recurringPayinCITObject)
        puts response
        return response
    rescue MangoPay::ResponseError => error
        puts "Failed : #{error.message}"
        puts "Error details: #{error.details}"
        return false
    end
end

my_cit_object = {
    "Tag":"custom meta",
    # "DebitedFunds":{
    #     "Currency":"EUR",
    #     "Amount":900
    # },
    # "Fees":{
    #     "Currency":"EUR",
    #     "Amount":10
    # },
    "SecureModeReturnURL":"https://docs.mangopay.com/please-ignore",
    "StatementDescriptor":"POSTMAN",
    "BrowserInfo":{
        "AcceptHeader":"text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
        "JavaEnabled":true,
        "Language":"FR-FR",
        "ColorDepth":4,
        "ScreenHeight":1800,
        "ScreenWidth":400,
        "TimeZoneOffset":60,
        "UserAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
        "JavascriptEnabled":true
    },
    "IpAddress":"2001:0620:0000:0000:0211:24FF:FE80:C12C",
    "RecurringPayinRegistrationId":"recpayinreg_m_01J2EG8FD7TD6R3HGPZ8ZM917Y",
    "PreferredCardNetwork": "MASTERCARD"
}

CreateRecurringPayInCIT(my_cit_object)

```

### Card MIT

**Request**

```json
{
  "body": {
    "DebitedFunds": {
      "Amount": 10000,
      "Currency": "EUR"
    },
    "Fees": {
      "Amount": 500,
      "Currency": "EUR"
    },
    "RecurringPayinRegistrationId": "recpayinreg_m_01JJP2KS2A47A0P7S7CEBQPHT9",
    "StatementDescriptor": "Example123",
    "Tag": "Created using Mangopay API Postman Collection"
  }
}
```

**Response**

```json
{
  "Id": "wt_1cd7cb00-162d-466f-8641-f476e5a84550",
  "Tag": "Created using Mangopay API Postman Collection",
  "CreationDate": 1771585020,
  "AuthorId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
  "DebitedFunds": {
    "Currency": "EUR",
    "Amount": 10000
  },
  "CreditedFunds": {
    "Currency": "EUR",
    "Amount": 9000
  },
  "Fees": {
    "Currency": "EUR",
    "Amount": 1000
  },
  "Status": "SUCCEEDED",
  "ResultCode": "000000",
  "ResultMessage": "Success",
  "ExecutionDate": 1771585021,
  "Type": "PAYIN",
  "Nature": "REGULAR",
  "CreditedWalletId": "wlt_m_01KHXAHH2NA3AAMPGE1SJPHJDJ",
  "CreditedUserId": "user_m_01KHXAHEBRWSZXJY85TPPR56TK",
  "PaymentType": "CARD",
  "ExecutionType": "DIRECT",
  "StatementDescriptor": "Example123",
  "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é",
      "City": "Paris",
      "PostalCode": "75003",
      "Country": "FR",
      "AddressLine2": "Appartement 3",
      "Region": "île-de-France"
    }
  },
  "SecureMode": "DEFAULT",
  "SecureModeNeeded": false,
  "SecureModeReturnURL": null,
  "SecureModeRedirectURL": null,
  "SecurityInfo": {
    "AVSResult": "NO_CHECK"
  },
  "BrowserInfo": null,
  "IpAddress": null,
  "CardId": "card_wt_HodULFWKVRMEecCa",
  "CardInfo": {
    "BIN": "497010",
    "IssuingBank": "LA BANQUE POSTALE",
    "IssuerCountryCode": "MA",
    "Type": "CREDIT",
    "SubType": null,
    "Brand": "VISA"
  },
  "Requested3DSVersion": null,
  "Applied3DSVersion": "V2_1",
  "RecurringPayinRegistrationId": "recpayinreg_wt_0995a657-85ea-4860-9177-317b2227e2c7",
  "PreferredCardNetwork": null,
  "Culture": "EN",
  "DebitedWalletId": null,
  "PaymentCategory": "ECommerce",
  "AuthenticationResult": {
    "AuthenticationType": "FRICTIONLESS"
  }
}
```

**SDK Code**

```python Card MIT
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, Money, RecurringPayInMIT
from mangopay.utils import BrowserInfo

natural_user = NaturalUser.get('210513027')

recurring_payin_mit = RecurringPayInMIT(
    debited_funds = Money(amount=1000, currency='EUR'),
    secure_mode_return_url = 'http://example.com', 
    browser_info = BrowserInfo( # Missing from doc, but needed here
        user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 _1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
        screen_width = 375,
        screen_height = 667,
        color_depth = 32,
        language = 'EN',
        accept_header = 'application/json,text/javascript,*/*;q=0.01<',
        timezone_offset = '-120',
        java_enabled = True,
        javascript_enabled = True
    ),
    fees = Money(amount=0, currency='EUR'),
    ip_address = '159.180.248.187',
    recurring_payin_registration_id = '213879771',
    statement_descriptor = 'Jan2024',
    tag = 'Created using Mangopay Python SDK'
)

create_recurring_payin_mit = recurring_payin_mit.save()

pprint(create_recurring_payin_mit)

```

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

let myRecurringPayinMIT = {
  Tag: 'Created with Mangopay Nodejs SDK',
  DebitedFunds: {
    Currency: 'EUR',
    Amount: 1000,
  },
  Fees: {
    Currency: 'EUR',
    Amount: 10,
  },
  StatementDescriptor: 'Mangopay',
  RecurringPayiNRegistrationId: '192912686',
}

const createRecurringPayIn = async (recurringPayin) => {
  return await mangopay.PayIns.createRecurringPayInRegistrationMIT(recurringPayin)
    .then((response) => {
      console.info(response)
      return response
    })
    .catch((err) => {
      console.log(err)
      return false
    })
}

createRecurringPayIn(myRecurringPayinMIT)

```

```java Card MIT
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.RecurringPayIn;
import com.mangopay.entities.RecurringPayInMIT;

public class CreateMITRecurringPayin {
    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 recurringPayinRegistrationId = "recpayinreg_m_01J28W33B63S26WP9GA9YWJ5N2";
        
        RecurringPayInMIT mitPayin = new RecurringPayInMIT();

        mitPayin.setDebitedFunds(new Money(CurrencyIso.EUR, 1000));
        mitPayin.setFees(new Money(CurrencyIso.EUR, 0));
        mitPayin.setRecurringPayInRegistrationId(recurringPayinRegistrationId);

        RecurringPayIn createMitPayin = mangopay.getPayInApi().createRecurringPayInMIT(null, mitPayin);
        
        Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
        String prettyJson = prettyPrint.toJson(createMitPayin);

        System.out.println(prettyJson);
    }
}

```

```csharp Card MIT
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 registrationId = "recpayinreg_m_01J30K243KTJSRXHWJ03MMEE7A";

        var mitPayIn = new RecurringPayInMITPostDTO {
            RecurringPayinRegistrationId = registrationId,
            StatementDescriptor = "MGP",
            Tag = "Created using the Mangopay .NET SDK",
            DebitedFunds = new Money { Amount = 1000, Currency = CurrencyIso.EUR },
            Fees = new Money { Amount = 10, Currency = CurrencyIso.EUR }
        };

        var createRecurringMitPayIn = await api.PayIns.CreateRecurringPayInRegistrationMIT(mitPayIn);

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

```

```php Card MIT
<?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 {
    $mit = new \MangoPay\RecurringPayInMIT();

    $mit->RecurringPayinRegistrationId = 'recpayinreg_m_01J2EG8FD7TD6R3HGPZ8ZM917Y';
    $mit->StatementDescriptor = "MGP TEST";
    $mit->Tag = "Generated using Mangopay documentation";

    // Required if the registration's NextTransactionDebitedFunds is empty.
    $mit->DebitedFunds = new \MangoPay\Money();
    $mit->DebitedFunds->Amount = 10;
    $mit->DebitedFunds->Currency = 'EUR';
    $mit->Fees = new \MangoPay\Money();
    $mit->Fees->Amount = 1;
    $mit->Fees->Currency = 'EUR';

    $response = $api->PayIns->CreateRecurringPayInRegistrationMIT($mit);

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

```

```ruby Card MIT
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 CreateRecurringPayInMIT(recurringPayinMITObject)
  begin
      response = MangoPay::PayIn::RecurringPayments::MIT.create(recurringPayinMITObject)
      puts response
      return response
  rescue MangoPay::ResponseError => error
      puts "Failed : #{error.message}"
      puts "Error details: #{error.details}"
      return false
  end
end

my_mit_object = {
  "Tag":"custom meta",
  # "DebitedFunds":{
  #     "Currency":"EUR",
  #     "Amount":900
  # },
  # "Fees":{
  #     "Currency":"EUR",
  #     "Amount":10
  # },
  "StatementDescriptor":"POSTMAN",
  "RecurringPayinRegistrationId":"recpayinreg_m_01J2EG8FD7TD6R3HGPZ8ZM917Y",
}

CreateRecurringPayInMIT(my_mit_object)

```