# The API Response object ### Description The API Response object is a record of a response made by the API in the past. It can only be retrieved by using the idempotency feature. **Caution– Limited availability of API responses** You can only retrieve responses within 24 hours of the initial use of the idempotency key. ### Attributes The HTTP response code indicating the success or the failure of the request. The size of the message body in bytes. The media type (two-part identifier for file formats and format contents) of the resource. The date and time when the response was sent. The URL of the API request. The body of the request’s response. # View an API Response GET /v2.01/{ClientId}/responses/{IdempotencyKey} This call returns an API response based on the corresponding idempotency key, within 24 hours of the initial call. ### Path parameters *Min. length: 16 characters; max. length: 36 characters; only alphanumeric and dashes* A unique string generated by the platform. ### Responses The HTTP response code indicating the success or the failure of the request. The size of the message body in bytes. The media type (two-part identifier for file formats and format contents) of the resource. The date and time when the response was sent. The URL of the API request. The body of the request’s response. ```json 200 { "StatusCode": "200", "ContentLength": "591", "ContentType": "application/json; charset=utf-8", "Date": "Tue, 19 Jul 2022 08:47:59 GMT", "RequestURL": "https://api.mangopay.com/V2.01/clientId/users/natural", "Resource": { "Address": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "Paris", "Region": "Ile de France", "PostalCode": "75001", "Country": "FR" }, "FirstName": "Jane", "LastName": "Doe", "Birthday": null, "Nationality": null, "CountryOfResidence": null, "Occupation": null, "IncomeRange": null, "ProofOfIdentity": null, "ProofOfAddress": null, "Capacity": "NORMAL", "Id": "146476890", "Tag": "test doc july 2022", "CreationDate": 1658220479, "PersonType": "NATURAL", "Email": "jdoe@mail.com", "KYCLevel": "LIGHT", "TermsAndConditionsAccepted": true, "TermsAndConditionsAcceptedDate": 1658220479, "UserCategory": "PAYER" } } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'your-temporary-folder-path'; try { $idempotencyKey = "fk7urhkW45kpTHf445608d"; $response = $api->Responses->Get($idempotencyKey); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.IdempotencyResponse; public class ViewApiResponse { 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 key = "P7urhkW45pTHf4498B"; IdempotencyResponse viewReponse = mangopay.getIdempotencyApi().get(key); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(viewReponse); System.out.println(prettyJson); } } ``` ```python Python 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 IdempotencyResponse key = 'ok7urhkW45-pTHf4496-80' idempotency_response = IdempotencyResponse.get(key) pprint(idempotency_response._data) ``` ```csharp .NET using MangoPay.SDK; 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 idempotencyKey = "kRitowx83-okajuE-934K"; var viewApiResponse = await api.Idempotent.GetAsync(idempotencyKey); string prettyPrint = JsonConvert.SerializeObject(viewApiResponse, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Apple Pay PayIn object ### Description The Apple Pay PayIn object allows platforms to process payments with Apple Pay. **Note – Prerequisites to using Apple Pay** Using Apple Pay requires and activation from Mangopay, and your platform also needs to integrate with Apple Pay directly. See the [Apple Pay guide](/guides/payment-methods/apple-pay) for more information. ### Attributes The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **Returned 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 funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `APPLEPAY` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. The mode applied for the 3DS2 protocol. On Apple Pay, this value is returned `null` as 3DS redirection is not applicable. With Apple Pay, this parameter is always `null`. *Max. length: 255 characters* The URL to which users are automatically returned after 3DS2 if it is triggered. On Apple Pay, `null` is returned as 3DS redirection does not apply. *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. On Apple Pay, `null` is returned as 3DS redirection does not apply. Whether or not the `SecureMode` was used. The language in which the payment page is to be displayed. On Apple Pay, `null` is returned. Information regarding security and anti-fraud tools. The result of the Address Verification System check (only available for UK, US, and Canada). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. On Apple Pay, `null` is returned as 3DS redirection does not apply. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. On Apple Pay, `null` is returned as 3DS redirection does not apply. Information about the end user billing address. On Apple Pay, `null` is returned as 3DS redirection does not apply. Information about the end user’s shipping address. On Apple Pay, `null` is returned as 3DS redirection does not apply. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The unique identifier of the recurring pay-in registration. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Related resources Learn more about Apple Pay Learn about testing Apple Pay # Create an Apple Pay PayIn POST /v2.01/{ClientId}/payins/applepay/direct ### Body parameters *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique identifier of the user at the source of the transaction. The unique identifier of the credited wallet. Information about the debited funds. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **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 funds. 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`). Information about the fees. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **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 funds. 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`). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. The data returned by Apple Pay containing information about the payment. Apple Pay’s unique identifier of the payment. The payment network used for the payment request. The encrypted string for the payment request. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **Returned 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 funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `APPLEPAY` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. The mode applied for the 3DS2 protocol. On Apple Pay, this value is returned `null` as 3DS redirection is not applicable. For PayPal recurring registrations, this value is returned `null`. *Max. length: 255 characters* The URL to which users are automatically returned after 3DS2 if it is triggered. On Apple Pay, `null` is returned as 3DS redirection does not apply. *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. On Apple Pay, `null` is returned as 3DS redirection does not apply. Whether or not the `SecureMode` was used. The language in which the payment page is to be displayed. On Apple Pay, `null` is returned. Information regarding security and anti-fraud tools. The result of the Address Verification System check (only available for UK, US, and Canada). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. On Apple Pay, `null` is returned as 3DS redirection does not apply. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. On Apple Pay, `null` is returned as 3DS redirection does not apply. Information about the end user billing address. On Apple Pay, `null` is returned as 3DS redirection does not apply. Information about the end user’s shipping address. On Apple Pay, `null` is returned as 3DS redirection does not apply. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The unique identifier of the recurring pay-in registration. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 - Success { "Id": "payin_m_01J83BDHEBH7Z0ZSR7WZXEZ6RB", "Tag": "Created using the Mangopay API Postman collection", "CreationDate": 1726689494, "AuthorId": "user_m_01J84RCFJ0Q9RVQZ13618FSNWN", "CreditedUserId": "user_m_01J84RCFJ0Q9RVQZ13618FSNWN", "DebitedFunds": { "Currency": "EUR", "Amount": 1600 }, "CreditedFunds": { "Currency": "EUR", "Amount": 1600 }, "Fees": { "Currency": "EUR", "Amount": 0 }, "Status": "SUCCEEDED", "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1726689503, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01J84RDF46N1EQJ9ZA1560B1ZK", "DebitedWalletId": null, "PaymentType": "APPLEPAY", "ExecutionType": "DIRECT", "SecureMode": null, "CardId": null, "SecureModeReturnURL": null, "SecureModeRedirectURL": null, "SecureModeNeeded": false, "Culture": null, "SecurityInfo": { "AVSResult": "NO_CHECK" }, "StatementDescriptor": "Custom data", "BrowserInfo": null, "IpAddress": null, "Billing": null, "Shipping": null, "Requested3DSVersion": null, "Applied3DSVersion": null, "RecurringPayinRegistrationId": null, "PreferredCardNetwork": null, "PaymentCategory": null, "CardInfo": { "BIN": "516398", "IssuingBank": "BANCO SANTANDER S.A.", "IssuerCountryCode": "ES", "Type": "DEBIT", "Brand": "MASTERCARD", "SubType": "PLATINUM" } } ``` ```json REST { "Tag": "Created using the Mangopay API Postman collection", "AuthorId": "user_m_01J84RCFJ0Q9RVQZ13618FSNWN", "CreditedWalletId": "wlt_m_01J84RDF46N1EQJ9ZA1560B1ZK", "DebitedFunds": { "Currency": "EUR", "Amount": 1600 }, "Fees": { "Currency": "EUR", "Amount": 0 }, "StatementDescriptor": "Custom data", "PaymentData": { "transactionId": "97e64d87f13a89ff6443cdcc205d5ccf7e15368b0d64126a8a2e0888a3a5c2a0", "network": "MasterCard", "tokenData": "{\"data\":\"2TihgKbmyPje02jYvkB6P+a6LCNmvKTFi4b7UN32sP4FJkllQP8CXIUPdv71xpIpBHetQ6TL7ON3Yex3L0Sc9hm15pME46/5fehwUxmgiumiK1eTupckAST6Zc0IYy2f9iJB9XpX+6dnKqTj7di12bo/iDXW4g2rbenNiDI0caiWebDaUG9DHSFjDxipQWx3Z8rf+zDiMGuDwO41LVh2SA1hRVbdINLpPpLtpxvyDeDkPQVohakcE+sK83QCHx0cEahAUKj6gAv6QuOLtWTsTtad04/ct3G0GnGeRp9p0fE0yJ+s4ybPj4WuV8lKNm6Lsg/WS9TqzT3RFgdjDjGdZ8W1CaEb/deG+Hh4MCebVJBP7iEdyfkB1afjJa0AqfbOBW2SIKXULtjP84QP\",\"signature\":\"MIAGCSqGSIb3DQEHAqCAMIACAQExDTALBglghkgBZQMEAgEwgAYJKoZIhvcNAQcBAACggDCCA+MwggOIoAMCAQICCEwwQUlRnVQ2MAoGCCqGSM49BAMCMHoxLjAsBgNVBAMMJUFwcGxlIEFwcGxpY2F0aW9uIEludGVncmF0aW9uIENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xOTA1MTgwMTMyNTdaFw0yNDA1MTYwMTMyNTdaMF8xJTAjBgNVBAMMHGVjYy1zbXAtYnJva2VyLXNpZ25fVUM0LVBST0QxFDASBgNVBAsMC2lPUyBTeXN0ZW1zMRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMIVd+3r1seyIY9o3XCQoSGNx7C9bywoPYRgldlK9KVBG4NCDtgR80B+gzMfHFTD9+syINa61dTv9JKJiT58DxOjggIRMIICDTAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFCPyScRPk+TvJ+bE9ihsP6K7/S5LMEUGCCsGAQUFBwEBBDkwNzA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZWFpY2EzMDIwggEdBgNVHSAEggEUMIIBEDCCAQwGCSqGSIb3Y2QFATCB/jCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlYWljYTMuY3JsMB0GA1UdDgQWBBSUV9tv1XSBhomJdi9+V4UH55tYJDAOBgNVHQ8BAf8EBAMCB4AwDwYJKoZIhvdjZAYdBAIFADAKBggqhkjOPQQDAgNJADBGAiEAvglXH+ceHnNbVeWvrLTHL+tEXzAYUiLHJRACth69b1UCIQDRizUKXdbdbrF0YDWxHrLOh8+j5q9svYOAiQ3ILN2qYzCCAu4wggJ1oAMCAQICCEltL786mNqXMAoGCCqGSM49BAMCMGcxGzAZBgNVBAMMEkFwcGxlIFJvb3QgQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE0MDUwNjIzNDYzMFoXDTI5MDUwNjIzNDYzMFowejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8BcRhBnXZIXVGl4lgQd26ICi7957rk3gjfxLk+EzVtVmWzWuItCXdg0iTnu6CP12F86Iy3a7ZnC+yOgphP9URaOB9zCB9DBGBggrBgEFBQcBAQQ6MDgwNgYIKwYBBQUHMAGGKmh0dHA6Ly9vY3NwLmFwcGxlLmNvbS9vY3NwMDQtYXBwbGVyb290Y2FnMzAdBgNVHQ4EFgQUI/JJxE+T5O8n5sT2KGw/orv9LkswDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS7sN6hWDOImqSKmd6+veuv2sskqzA3BgNVHR8EMDAuMCygKqAohiZodHRwOi8vY3JsLmFwcGxlLmNvbS9hcHBsZXJvb3RjYWczLmNybDAOBgNVHQ8BAf8EBAMCAQYwEAYKKoZIhvdjZAYCDgQCBQAwCgYIKoZIzj0EAwIDZwAwZAIwOs9yg1EWmbGG+zXDVspiv/QX7dkPdU2ijr7xnIFeQreJ+Jj3m1mfmNVBDY+d6cL+AjAyLdVEIbCjBXdsXfM4O5Bn/Rd8LCFtlk/GcmmCEm9U+Hp9G5nLmwmJIWEGmQ8Jkh0AADGCAYgwggGEAgEBMIGGMHoxLjAsBgNVBAMMJUFwcGxlIEFwcGxpY2F0aW9uIEludGVncmF0aW9uIENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUwIITDBBSVGdVDYwCwYJYIZIAWUDBAIBoIGTMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTIzMTAwNDE0MjczMlowKAYJKoZIhvcNAQk0MRswGTALBglghkgBZQMEAgGhCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEICNPuucWpap0huG1HkZR1liLCfnUyPRFKc3BMuYYfb/1MAoGCCqGSM49BAMCBEcwRQIhAJSGdxshD9TsTvVniHsRx1Jez6j/5cv+1HFeJCjQxpXPAiBXBwBFqfvNpeUuEGHIJATVLN4kGQaxAunVG6aZ36e0CwAAAAAAAA==\",\"header\":{\"publicKeyHash\":\"xUyeFb75d359bfPEiq2JJMQj694UAxtTuBsaTWMOJxQ=\",\"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkeuICjZ7x15b7hPEBEBT5Zp43l95wCmJCU3QNxBvOCusG9w9sJMULuXlT4K8LOlPgaZzAcyWlfNwnLivVdOPfg==\",\"transactionId\":\"97e64d87f13a89ff6443cdcc205d5ccf7e15368b0d64126a8a2e0888a3a5c2a0\"},\"version\":\"EC_v1\"}" } } ``` ```java Java 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.core.enumerations.PayInExecutionType; import com.mangopay.core.enumerations.PayInPaymentType; import com.mangopay.entities.PayIn; import com.mangopay.entities.subentities.PayInPaymentDetailsApplePay; import com.mangopay.entities.subentities.PaymentData; public class CreateApplePayPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; var walletId = "wlt_m_01HTHTXEF4BJCTKMXNWMSZ6KP5"; PayIn applePayPayin = new PayIn(); applePayPayin.setAuthorId(userId); applePayPayin.setCreditedWalletId(walletId); applePayPayin.setDebitedFunds(new Money(CurrencyIso.EUR, 1000)); applePayPayin.setFees(new Money(CurrencyIso.EUR, 0)); applePayPayin.setPaymentType(PayInPaymentType.APPLEPAY); applePayPayin.setExecutionType(PayInExecutionType.DIRECT); applePayPayin.setTag("Created using the Mangopay Java SDK"); PaymentData paymentData = new PaymentData() .setTransactionId("061EB32181A2D9CA42AD16031B476EEBAA62A9A095AD660E2759FBA52B51A61") .setNetwork("VISA") .setTokenData("{\"version\":\"EC_v1\"," + "\"data\":\"w4HMBVqNC9ghPP4zncTA\\/0oQAsduERfsx78oxgniynNjZLANTL6+0koEtkQnW\\/K38Zew8qV1GLp+fLHo+qCBpiKCIwlz3eoFBTbZU+8pYcjaeIYBX9SOxcwxXsNGrGLk+kBUqnpiSIPaAG1E+WPT8R1kjOCnGvtdombvricwRTQkGjtovPfzZo8LzD3ZQJnHMsWJ8QYDLyr\\/ZN9gtLAtsBAMvwManwiaG3pOIWpyeOQOb01YcEVO16EZBjaY4x4C\\/oyFLWDuKGvhbJwZqWh1d1o9JT29QVmvy3Oq2JEjq3c3NutYut4rwDEP4owqI40Nb7mP2ebmdNgnYyWfPmkRfDCRHIWtbMC35IPg5313B1dgXZ2BmyZRXD5p+mr67vAk7iFfjEpu3GieFqwZrTl3\\/pI5V8Sxe3SIYKgT5Hr7ow==\"," + "\"signature\":\"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID5jCCA4ugAwIBAgIIaGD2mdnMpw8wCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE2MDYwMzE4MTY0MFoXDTIxMDYwMjE4MTY0MFowYjEoMCYGA1UEAwwfZWNjLXNtcC1icm9rZXItc2lnbl9VQzQtU0FOREJPWDEUMBIGA1UECwwLaU9TIFN5c3RlbXMxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgjD9q8Oc914gLFDZm0US5jfiqQHdbLPgsc1LUmeY+M9OvegaJajCHkwz3c6OKpbC9q+hkwNFxOh6RCbOlRsSlaOCAhEwggINMEUGCCsGAQUFBwEBBDkwNzA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZWFpY2EzMDIwHQYDVR0OBBYEFAIkMAua7u1GMZekplopnkJxghxFMAwGA1UdEwEB\\/wQCMAAwHwYDVR0jBBgwFoAUI\\/JJxE+T5O8n5sT2KGw\\/orv9LkswggEdBgNVHSAEggEUMIIBEDCCAQwGCSqGSIb3Y2QFATCB\\/jCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlYWljYTMuY3JsMA4GA1UdDwEB\\/wQEAwIHgDAPBgkqhkiG92NkBh0EAgUAMAoGCCqGSM49BAMCA0kAMEYCIQDaHGOui+X2T44R6GVpN7m2nEcr6T6sMjOhZ5NuSo1egwIhAL1a+\\/hp88DKJ0sv3eT3FxWcs71xmbLKD\\/QJ3mWagrJNMIIC7jCCAnWgAwIBAgIISW0vvzqY2pcwCgYIKoZIzj0EAwIwZzEbMBkGA1UEAwwSQXBwbGUgUm9vdCBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwHhcNMTQwNTA2MjM0NjMwWhcNMjkwNTA2MjM0NjMwWjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATwFxGEGddkhdUaXiWBB3bogKLv3nuuTeCN\\/EuT4TNW1WZbNa4i0Jd2DSJOe7oI\\/XYXzojLdrtmcL7I6CmE\\/1RFo4H3MIH0MEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcwAYYqaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZXJvb3RjYWczMB0GA1UdDgQWBBQj8knET5Pk7yfmxPYobD+iu\\/0uSzAPBgNVHRMBAf8EBTADAQH\\/MB8GA1UdIwQYMBaAFLuw3qFYM4iapIqZ3r6966\\/ayySrMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlcm9vdGNhZzMuY3JsMA4GA1UdDwEB\\/wQEAwIBBjAQBgoqhkiG92NkBgIOBAIFADAKBggqhkjOPQQDAgNnADBkAjA6z3KDURaZsYb7NcNWymK\\/9Bft2Q91TaKOvvGcgV5Ct4n4mPebWZ+Y1UENj53pwv4CMDIt1UQhsKMFd2xd8zg7kGf9F3wsIW2WT8ZyaYISb1T4en0bmcubCYkhYQaZDwmSHQAAMYIBizCCAYcCAQEwgYYwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTAghoYPaZ2cynDzANBglghkgBZQMEAgEFAKCBlTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xOTA1MjMxMTA1MDdaMCoGCSqGSIb3DQEJNDEdMBswDQYJYIZIAWUDBAIBBQChCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEIIvfGVQYBeOilcB7GNI8m8+FBVZ28QfA6BIXaggBja2PMAoGCCqGSM49BAMCBEYwRAIgU01yYfjlx9bvGeC5CU2RS5KBEG+15HH9tz\\/sg3qmQ14CID4F4ZJwAz+tXAUcAIzoMpYSnM8YBlnGJSTSp+LhspenAAAAAAAA\"," + "\"header\":" + "{\"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0rs3wRpirXjPbFDQfPRdfEzRIZDWm0qn7Y0HB0PNzV1DDKfpYrnhRb4GEhBF\\/oEXBOe452PxbCnN1qAlqcSUWw==\"," + "\"publicKeyHash\":\"saPRAqS7TZ4bAYwzBj8ezDDC55ZolyH1FL+Xc8fd93o=\"," + "\"transactionId\":\"b061eb32181a2d9ca42ad16031b476eebaa62a9a095ad660e2759fba52b51a61\"}}"); applePayPayin.setPaymentDetails(new PayInPaymentDetailsApplePay() .setPaymentData(paymentData) .setStatementDescriptor("MGP")); PayIn createApplePayPayin = mangopay.getPayInApi().create(applePayPayin); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createApplePayPayin); System.out.println(prettyJson); } } ``` ```python Python 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, ApplepayPayIn from mangopay.utils import Money, ApplepayPaymentData natural_user = NaturalUser.get('210513027') applepay_payin = ApplepayPayIn( author_id = natural_user.id, credited_wallet_id = '210514820', debited_funds = Money(amount=500, currency='EUR'), fees = Money(amount=50, currency='EUR'), payment_data = ApplepayPaymentData( transaction_id='97e64d87f13a89ff6443cdcc205d5ccf7e15368b0d64126a8a2e0888a3a5c2a0', network='MasterCard', token_data='{\"data\":\"your-token-data"}' ), tag = 'Created using Mangopay Python SDK' ) create_applepay_payin = applepay_payin.save() pprint(create_applepay_payin) ``` ```csharp .NET 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_01J2V0P9B1WCX46GEBDWCTXNQ0"; var walletId = "wlt_m_01J3D7EQ6V6P4TQ3JK6ZATTQRT"; var paymentData = new PaymentData { Network = "MasterCard", TransactionId = "97e64d87f13a89ff6443cdcc205d5ccf7e15368b0d64126a8a2e0888a3a5c2a0", TokenData = "{\"data\":\"2TihgKbmyPje02jYvkB6P+a6LCNmvKTFi4b7UN32sP4FJkllQP8CXIUPdv71xpIpBHetQ6TL7ON3Yex3L0Sc9hm15pME46/5fehwUxmgiumiK1eTupckAST6Zc0IYy2f9iJB9XpX+6dnKqTj7di12bo/iDXW4g2rbenNiDI0caiWebDaUG9DHSFjDxipQWx3Z8rf+zDiMGuDwO41LVh2SA1hRVbdINLpPpLtpxvyDeDkPQVohakcE+sK83QCHx0cEahAUKj6gAv6QuOLtWTsTtad04/ct3G0GnGeRp9p0fE0yJ+s4ybPj4WuV8lKNm6Lsg/WS9TqzT3RFgdjDjGdZ8W1CaEb/deG+Hh4MCebVJBP7iEdyfkB1afjJa0AqfbOBW2SIKXULtjP84QP\",\"signature\":\"MIAGCSqGSIb3DQEHAqCAMIACAQExDTALBglghkgBZQMEAgEwgAYJKoZIhvcNAQcBAACggDCCA+MwggOIoAMCAQICCEwwQUlRnVQ2MAoGCCqGSM49BAMCMHoxLjAsBgNVBAMMJUFwcGxlIEFwcGxpY2F0aW9uIEludGVncmF0aW9uIENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xOTA1MTgwMTMyNTdaFw0yNDA1MTYwMTMyNTdaMF8xJTAjBgNVBAMMHGVjYy1zbXAtYnJva2VyLXNpZ25fVUM0LVBST0QxFDASBgNVBAsMC2lPUyBTeXN0ZW1zMRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMIVd+3r1seyIY9o3XCQoSGNx7C9bywoPYRgldlK9KVBG4NCDtgR80B+gzMfHFTD9+syINa61dTv9JKJiT58DxOjggIRMIICDTAMBgNVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFCPyScRPk+TvJ+bE9ihsP6K7/S5LMEUGCCsGAQUFBwEBBDkwNzA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZWFpY2EzMDIwggEdBgNVHSAEggEUMIIBEDCCAQwGCSqGSIb3Y2QFATCB/jCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlYWljYTMuY3JsMB0GA1UdDgQWBBSUV9tv1XSBhomJdi9+V4UH55tYJDAOBgNVHQ8BAf8EBAMCB4AwDwYJKoZIhvdjZAYdBAIFADAKBggqhkjOPQQDAgNJADBGAiEAvglXH+ceHnNbVeWvrLTHL+tEXzAYUiLHJRACth69b1UCIQDRizUKXdbdbrF0YDWxHrLOh8+j5q9svYOAiQ3ILN2qYzCCAu4wggJ1oAMCAQICCEltL786mNqXMAoGCCqGSM49BAMCMGcxGzAZBgNVBAMMEkFwcGxlIFJvb3QgQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE0MDUwNjIzNDYzMFoXDTI5MDUwNjIzNDYzMFowejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8BcRhBnXZIXVGl4lgQd26ICi7957rk3gjfxLk+EzVtVmWzWuItCXdg0iTnu6CP12F86Iy3a7ZnC+yOgphP9URaOB9zCB9DBGBggrBgEFBQcBAQQ6MDgwNgYIKwYBBQUHMAGGKmh0dHA6Ly9vY3NwLmFwcGxlLmNvbS9vY3NwMDQtYXBwbGVyb290Y2FnMzAdBgNVHQ4EFgQUI/JJxE+T5O8n5sT2KGw/orv9LkswDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS7sN6hWDOImqSKmd6+veuv2sskqzA3BgNVHR8EMDAuMCygKqAohiZodHRwOi8vY3JsLmFwcGxlLmNvbS9hcHBsZXJvb3RjYWczLmNybDAOBgNVHQ8BAf8EBAMCAQYwEAYKKoZIhvdjZAYCDgQCBQAwCgYIKoZIzj0EAwIDZwAwZAIwOs9yg1EWmbGG+zXDVspiv/QX7dkPdU2ijr7xnIFeQreJ+Jj3m1mfmNVBDY+d6cL+AjAyLdVEIbCjBXdsXfM4O5Bn/Rd8LCFtlk/GcmmCEm9U+Hp9G5nLmwmJIWEGmQ8Jkh0AADGCAYgwggGEAgEBMIGGMHoxLjAsBgNVBAMMJUFwcGxlIEFwcGxpY2F0aW9uIEludGVncmF0aW9uIENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUwIITDBBSVGdVDYwCwYJYIZIAWUDBAIBoIGTMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTIzMTAwNDE0MjczMlowKAYJKoZIhvcNAQk0MRswGTALBglghkgBZQMEAgGhCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEICNPuucWpap0huG1HkZR1liLCfnUyPRFKc3BMuYYfb/1MAoGCCqGSM49BAMCBEcwRQIhAJSGdxshD9TsTvVniHsRx1Jez6j/5cv+1HFeJCjQxpXPAiBXBwBFqfvNpeUuEGHIJATVLN4kGQaxAunVG6aZ36e0CwAAAAAAAA==\",\"header\":{\"publicKeyHash\":\"xUyeFb75d359bfPEiq2JJMQj694UAxtTuBsaTWMOJxQ=\",\"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkeuICjZ7x15b7hPEBEBT5Zp43l95wCmJCU3QNxBvOCusG9w9sJMULuXlT4K8LOlPgaZzAcyWlfNwnLivVdOPfg==\",\"transactionId\":\"97e64d87f13a89ff6443cdcc205d5ccf7e15368b0d64126a8a2e0888a3a5c2a0\"},\"version\":\"EC_v1\"}" }; var applePayIn = new ApplePayDirectPayInPostDTO { PaymentType = PayInPaymentType.APPLEPAY, ExecutionType = PayInExecutionType.DIRECT, AuthorId = userId, CreditedUserId = userId, CreditedWalletId = walletId, DebitedFunds = new Money { Amount = 200, Currency = CurrencyIso.EUR }, Fees = new Money { Amount = 1, Currency = CurrencyIso.EUR }, PaymentData = paymentData, StatementDescriptor = "MGP", Tag = "Created using the Mangopay .NET SDK" }; var createApplePayPayIn = await api.PayIns.CreateApplePayAsync(applePayIn); string prettyPrint = JsonConvert.SerializeObject(createApplePayPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a PayIn (Apple Pay) GET /v2.01/{ClientId}/payins/{PayInId} ### Path parameters The unique identifier of the pay-in. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees. The values must match those requested from Apple Pay, because they are encrypted in the `PaymentData`. **Returned 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 funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `APPLEPAY` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. The mode applied for the 3DS2 protocol. On Apple Pay, this value is returned `null` as 3DS redirection is not applicable. For PayPal recurring registrations, this value is returned `null`. *Max. length: 255 characters* The URL to which users are automatically returned after 3DS2 if it is triggered. On Apple Pay, `null` is returned as 3DS redirection does not apply. *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. On Apple Pay, `null` is returned as 3DS redirection does not apply. Whether or not the `SecureMode` was used. The language in which the payment page is to be displayed. On Apple Pay, `null` is returned. Information regarding security and anti-fraud tools. The result of the Address Verification System check (only available for UK, US, and Canada). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. On Apple Pay, `null` is returned as 3DS redirection does not apply. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. On Apple Pay, `null` is returned as 3DS redirection does not apply. Information about the end user billing address. On Apple Pay, `null` is returned as 3DS redirection does not apply. Information about the end user’s shipping address. On Apple Pay, `null` is returned as 3DS redirection does not apply. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The unique identifier of the recurring pay-in registration. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 - Success { "Id": "payin_m_01J83BDHEBH7Z0ZSR7WZXEZ6RB", "Tag": "Created using the Mangopay API Postman collection", "CreationDate": 1726689494, "AuthorId": "user_m_01J84RCFJ0Q9RVQZ13618FSNWN", "CreditedUserId": "user_m_01J84RCFJ0Q9RVQZ13618FSNWN", "DebitedFunds": { "Currency": "EUR", "Amount": 1600 }, "CreditedFunds": { "Currency": "EUR", "Amount": 1600 }, "Fees": { "Currency": "EUR", "Amount": 0 }, "Status": "SUCCEEDED", "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1726689503, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01J84RDF46N1EQJ9ZA1560B1ZK", "DebitedWalletId": null, "PaymentType": "APPLEPAY", "ExecutionType": "DIRECT", "SecureMode": null, "CardId": null, "SecureModeReturnURL": null, "SecureModeRedirectURL": null, "SecureModeNeeded": false, "Culture": null, "SecurityInfo": { "AVSResult": "NO_CHECK" }, "StatementDescriptor": "Custom data", "BrowserInfo": null, "IpAddress": null, "Billing": null, "Shipping": null, "Requested3DSVersion": null, "Applied3DSVersion": null, "RecurringPayinRegistrationId": null, "PreferredCardNetwork": null, "PaymentCategory": null, "CardInfo": { "BIN": "516398", "IssuingBank": "BANCO SANTANDER S.A.", "IssuerCountryCode": "ES", "Type": "DEBIT", "Brand": "MASTERCARD", "SubType": "PLATINUM" } } ``` ```json REST // GET has no body parameters ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $PayInId = "payin_m_01J87NTMTED8HW42J9ZSQX6RST"; $response = $api->PayIns->Get($PayInId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "your-client-id", clientApiKey: "your-api-key" }) let myPayIn = { Id: "payin_m_01J87NTMTED8HW42J9ZSQX6RST" } const viewPayIn = async (payinId) => { return await mangopay.PayIns.get(payinId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewPayIn(myPayIn.Id) ``` ```ruby Ruby 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 viewPayIn(payinId) begin response = MangoPay::PayIn.fetch(payinId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch PayIn: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { Id: "payin_m_01J87DAKCB24ZT8TW122A7M5QP" } viewPayIn(myPayIn[:ApplePayId]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.PayIn; public class ViewPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); PayIn payin = mangopay.getPayInApi().get("payin_m_01J87NTMTED8HW42J9ZSQX6RST"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(payin); System.out.println(prettyJson); } } ``` ```python Python 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 PayIn payin_id = 'payin_m_01J87DAKCB24ZT8TW122A7M5QP' try: view_applepay_payin = PayIn.get(payin_id) pprint(vars(view_applepay_payin)) except PayIn.DoesNotExist: print('The ApplePay PayIn {} does not exist.'.format(payin_id)) ``` # The Bancontact PayIn object ### Description The Bancontact PayIn object allows platforms to process payments with Bancontact made by scanning a QR code, or by using a Bancontact-branded card (that is not saved). **Note – New integration in beta** This integration of Bancontact is in beta and therefore liable to change. The existing Bancontact integration using the **Web Card PayIn** (with `CardType` value `BCMC`) is still supported. A transition period will be implemented in the coming months to migrate flows, requiring no change on the part of platforms. The existing Bancontact integration using the **Direct Card PayIn** is unaffected and continues to be supported. ### Attributes The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 funds. 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`). Information about the fees. **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. **Returned values:** `BCMC` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Whether or not the pay-in forms part of a Bancontact recurring payment flow (not yet available). **Allowed values:** One of the supported languages in the ISO 639-1 format: DE, EN, FR, NL **Default value:** FR The language in which the Bancontact payment page is to be displayed. **Allowed values:** `WEB`, `APP` **Default value:** `WEB` The platform environment of the post-payment flow. The `PaymentFlow` value combines with the `ReturnURL` to manage the redirection behavior after payment: * Set the value to `APP` to send the user to your platform's mobile app * Set the value to `WEB` to send the user to a web browser In both cases you need to provide the relevant `ReturnURL`, whether to your app or website. The mobile URL to which to redirect the user to complete the payment in an app-to-app flow. **Note:** In Sandbox, this value is a placeholder: the `RedirectURL` must be used to complete the payment using Mangopay’s web-based simulator. ### Related resources Learn more about Bancontact Learn about testing Bancontact # Create a Bancontact PayIn POST /v2.01/{ClientId}/payins/payment-methods/bancontact **Note – Timeout after 1 hour** The Bancontact payment session lasts for 1 hour, at which point the pay-in fails automatically if no action has been taken by the user. ### Body parameters *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique identifier of the user at the source of the transaction. Information about the debited funds. **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 funds. 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`). Information about the fees. **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 fees. 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`). The unique identifier of the credited wallet. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Whether or not the pay-in forms part of a Bancontact recurring payment flow (not yet available). **Allowed values:** One of the supported languages in the ISO 639-1 format: DE, EN, FR, NL **Default value:** FR The language in which the Bancontact payment page is to be displayed. **Allowed values:** `WEB`, `APP` **Default value:** `WEB` The platform environment of the post-payment flow. The `PaymentFlow` value combines with the `ReturnURL` to manage the redirection behavior after payment: * Set the value to `APP` to send the user to your platform's mobile app * Set the value to `WEB` to send the user to a web browser In both cases you need to provide the relevant `ReturnURL`, whether to your app or website. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 funds. 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`). Information about the fees. **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. **Returned values:** `BCMC` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Whether or not the pay-in forms part of a Bancontact recurring payment flow (not yet available). **Allowed values:** One of the supported languages in the ISO 639-1 format: DE, EN, FR, NL **Default value:** FR The language in which the Bancontact payment page is to be displayed. **Allowed values:** `WEB`, `APP` **Default value:** `WEB` The platform environment of the post-payment flow. The `PaymentFlow` value combines with the `ReturnURL` to manage the redirection behavior after payment: * Set the value to `APP` to send the user to your platform's mobile app * Set the value to `WEB` to send the user to a web browser In both cases you need to provide the relevant `ReturnURL`, whether to your app or website. The mobile URL to which to redirect the user to complete the payment in an app-to-app flow. **Note:** In Sandbox, this value is a placeholder: the `RedirectURL` must be used to complete the payment using Mangopay’s web-based simulator. ```json 200 - Created { "Id": "wt_45b42782-5fb1-4083-9c77-43b573af7deb", "Tag": "Created using the Mangopay API Postman collection", "CreationDate": 1718721483, "AuthorId": "user_m_01HZSK5MX04KS9Q7SQSSRGQQ4Q", "DebitedFunds": { "Currency": "EUR", "Amount": 1627 }, "CreditedFunds": { "Currency": "EUR", "Amount": 1464 }, "Fees": { "Currency": "EUR", "Amount": 163 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1", "CreditedUserId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY", "PaymentType": "BCMC", "ExecutionType": "WEB", "ReturnURL": "https://www.mangopay.com/docs/please-ignore?transactionId=wt_45b42782-5fb1-4083-9c77-43b573af7deb", "RedirectURL": "https://r3.girogate.de/ti/simbcmc?tx=2222192564&rs=NXyX461Ol79WBMuNVLDUQFDQrkgKDOte&cs=05e30e859ba461b405ff6696796caf4df5b277178484337a85bfa098049467a6", "StatementDescriptor": "Example123", "Recurring": false, "Culture": "EN", "PaymentFlow": "APP", "DeepLinkURL": "BEP://1BC.GIROGATE.DE/BCMC/123456789$ICAE3BUIH5P9U53Y5HKA9CRT" } ``` ```json REST { "Tag": "Created using the Mangopay API Postman collection", "AuthorId": "user_m_01HZSK5MX04KS9Q7SQSSRGQQ4Q", "DebitedFunds": { "Currency": "EUR", "Amount": 1627 }, "Fees": { "Currency": "EUR", "Amount": 163 }, "CreditedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1", "ReturnURL": "https://www.mangopay.com/docs/please-ignore", "StatementDescriptor" : "Example123", "Recurring" : false, "Culture" : "EN", "PaymentFlow": "APP" } ``` # View a PayIn (Bancontact) GET /v2.01/{ClientId}/payins/{PayInId} **Note – Pay-in data retained for 13 months** An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the pay-in. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 funds. 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`). Information about the fees. **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. **Returned values:** `BCMC` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Whether or not the pay-in forms part of a Bancontact recurring payment flow (not yet available). **Allowed values:** One of the supported languages in the ISO 639-1 format: DE, EN, FR, NL **Default value:** FR The language in which the Bancontact payment page is to be displayed. **Allowed values:** `WEB`, `APP` **Default value:** `WEB` The platform environment of the post-payment flow. The `PaymentFlow` value combines with the `ReturnURL` to manage the redirection behavior after payment: * Set the value to `APP` to send the user to your platform's mobile app * Set the value to `WEB` to send the user to a web browser In both cases you need to provide the relevant `ReturnURL`, whether to your app or website. The mobile URL to which to redirect the user to complete the payment in an app-to-app flow. **Note:** In Sandbox, this value is a placeholder: the `RedirectURL` must be used to complete the payment using Mangopay’s web-based simulator. ```json 200 - Succeeded { "Id": "wt_45b42782-5fb1-4083-9c77-43b573af7deb", "Tag": "Created using the Mangopay API Postman collection", "CreationDate": 1718721483, "AuthorId": "user_m_01HZSK5MX04KS9Q7SQSSRGQQ4Q", "DebitedFunds": { "Currency": "EUR", "Amount": 1627 }, "CreditedFunds": { "Currency": "EUR", "Amount": 1464 }, "Fees": { "Currency": "EUR", "Amount": 163 }, "Status": "SUCCEEDED", "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1718721503, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1", "CreditedUserId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY", "PaymentType": "BCMC", "ExecutionType": "WEB", "ReturnURL": "https://www.mangopay.com/docs/please-ignore?transactionId=wt_45b42782-5fb1-4083-9c77-43b573af7deb", "RedirectURL": "https://r3.girogate.de/ti/dumbdummy?tx=2268171296&rs=7aOKg7NOrsDswV0grlEuH7pdA7cQjjte&cs=80902c0479c4400785a66cb5db61c1c1fd670fff450c28c34fbb206462ceade4", "StatementDescriptor": "Example123", "Recurring": false, "Culture": "EN", "PaymentFlow": "APP", "DeepLinkURL": "BEP://1BC.GIROGATE.DE/BCMC/123456789$ICAE3BUIH5P9U53Y5HKA9CRT" } ``` ```json REST // GET has no body parameters ``` # The Bank Account object ### Description The Bank Account object represents the actual bank account of the user and is therefore required to: * Process a bank wire payout * Set up a mandate to process a pay-in by direct debit with a mandate (BACS or SEPA network only) Different information is required for bank accounts in different countries. This is managed by the `Type` parameter, which determines the information that needs to be provided via the dedicated endpoint. The values are: * `IBAN` – For accounts registered in countries that use IBAN (including the UK when the payout currency is **not** GBP) * `US` – For accounts registered in the United States * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom **only when** the payout currency is GBP (for other payout currencies, use the `IBAN` type) * `OTHER` – For accounts registered in countries that do not use IBAN (and are not the US, Canada, or the UK) The country of registration of a bank account is not linked to its currency. **Caution – Creating the wrong type can lead to processing delays** Failure to use the correct type can lead to processing delays. Use the dedicated types for US, CA, and GB. Only use OTHER if the country isn’t one of these and doesn’t use IBAN. **Note – Bank Account creation blocked in restricted countries** Due to anti-money laundering policy, Mangopay doesn’t accept the creation of bank accounts registered in some countries (see the Country restrictions article). ### Attributes Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. *Digits only* The account number of the bank account. The format and length depends on the Bank Account `Type`. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. *Length: 9 characters* The American Banking Association (ABA) routing number for US-type bank accounts. **Returned values:** `CHECKING`, `SAVINGS` The deposit type for US-type bank accounts. *Length: 3 digits* The 3-digit number assigned to Canadian financial institutions, for CA-type bank accounts. *Length: 5 digits* The 5-digit number assigned to branches of Canadian financial institutions, for CA-type bank accounts. *Max. length: 50 characters (letters and digits only)* The name of the Canadian bank for CA-type bank accounts. The 6-digit sort code, assigned to UK financial institutions, for GB-type bank accounts. The country in which the bank account is domiciled. The unique identifier of the User (natural or legal) who owns the bank account. **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. # Create a CA Bank Account POST /v2.01/{ClientId}/users/{UserId}/bankaccounts/ca ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. ### Body parameters Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. The country of the address. *Digits only* The unique number of the bank account (between 7 to 35 digits). *Length: 3 digits* The 3-digit number assigned to Canadian financial institutions, for CA-type bank accounts. *Length: 5 digits* The 5-digit number assigned to branches of Canadian financial institutions, for CA-type bank accounts. *Max. length: 50 characters (letters and digits only)* The name of the Canadian bank for CA-type bank accounts. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Digits only* The unique number of the bank account (between 7 to 35 digits). *Length: 3 digits* The 3-digit number assigned to Canadian financial institutions, for CA-type bank accounts. *Length: 5 digits* The 5-digit number assigned to branches of Canadian financial institutions, for CA-type bank accounts. *Max. length: 50 characters (letters and digits only)* The name of the Canadian bank for CA-type bank accounts. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json { "Message":"One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type":"param_error", "Id":"4ee7cdf4-602a-4d6f-8859-4e7548022abf#1661865189", "Date":1661865190.0, "errors":{ "InstitutionNumber":"The InstitutionNumber field is required.", "BranchCode":"The BranchCode field is required.", "BankName":"The BankName field is required." } } ``` ```json 200 { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "AccountNumber":"11696419", "InstitutionNumber":"614", "BranchCode":"00152", "BankName":"The Bank", "UserId":"142036728", "OwnerName":"Joe Blogs", "Type":"CA", "Id":"150295080", "Tag":null, "CreationDate":1661865058, "Active":true } ``` ```json REST { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "AccountNumber":"11696419", "InstitutionNumber":"614", "BranchCode":"00152", "BankName":"The Bank", "OwnerName":"Joe Blogs", "Tag":"custom meta", } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $bankAccount = new \MangoPay\BankAccount(); $address = new \MangoPay\Address(); $address->AddressLine1 = 'Address line 1'; $address->AddressLine2 = 'Address line 2'; $address->City = 'Paris'; $address->Country = 'FR'; $address->PostalCode = '75000'; $address->Region = 'Region'; $details = new \MangoPay\BankAccountDetailsCA(); $details->AccountNumber = '11696419'; $details->InstitutionNumber = '614'; $details->BranchCode = '00152'; $details->BankName = 'Bank of Canada'; $bankAccount->OwnerAddress = $address; $bankAccount->OwnerName = 'Alex Smith'; $bankAccount->Tag = 'Created using Mangopay PHP SDK'; $bankAccount->Type = 'IBAN'; $bankAccount->Details = $details; $response = $api->Users->CreateBankAccount($userId, $bankAccount); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', Address: { AddressLine1: 'Edgewood Road', AddressLine2: null, City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR', }, FirstName: 'John', LastName: 'Doe', } let bankAccount = { Type: 'CA', OwnerName: user.FirstName + '' + user.LastName, OwnerAddress: user.Address, AccountNumber: '11696419', InstitutionNumber: '614', BranchCode: '00152', BankName: 'The Bank', Tag: 'Created using Mangopay NodeJS SDK', } const createBankAccount = async (userId, bankAccount) => { return await mangopay.Users.createBankAccount(userId, bankAccount) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createBankAccount(user.Id, bankAccount) ``` ```ruby Ruby 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 createCaBankAccount(userId, caBankAccountObject) begin response = MangoPay::BankAccount.create(userId, caBankAccountObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myCaBankAccount = { Type: 'CA', OwnerName: 'Alex Smith', OwnerAddress: { AddressLine1: 'Edgewood Road', AddressLine2: 'Address line 2', City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR' }, AccountNumber: '11696419', InstitutionNumber: '614', BranchCode: '00152', BankName: 'The Bank', Tag: 'Created using Mangopay Ruby SDK' } createCaBankAccount(myUser[:Id], myCaBankAccount) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Address; import com.mangopay.core.enumerations.BankAccountType; import com.mangopay.core.enumerations.CountryIso; import com.mangopay.entities.BankAccount; import com.mangopay.entities.subentities.BankAccountDetailsCA; public class CreateCABankAccount { 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_01J29D5XMKKNPX72AR5HRV804X"; BankAccountDetailsCA bankAccountDetails = new BankAccountDetailsCA(); bankAccountDetails.setAccountNumber("11696419"); bankAccountDetails.setBankName("The Bank"); bankAccountDetails.setBranchCode("00152"); bankAccountDetails.setInstitutionNumber("614"); Address address = new Address(); address.setAddressLine1("Rue des plantes"); address.setAddressLine2("The Oasis"); address.setCity("FR"); address.setRegion("Ile de France"); address.setPostalCode("75001"); address.setCountry(CountryIso.FR); BankAccount bankAccount = new BankAccount(); bankAccount.setOwnerName("John Doe"); bankAccount.setDetails(bankAccountDetails); bankAccount.setOwnerAddress(address); bankAccount.setType(BankAccountType.CA); bankAccount.setTag("Created using the Mangopay Java SDK"); BankAccount createBankAccount = mangopay.getUserApi().createBankAccount(userId, bankAccount); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createBankAccount); System.out.println(prettyJson); } } ``` ```python Python 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, BankAccount from mangopay.utils import Address natural_user = NaturalUser.get('213753890') ca_bank_account = BankAccount( user_id = natural_user.id, owner_name = f'{natural_user.first_name} {natural_user.last_name}', owner_address = Address( address_line_1 = natural_user.address.address_line_1, address_line_2 = natural_user.address.address_line_2, city = natural_user.address.city, region = natural_user.address.region, postal_code = natural_user.address.postal_code, country = natural_user.address.country, ), account_number = '11696419', institution_number = '614', branch_code = '00152', bank_name = 'The Bank', type = 'CA', tag = 'Created using the Mangopay Python SDK', ) create_ca_bank_account = ca_bank_account.save() pprint(create_ca_bank_account) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.GET; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; 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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"); var accountNumber = "11696419"; var institutionNumber = "614"; var branchCode = "00152"; var bankName = "The Bank"; var CaBankAccount = new BankAccountCaPostDTO( user.FirstName + " " + user.LastName, user.Address, bankName, institutionNumber, branchCode, accountNumber ) { Tag = "Created using the Mangopay .NET SDK" }; BankAccountDTO createCaBankAccount = await api.Users.CreateBankAccountCaAsync(user.Id, CaBankAccount); string prettyPrint = JsonConvert.SerializeObject(createCaBankAccount, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a GB Bank Account POST /v2.01/{ClientId}/users/{UserId}/bankaccounts/gb ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. ### Body parameters Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. The country of the address. *Length: 8 digits* The unique set of digits of the bank account. The 6-digit sort code, assigned to UK financial institutions, for GB-type bank accounts. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Length: 8 digits* The unique set of digits of the bank account. The 6-digit sort code, assigned to UK financial institutions, for GB-type bank accounts. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json { "Message":"One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type":"param_error", "Id":"9d4feea4-353f-416d-b8d6-8053471785ea#1677146902", "Date":1677146903, "errors":{ "GB":"The GB account is blocked by Fraud Policy" } } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "6977ee65-e865-4fdb-8a4b-835f47fff41f", "Date": 1698756883.0, "errors": { "AccountNumber": "The field AccountNumber must match the regular expression '\\d{8}'." } } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "9b1dd701-a274-4be8-aabf-872a1557c9e9", "Date": 1698756987.0, "errors": { "SortCode": "The field SortCode must match the regular expression '\\d{6}'." } } ``` ```json { "Message": "One or several required parameters are missing or incorrect", "Type": "bankaccount_error", "Id": "c2cea07c-4403-4f5d-b80e-806c1cc60112", "Date": 1698757035.0, "errors": { "SortCode": "SortCode is invalid" } } ``` ```json { "Message": "One or several required parameters are missing or incorrect", "Type": "bankaccount_error", "Id": "55ed90cb-cbc5-438b-ba5d-3207ef27d341", "Date": 1698757180.0, "errors": { "AccountNumber": "AccountNumber is invalid or is not applicable for this SortCode" } } ``` ```json 200 { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des Plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "AccountNumber":"11696419", "SortCode":"010039", "UserId":"142036728", "OwnerName":"Joe Blogs", "Type":"GB", "Id":"150297947", "Tag":null, "CreationDate":1661866223, "Active":true } ``` ```json REST { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des Plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "AccountNumber":"11696419", "SortCode":"010039", "OwnerName":"Joe Blogs", "Tag":"Created using the Mangopay API Collection Postman" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $bankAccount = new \MangoPay\BankAccount(); $address = new \MangoPay\Address(); $address->AddressLine1 = 'Address line 1'; $address->AddressLine2 = 'Address line 2'; $address->City = 'Paris'; $address->Country = 'FR'; $address->PostalCode = '75000'; $address->Region = 'Region'; $details = new \MangoPay\BankAccountDetailsGB(); $details->AccountNumber = '11696419'; $details->SortCode = '010039'; $bankAccount->OwnerAddress = $address; $bankAccount->OwnerName = 'Alex Smith'; $bankAccount->Tag = 'Created using Mangopay PHP SDK'; $bankAccount->Type = 'IBAN'; $bankAccount->Details = $details; $response = $api->Users->CreateBankAccount($userId, $bankAccount); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', Address: { AddressLine1: 'Edgewood Road', AddressLine2: null, City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR', }, FirstName: 'John', LastName: 'Doe', } let bankAccount = { Type: 'GB', OwnerName: user.FirstName + '' + user.LastName, OwnerAddress: user.Address, AccountNumber: '11696419', SortCode: '010039', Tag: 'Created using Mangopay NodeJS SDK', } const createBankAccount = async (userId, bankAccount) => { return await mangopay.Users.createBankAccount(userId, bankAccount) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createBankAccount(user.Id, bankAccount) ``` ```ruby Ruby 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 createGbBankAccount(userId, gbBankAccountObject) begin response = MangoPay::BankAccount.create(userId, gbBankAccountObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myGbBankAccount = { Type: 'GB', OwnerName: 'Alex Smith', OwnerAddress: { AddressLine1: 'Edgewood Road', AddressLine2: 'Address line 2', City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR' }, AccountNumber: '11696419', SortCode: '010039', Tag: 'Created using Mangopay Ruby SDK' } createGbBankAccount(myUser[:Id], myGbBankAccount) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.enumerations.BankAccountType; import com.mangopay.entities.BankAccount; import com.mangopay.entities.UserNatural; import com.mangopay.entities.subentities.BankAccountDetailsGB; public class createGBbankaccount { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); UserNatural user = mangopay.getUserApi().getNatural("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"); BankAccount account = new BankAccount(); account.setType(BankAccountType.GB); account.setOwnerName(user.getFirstName() + " " + user.getLastName()); account.setOwnerAddress(user.getAddress()); account.setType(BankAccountType.GB); BankAccountDetailsGB details = new BankAccountDetailsGB(); details.setAccountNumber("63956474"); details.setSortCode("200000"); account.setDetails(details); account.setTag("Created using the Mangopay Java SDK"); BankAccount createAccount = mangopay.getUserApi().createBankAccount(user.getId(), account); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createAccount); System.out.println(prettyJson); } } ``` ```python Python 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, BankAccount from mangopay.utils import Address natural_user = NaturalUser.get('213753890') gb_bank_account = BankAccount( user_id = natural_user.id, owner_name = f'{natural_user.first_name} {natural_user.last_name}', owner_address = Address( address_line_1 = natural_user.address.address_line_1, address_line_2 = natural_user.address.address_line_2, city = natural_user.address.city, region = natural_user.address.region, postal_code = natural_user.address.postal_code, country = natural_user.address.country, ), account_number = '11696419', sort_code = '010039', type = 'GB', tag = 'Created using the Mangopay Python SDK', ) create_gb_bank_account = gb_bank_account.save() pprint(create_gb_bank_account) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.GET; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; 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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"); var accountNumber = "11696419"; var GbBankAccount = new BankAccountGbPostDTO( user.FirstName + " " + user.LastName, user.Address, accountNumber ) { SortCode = "010039", Tag = "Created using the Mangopay .NET SDK" }; BankAccountDTO createGbBankAccount = await api.Users.CreateBankAccountGbAsync(user.Id, GbBankAccount); string prettyPrint = JsonConvert.SerializeObject(createGbBankAccount, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create an IBAN Bank Account POST /v2.01/{ClientId}/users/{UserId}/bankaccounts/iban **Caution – Only for countries that use IBAN** Only use the IBAN type for accounts registered in countries that use IBAN and aren’t GB, US, or CA (for which you should use the dedicated type).  ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. ### Body parameters Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. The country of the address. *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The unique identifier of the user. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "c35b1e0b-1a21-42e4-a80f-440ad9de3c57#1662449222", "Date": 1662449223.0, "errors": { "BIC": "The field BIC must match the regular expression '^[a-zA-Z]{6}\\w{2}(\\w{3})?$'." } } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "692b34b2-86a5-4859-a515-f8838292a56e#1662449297", "Date": 1662449298.0, "errors": { "IBAN": "The value is not a valid IBAN" } } ``` ```json 200 { "OwnerAddress":{ "AddressLine1":"Rue des plantes", "AddressLine2":"The Oasis", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "IBAN":"FR7630004000031234567890143", "BIC":"BNPAFRPP", "UserId":"142036728", "OwnerName":"John Doe", "Type":"IBAN", "Id":"150287803", "Tag":"custom meta", "CreationDate":1661859994, "Active":true } ``` ```json REST { "OwnerAddress": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "Paris", "Region": "Ile de France", "PostalCode": "75001", "Country": "FR" }, "IBAN": "FR7630004000031234567890143", "BIC": "BNPAFRPP", "OwnerName": "John Doe", "Tag": "Created using the Mangopay API Postman collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $bankAccount = new \MangoPay\BankAccount(); $address = new \MangoPay\Address(); $address->AddressLine1 = 'Address line 1'; $address->AddressLine2 = 'Address line 2'; $address->City = 'Paris'; $address->Country = 'FR'; $address->PostalCode = '75000'; $address->Region = 'Region'; $details = new \MangoPay\BankAccountDetailsIBAN(); $details->IBAN = 'FR7630004000031234567890143'; $details->BIC = 'BNPAFRPP'; $bankAccount->OwnerAddress = $address; $bankAccount->OwnerName = 'Alex Smith'; $bankAccount->Tag = 'Created using Mangopay PHP SDK'; $bankAccount->Type = 'IBAN'; $bankAccount->Details = $details; $response = $api->Users->CreateBankAccount($userId, $bankAccount); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', Address: { AddressLine1: 'Edgewood Road', AddressLine2: null, City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR', }, FirstName: 'John', LastName: 'Doe', } let bankAccount = { Type: 'IBAN', OwnerName: user.FirstName + '' + user.LastName, OwnerAddress: user.Address, IBAN: 'FR7630004000031234567890143', BIC: 'BNPAFRPP', Tag: 'Created using Mangopay NodeJS SDK', } const createBankAccount = async (userId, bankAccount) => { return await mangopay.Users.createBankAccount(userId, bankAccount) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createBankAccount(user.Id, bankAccount) ``` ```ruby Ruby 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 createIbanBankAccount(userId, ibanBankAccountObject) begin response = MangoPay::BankAccount.create(userId, ibanBankAccountObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myIbanBankAccount = { Type: 'IBAN', OwnerName: 'Alex Smith', OwnerAddress: { AddressLine1: 'Edgewood Road', AddressLine2: 'Address line 2', City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR' }, IBAN: 'FR7630004000031234567890143', BIC: 'BNPAFRPP', Tag: 'Created using Mangopay Ruby SDK' } createIbanBankAccount(myUser[:Id], myIbanBankAccount) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.enumerations.BankAccountType; import com.mangopay.entities.BankAccount; import com.mangopay.entities.UserNatural; import com.mangopay.entities.subentities.BankAccountDetailsIBAN; public class createIBANankaccount { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); UserNatural user = mangopay.getUserApi().getNatural("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"); BankAccount account = new BankAccount(); account.setType(BankAccountType.IBAN); account.setOwnerName(user.getFirstName() + " " + user.getLastName()); account.setOwnerAddress(user.getAddress()); account.setUserId(user.getId()); BankAccountDetailsIBAN bankAccountDetails = new BankAccountDetailsIBAN(); bankAccountDetails.setIban("FR7630004000031234567890143"); bankAccountDetails.setBic("BNPAFRPP"); account.setDetails(bankAccountDetails); account.setTag("Created using the Mangopay Java SDK"); BankAccount createAccount = mangopay.getUserApi().createBankAccount(user.getId(), account); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createAccount); System.out.println(prettyJson); } } ``` ```python Python 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, BankAccount from mangopay.utils import Address natural_user = NaturalUser.get('213753890') iban_bank_account = BankAccount( user_id = natural_user.id, owner_name = f'{natural_user.first_name} {natural_user.last_name}', owner_address = Address( address_line_1 = natural_user.address.address_line_1, address_line_2 = natural_user.address.address_line_2, city = natural_user.address.city, region = natural_user.address.region, postal_code = natural_user.address.postal_code, country = natural_user.address.country, ), iban = 'FR7630004000031234567890143', bic = 'BNPAFRPP', type = 'IBAN', tag = 'Created using the Mangopay Python SDK' ) create_iban_bank_account = iban_bank_account.save() pprint(create_iban_bank_account) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.GET; 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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"); var iban = "FR7630004000031234567890143"; var IbanBankAccount = new BankAccountIbanPostDTO( user.FirstName + " " + user.LastName, user.Address, iban ) { BIC = "BNPAFRPP", Tag = "Created using the Mangopay .NET SDK" }; BankAccountDTO createIbanBankAccount = await api.Users.CreateBankAccountIbanAsync(user.Id, IbanBankAccount); string prettyPrint = JsonConvert.SerializeObject(createIbanBankAccount, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create an OTHER Bank Account POST /v2.01/{ClientId}/users/{UserId}/bankaccounts/other **Caution – Only for countries that don’t use IBAN** Only use the OTHER type if the account is registered in a country that doesn’t use IBAN and isn’t GB, US, or CA (for which you should use the dedicated type). **Note – Additional information may be required** OTHER-type bank accounts may require additional information depending on the country. Additional precisions per country (if applicable), are given below. For accounts registered in:  * Australia, provide the Bank State Branch (BSB) number (6 digits) in the `BIC` parameter. ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. ### Body parameters Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. The country of the address. *Max. length 35, min. length 5; alphanumeric characters only.* The unique number of the bank account. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank The country in which the bank account is domiciled. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Max. length 35, min. length 5; alphanumeric characters only.* The unique number of the bank account. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country in which the bank account is domiciled. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json 200 { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "AccountNumber":"11696419", "BIC":"BNPAFRPP", "Country":"FR", "UserId":"142036728", "OwnerName":"Joe Blogs", "Type":"OTHER", "Id":"150298347", "Tag":null, "CreationDate":1661866304, "Active":true } ``` ```json REST { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" }, "AccountNumber":"11696419", "BIC":"BNPAFRPP", "Country":"FR", "OwnerName":"Joe Blogs", "Tag":"custom meta", } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $bankAccount = new \MangoPay\BankAccount(); $address = new \MangoPay\Address(); $address->AddressLine1 = 'Address line 1'; $address->AddressLine2 = 'Address line 2'; $address->City = 'Paris'; $address->Country = 'FR'; $address->PostalCode = '75000'; $address->Region = 'Region'; $details = new \MangoPay\BankAccountDetailsOTHER(); $details->AccountNumber = '11696419'; $details->BIC = 'BNPAFRPP'; $details->Country = 'FR'; $bankAccount->OwnerAddress = $address; $bankAccount->OwnerName = 'Alex Smith'; $bankAccount->Tag = 'Created using Mangopay PHP SDK'; $bankAccount->Type = 'IBAN'; $bankAccount->Details = $details; $response = $api->Users->CreateBankAccount($userId, $bankAccount); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', Address: { AddressLine1: 'Edgewood Road', AddressLine2: null, City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR', }, FirstName: 'John', LastName: 'Doe', } let bankAccount = { Type: 'OTHER', OwnerName: user.FirstName + '' + user.LastName, OwnerAddress: user.Address, AccountNumber: '11696419', BIC: 'BNPAFRPP', Country: 'FR', Tag: 'Created using Mangopay NodeJS SDK', } const createBankAccount = async (userId, bankAccount) => { return await mangopay.Users.createBankAccount(userId, bankAccount) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createBankAccount(user.Id, bankAccount) ``` ```ruby Ruby 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 createOtherBankAccount(userId, otherBankAccountObject) begin response = MangoPay::BankAccount.create(userId, otherBankAccountObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myOtherBankAccount = { Type: 'OTHER', OwnerName: 'Alex Smith', OwnerAddress: { AddressLine1: 'Edgewood Road', AddressLine2: 'Address line 2', City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR' }, AccountNumber: '11696419', BIC: 'BNPAFRPP', Country: 'FR', Tag: 'Created using Mangopay Ruby SDK' } createOtherBankAccount(myUser[:Id], myOtherBankAccount) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Address; import com.mangopay.core.enumerations.BankAccountType; import com.mangopay.core.enumerations.CountryIso; import com.mangopay.entities.BankAccount; import com.mangopay.entities.subentities.BankAccountDetailsOTHER; public class CreateOtherBankAccount { 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_01J29D5XMKKNPX72AR5HRV804X"; BankAccountDetailsOTHER bankAccountDetails = new BankAccountDetailsOTHER(); bankAccountDetails.setAccountNumber("11696419"); bankAccountDetails.setBic("BNPAFRPP"); bankAccountDetails.setCountry(CountryIso.FR); Address address = new Address(); address.setAddressLine1("Rue des plantes"); address.setAddressLine2("The Oasis"); address.setCity("FR"); address.setRegion("Ile de France"); address.setPostalCode("75001"); address.setCountry(CountryIso.FR); BankAccount bankAccount = new BankAccount(); bankAccount.setOwnerName("John Doe"); bankAccount.setDetails(bankAccountDetails); bankAccount.setOwnerAddress(address); bankAccount.setType(BankAccountType.OTHER); bankAccount.setTag("Created using the Mangopay Java SDK"); BankAccount createBankAccount = mangopay.getUserApi().createBankAccount(userId, bankAccount); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createBankAccount); System.out.println(prettyJson); } } ``` ```python Python 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, BankAccount from mangopay.utils import Address natural_user = NaturalUser.get('213753890') other_bank_account = BankAccount( user_id = natural_user.id, owner_name = f'{natural_user.first_name} {natural_user.last_name}', owner_address = Address( address_line_1 = natural_user.address.address_line_1, address_line_2 = natural_user.address.address_line_2, city = natural_user.address.city, region = natural_user.address.region, postal_code = natural_user.address.postal_code, country = natural_user.address.country, ), account_number = '11696419', bic = 'BNPAFRPP', country = 'FR', type = 'OTHER', tag = 'Created using the Mangopay Python SDK' ) create_other_bank_account = other_bank_account.save() pprint(create_other_bank_account) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.GET; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; 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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"); var accountNumber = "11696419"; var bic = "BNPAFRPP"; var OtherBankAccount = new BankAccountOtherPostDTO( user.FirstName + " " + user.LastName, user.Address, accountNumber, bic ) { Country = CountryIso.FR, Tag = "Created using the Mangopay .NET SDK" }; BankAccountDTO createOtherBankAccount = await api.Users.CreateBankAccountOtherAsync(user.Id, OtherBankAccount); string prettyPrint = JsonConvert.SerializeObject(createOtherBankAccount, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a US Bank Account POST /v2.01/{ClientId}/users/{UserId}/bankaccounts/us ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. ### Body parameters Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. The country of the address. *Digits only* The unique set of digits of the bank account. *Length: 9 characters* The American Banking Association (ABA) routing number for US-type bank accounts. **Allowed values:** `CHECKING`, `SAVINGS` The deposit type for US-type bank accounts. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Digits only* The unique set of digits of the bank account. *Length: 9 characters* The American Banking Association (ABA) routing number for US-type bank accounts. **Returned values:** `CHECKING`, `SAVINGS` The deposit type for US-type bank accounts. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json 200 { "OwnerAddress": { "AddressLine1": "The Oasis", "AddressLine2": "Rue des plantes", "City": "Paris", "Region": "Ile de France", "PostalCode": "75009", "Country": "FR" }, "AccountNumber": "11696419", "ABA": "071000288", "DepositAccountType": "CHECKING", "UserId": "142036728", "OwnerName": "John Doe", "Type": "US", "Id": "150294885", "Tag": null, "CreationDate": 1661864955, "Active": true } ``` ```json REST { "OwnerAddress": { "AddressLine1": "The Oasis", "AddressLine2": "Rue des plantes", "City": "Paris", "Region": "Ile de France", "PostalCode": "75009", "Country": "FR" }, "AccountNumber": "11696419", "ABA": "071000288", "DepositAccountType": "CHECKING", "OwnerName": "John Doe", "Tag": "custom meta", } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $bankAccount = new \MangoPay\BankAccount(); $address = new \MangoPay\Address(); $address->AddressLine1 = 'Address line 1'; $address->AddressLine2 = 'Address line 2'; $address->City = 'Paris'; $address->Country = 'FR'; $address->PostalCode = '75000'; $address->Region = 'Region'; $details = new \MangoPay\BankAccountDetailsUS(); $details->AccountNumber = '11696419'; $details->ABA = '071000288'; $details->DepositAcountType = 'CHECKING'; $bankAccount->OwnerAddress = $address; $bankAccount->OwnerName = 'Alex Smith'; $bankAccount->Tag = 'Created using Mangopay PHP SDK'; $bankAccount->Type = 'IBAN'; $bankAccount->Details = $details; $response = $api->Users->CreateBankAccount($userId, $bankAccount); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', Address: { AddressLine1: 'Edgewood Road', AddressLine2: null, City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR', }, FirstName: 'John', LastName: 'Doe', } let bankAccount = { Type: 'US', OwnerName: user.FirstName + '' + user.LastName, OwnerAddress: user.Address, AccountNumber: '11696419', ABA: '071000288', DepositAccountType: 'CHECKING', Tag: 'Created using Mangopay NodeJS SDK', } const createBankAccount = async (userId, bankAccount) => { return await mangopay.Users.createBankAccount(userId, bankAccount) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createBankAccount(user.Id, bankAccount) ``` ```ruby Ruby 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 createUsBankAccount(userId, usBankAccountObject) begin response = MangoPay::BankAccount.create(userId, usBankAccountObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myUsBankAccount = { Type: 'US', OwnerName: 'Alex Smith', OwnerAddress: { AddressLine1: 'Edgewood Road', AddressLine2: 'Address line 2', City: 'Little Rock', Region: 'IDF', PostalCode: '75000', Country: 'FR' }, AccountNumber: '11696419', ABA: '071000288', DepositAccountType: 'CHECKING', Tag: 'Created using Mangopay Ruby SDK' } createUsBankAccount(myUser[:Id], myUsBankAccount) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Address; import com.mangopay.core.enumerations.BankAccountType; import com.mangopay.core.enumerations.CountryIso; import com.mangopay.core.enumerations.DepositAccountType; import com.mangopay.entities.BankAccount; import com.mangopay.entities.subentities.BankAccountDetailsUS; public class CreateUSBankAccount { 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_01J29D5XMKKNPX72AR5HRV804X"; BankAccountDetailsUS bankAccountDetails = new BankAccountDetailsUS(); bankAccountDetails.setAba("071000288"); bankAccountDetails.setAccountNumber("11696419"); bankAccountDetails.setDepositAccountType(DepositAccountType.CHECKING); Address address = new Address(); address.setAddressLine1("Rue des plantes"); address.setAddressLine2("The Oasis"); address.setCity("FR"); address.setRegion("Ile de France"); address.setPostalCode("75001"); address.setCountry(CountryIso.FR); BankAccount bankAccount = new BankAccount(); bankAccount.setOwnerName("John Doe"); bankAccount.setDetails(bankAccountDetails); bankAccount.setOwnerAddress(address); bankAccount.setType(BankAccountType.US); bankAccount.setTag("Created using the Mangopay Java SDK"); BankAccount createBankAccount = mangopay.getUserApi().createBankAccount(userId, bankAccount); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createBankAccount); System.out.println(prettyJson); } } ``` ```python Python 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, BankAccount from mangopay.utils import Address natural_user = NaturalUser.get('213753890') us_bank_account = BankAccount( user_id = natural_user.id, owner_name = f'{natural_user.first_name} {natural_user.last_name}', owner_address = Address( address_line_1 = natural_user.address.address_line_1, address_line_2 = natural_user.address.address_line_2, city = natural_user.address.city, region = natural_user.address.region, postal_code = natural_user.address.postal_code, country = natural_user.address.country, ), account_number = '11696419', aba = '071000288', type = 'US', deposit_account_type = 'CHECKING', tag = 'Created using the Mangopay Python SDK', ) create_us_bank_account = us_bank_account.save() pprint(create_us_bank_account) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.GET; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; 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 user = await api.Users.GetNaturalAsync("user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"); var accountNumber = "11696419"; var aba = "071000288"; var UsBankAccount = new BankAccountUsPostDTO( user.FirstName + " " + user.LastName, user.Address, accountNumber, aba ) { DepositAccountType = DepositAccountType.CHECKING, Tag = "Created using the Mangopay .NET SDK" }; BankAccountDTO createUsBankAccount = await api.Users.CreateBankAccountUsAsync(user.Id, UsBankAccount); string prettyPrint = JsonConvert.SerializeObject(createUsBankAccount, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Deactivate a Bank Account PUT /v2.01/{ClientId}/users/{UserId}/bankaccounts/{BankAccountId} ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. The unique identifier of the bank account. ### Body parameters Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json 200 - IBAN-type Bank Account example { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75010", "Country":"FR" }, "IBAN":"FR7630004000031234567890143", "BIC":"CRLYFRPP", "UserId":"142036728", "OwnerName":"John Doe", "Type":"IBAN", "Id":"142036878", "Tag":"Custom meta", "CreationDate":1654073079, "Active":false } ``` ```json REST { "Active":false } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', } let bankAccount = { Id: '172327870', } const deactivateBankAccount = async (userId, bankAccountId) => { return await mangopay.Users.deactivateBankAccount(userId, bankAccountId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } deactivateBankAccount(user.Id, bankAccount.Id) ``` ```ruby Ruby 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 deactivateBankAccount(userId, bankAccountId, params) begin response = MangoPay::BankAccount.update(userId, bankAccountId, params) puts response return response rescue MangoPay::ResponseError => error puts "Failed to deactivate bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myBankAccount = { Id: '194239783', } myParams = { Active: false, } deactivateBankAccount(myUser[:Id], myBankAccount[:Id], myParams) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.BankAccount; public class DeactivateBankAccount { 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_01J29D5XMKKNPX72AR5HRV804X"; var bankAccountId = "bankacc_m_01J29HTDKMX1P4Z8251CEV81K7"; BankAccount bankAccount = mangopay.getUserApi().getBankAccount(userId, bankAccountId); bankAccount.setActive(false); BankAccount deactivateBankAccount = mangopay.getUserApi().updateBankAccount(userId, bankAccount, bankAccountId); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(deactivateBankAccount); System.out.println(prettyJson); } } ``` ```python Python 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, BankAccount natural_user = NaturalUser.get('213753890') bank_account = BankAccount( user_id = natural_user.id, id = '214328750', active = False ) deactivate_bank_account = bank_account.save() pprint(deactivate_bank_account) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var bankAccountId = "bankacc_m_01J536KTRQFK9GBMNBNJXRCCRM"; var bankAccount = new DisactivateBankAccountPutDTO { Active = false }; var deactivateCard = await api.Users.UpdateBankAccountAsync(userId, bankAccount, bankAccountId); string prettyPrint = JsonConvert.SerializeObject(deactivateCard, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # List Bank Accounts for a User GET /v2.01/{ClientId}/users/{UserId}/bankaccounts **Note** The returned parameters may vary depending on the encountered bank account types. ### Query parameters *Start value: 1* **Default value:** 1 Indicates the index of the page for the pagination. *Max. value: 100* **Default value:** 10 Indicates the number of items returned for each page of the pagination. **Allowed values:** `CreationDate:ASC`, `CreationDate:DESC` Indicates the direction in which to sort the list. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ### Path parameters The unique identifier of the User (natural or legal) who owns the bank account. ### Responses The list of Bank Accounts objects created by the platform. Returned parameters can vary depending on the bank account `Type`. The Bank Account object created by the platform. Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. *Max. length: 255 characters* Custom data that you can add to this object. The IBAN (international bank account number) for the bank account. *Digits only* The unique set of digits of the bank account. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. *Length: 9 characters* The American Banking Association (ABA) routing number for US-type bank accounts. **Returned values:** `CHECKING`, `SAVINGS` The deposit type for US-type bank accounts. *Length: 3 digits* The 3-digit number assigned to Canadian financial institutions, for CA-type bank accounts. *Length: 5 digits* The 5-digit number assigned to branches of Canadian financial institutions, for CA-type bank accounts. *Max. length: 50 characters (letters and digits only)* The name of the Canadian bank for CA-type bank accounts. The 6-digit sort code, assigned to UK financial institutions, for GB-type bank accounts. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country in which the bank account is domiciled. The unique identifier of the User (natural or legal) who owns the bank account. **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json 200 [ { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de Frog", "PostalCode":"75010", "Country":"FR" }, "IBAN":"FR7630004000031234567890143", "BIC":"CRLYFRPP", "UserId":"142036728", "OwnerName":"John Doe", "Type":"IBAN", "Id":"142036878", "Tag":"Postman create a bank account", "CreationDate":1654073079, "Active":true }, { "OwnerAddress":{ "AddressLine1":"77 Street", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75009", "Country":"FR" }, "AccountNumber":"11696419", "ABA":"071000288", "DepositAccountType":"CHECKING", "UserId":"142036728", "OwnerName":"John Doe", "Type":"US", "Id":"150294885", "Tag":null, "CreationDate":1661864955, "Active":true } ] ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $response = $api->Users->GetBankAccounts($userId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r$e); } } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', } const listUserBankAccounts = async (userId) => { return await mangopay.Users.getBankAccounts(userId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listUserBankAccounts(user.Id) ``` ```ruby Ruby 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 listBankAccounts(userId) begin response = MangoPay::BankAccount.fetch(userId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } listBankAccounts(myUser[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.BankAccount; import java.util.List; public class ListUserBankAccounts { 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_01J29D5XMKKNPX72AR5HRV804X"; List bankAccounts = mangopay.getUserApi().getBankAccounts(userId, null, null); for (BankAccount bankAccount : bankAccounts) { Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(bankAccount); System.out.println(prettyJson); } } } ``` ```python Python 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 natural_user = NaturalUser.get('213753890') bank_accounts = natural_user.bankaccounts.all() for bank_account in bank_accounts: pprint(vars(bank_account)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities; 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 bankAccounts = await api.Users.GetBankAccountsAsync(userId, new Pagination(1, 100), null); string prettyPrint = JsonConvert.SerializeObject(bankAccounts, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a Bank Account GET /v2.01/{ClientId}/users/{UserId}/bankaccounts/{BankAccountId} ### Path parameters The unique identifier of the bank account. ### Responses Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Length: 8 digits* The unique set of digits of the bank account. The 6-digit sort code, assigned to UK financial institutions, for GB-type bank accounts. The unique identifier of the User (natural or legal) who owns the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account, indicating the country where the real-life account is registered\ The values are: * `IBAN` – For accounts registered in countries that use IBAN  * `US` – For accounts registered in the United States  * `CA` – For accounts registered in Canada * `GB` – For accounts registered in the United Kingdom * `OTHER` – For accounts registered in countries that do not use IBAN (and are not US, CA, GB) The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For bank accounts, you can use this parameter to identify the bank account by currency or usage (personal or professional for instance). The date and time at which the object was created. Whether or not the Bank Account is active. Mangopay automatically sets this parameter to `false` if the bank account is closed or does not exist anymore. ```json 200 - IBAN-type { "OwnerAddress":{ "AddressLine1":"The Oasis", "AddressLine2":"Rue des plantes", "City":"Paris", "Region":"Ile de France", "PostalCode":"75010", "Country":"FR" }, "IBAN":"FR7630004000031234567890143", "BIC":"CRLYFRPP", "UserId":"user_m_01J18HZSACR1EMYNY1TBS8KTJD", "OwnerName":"Alex Smith", "Type":"IBAN", "Id":"bankacc_m_01J6A30MFXK50P8C8PCB73PM1B", "Tag":"Created using Mangopay API Postman Collection", "CreationDate":1654073079, "Active":true } ``` ```json 200 - GB-type { "OwnerAddress": { "AddressLine1": "123 London Road", "AddressLine2": "Flat 6", "City": "London", "Region": "Greater London", "PostalCode": "SE1 7WP", "Country": "GB" }, "AccountNumber": "11696419", "SortCode": "010039", "UserId": "user_m_01J18HZSACR1EMYNY1TBS8KTJD", "OwnerName": "Alex Smith", "Type": "GB", "Id": "bankacc_m_01J6A30MFXK50P8C8PCB73PM1B", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1724768080, "Active": true } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $bankAccountId = '194612216'; $response = $api->Users->GetBankAccount($userId, $bankAccountId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '165863393', } let bankAccount = { Id: '172327870', } const getBankAccount = async (userId, bankAccountId) => { return await mangopay.Users.getBankAccount(userId, bankAccountId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } getBankAccount(user.Id, bankAccount.Id) ``` ```ruby Ruby 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 viewBankAccount(userId, bankAccountId) begin response = MangoPay::BankAccount.fetch(userId, bankAccountId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch bank account: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '165863393' } myBankAccount = { Id: '194239783' } viewBankAccount(myUser[:Id], myBankAccount[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.BankAccount; public class DeactivateBankAccount { 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_01J29D5XMKKNPX72AR5HRV804X"; var bankAccountId = "bankacc_m_01J29HTDKMX1P4Z8251CEV81K7"; BankAccount bankAccount = mangopay.getUserApi().getBankAccount(userId, bankAccountId); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(bankAccount); System.out.println(prettyJson); } } ``` ```python Python 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 BankAccount bank_account_id = '214651521' natural_user_id = '213753890' try: view_bank_account_id = BankAccount.get(reference = bank_account_id, user_id = natural_user_id) pprint(vars(view_bank_account)) except BankAccount.DoesNotExist: print('The Bank Account {} does not exist.'.format(bank_account_id)) ``` ```csharp .NET using MangoPay.SDK; 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 bankAccountId = "bankacc_m_01J536R3EM0A8CSPSVQHHDRG6E"; var viewBankAccount = await api.Users.GetBankAccountAsync(userId, bankAccountId); string prettyPrint = JsonConvert.SerializeObject(viewBankAccount, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Bank Wire PayIn object ### Description The Direct Bank Wire PayIn object represents a declaration of funds to be wired by the end user to the returned bank account. When the funds are received on the bank account and reconciled (i.e., matched) with the declaration, the status is updated to `SUCCEEDED` and the wallet is credited. The object expires 1 month after creation if no funds are received. [Learn more](/guides/payment-methods/banking/bank-wire) **→** ### Attributes The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. For a direct bank wire pay-in, the `DebitedFunds` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). For a direct bank wire pay-in, the `CreditedFunds` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). For a direct bank wire pay-in, the `Fees` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the declared funds to be wired by the end user to the returned bank account. **Returned 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 funds. 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`). Information about the fees to be taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). *Max. length: 255 characters* The reference which the end user must provide when making the bank wire. The `WireReference` is used to reconcile the funds that arrive on the bank account with the `DeclaredDebitedFunds` in the Direct Bank Wire PayIn object. **Caution:** This reference is specific to each payment and must be retrieved dynamically. Information about the bank account to which the bank wire must be made by the end user. **Caution:** Do not hardcode the returned values. Mangopay may change the underlying bank details without prior notice. Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. The IBAN (international bank account number) for the bank account. The BIC (international identifier of the bank) for the bank account. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. Information received from banking partners for the transaction, based on the cash management (Camt) messages of ISO 20022. This information is only returned when the pay-in `Status` becomes `SUCCEEDED`. If data is not available then an empty array, `null`, or nulled fields are returned. If multiple wire payments are received for a single pay-in, then multiple objects are returned. **Max. length:** 50 characters The bank transaction domain code (e.g. PMNT). **Max. length:** 50 characters The bank transaction domain family code (e.g. ICDT). **Max. length:** 50 characters The domain sub-family code (e.g. ACDT). References for the transaction. If multiple references are available, multiple objects are returned. **Max. length:** 50 characters The type of the reference. **Max. length:** 100 characters The value of the reference. **Max. length:** 100 characters The name of the debtor (i.e. the registered owner of the account that was debited). **Max. length:** 50 characters The account identifier of the debtor (e.g. the account number). **Max. length:** 50 characters The agent of the debtor (e.g. the BIC or bank code). **Max. length:** 500 characters The first line of the debtor’s address. **Max. length:** 500 characters The second line of the debtor’s address. **Max. length:** 500 characters The third line of the debtor’s address. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. ### Related resources Learn more about bank wire pay-ins # Create a Bank Wire PayIn POST /v2.01/{ClientId}/payins/bankwire/direct/ This call declares the payment to be made by the end user and returns the `BankAccount` details and `WireReference` they must use. **Caution – Retrieve the returned bank details dynamically** In addition to the `WireReference`, ensure you implement the `BankAccount` object parameter dynamically so the `IBAN`, `BIC`, and other response values appear as returned in for each pay-in. Mangopay may change the underlying bank account without prior notice and mismatched data my lead to delays. See the bank wire pay-in guide for more details. ### Body parameters *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. The unique identifier of the credited wallet. Information about the declared funds to be wired by the end user to the returned bank account. **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 funds. 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`). Information about the fees to be taken by the platform for this transaction (and hence transferred to the Fees Wallet). **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 fees. 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`). The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. For a direct bank wire pay-in, the `DebitedFunds` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 fees. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). For a direct bank wire pay-in, the `CreditedFunds` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). For a direct bank wire pay-in, the `Fees` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the declared funds to be wired by the end user to the returned bank account. **Returned 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 funds. 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`). Information about the fees to be taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). *Max. length: 255 characters* The reference which the end user must provide when making the bank wire. The `WireReference` is used to reconcile the funds that arrive on the bank account with the `DeclaredDebitedFunds` in the Direct Bank Wire PayIn object. **Caution:** This reference is specific to each payment and must be retrieved dynamically. Information about the bank account to which the bank wire must be made by the end user. **Caution:** Do not hardcode the returned values. Mangopay may change the underlying bank details without prior notice. Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. The IBAN (international bank account number) for the bank account. The BIC (international identifier of the bank) for the bank account. Information received from banking partners for the transaction, based on the cash management (Camt) messages of ISO 20022. This information is only returned when the pay-in `Status` becomes `SUCCEEDED`. If data is not available then an empty array, `null`, or nulled fields are returned. If multiple wire payments are received for a single pay-in, then multiple objects are returned. **Max. length:** 50 characters The bank transaction domain code (e.g. PMNT). **Max. length:** 50 characters The bank transaction domain family code (e.g. ICDT). **Max. length:** 50 characters The domain sub-family code (e.g. ACDT). References for the transaction. If multiple references are available, multiple objects are returned. **Max. length:** 50 characters The type of the reference. **Max. length:** 100 characters The value of the reference. **Max. length:** 100 characters The name of the debtor (i.e. the registered owner of the account that was debited). **Max. length:** 50 characters The account identifier of the debtor (e.g. the account number). **Max. length:** 50 characters The agent of the debtor (e.g. the BIC or bank code). **Max. length:** 500 characters The first line of the debtor’s address. **Max. length:** 500 characters The second line of the debtor’s address. **Max. length:** 500 characters The third line of the debtor’s address. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. ```json 200 - CREATED { "Id": "payin_m_01JFAJSSR3VW3SHX2X74C8GW82", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1734448310, "ResultCode": null, "ResultMessage": null, "AuthorId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "CreditedUserId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "DebitedFunds": { "Currency": "XXX", "Amount": 0 }, "CreditedFunds": { "Currency": "XXX", "Amount": 0 }, "Fees": { "Currency": "XXX", "Amount": 0 }, "Status": "CREATED", "ExecutionDate": null, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01JFAJS7838A32W7KPJ7NNGJ1D", "DebitedWalletId": null, "PaymentType": "BANK_WIRE", "ExecutionType": "DIRECT", "DeclaredDebitedFunds": { "Currency": "EUR", "Amount": 62789 }, "DeclaredFees": { "Currency": "EUR", "Amount": 7826 }, "WireReference": "MGgq1y8jjb", "BankAccount": { "OwnerAddress": { "AddressLine1": "2 Avenue Amélie", "AddressLine2": null, "City": "Luxembourg", "Region": null, "PostalCode": "L-1125", "Country": "LU" }, "Type": "IBAN", "OwnerName": "MANGOPAY SA", "IBAN": "FR7630056009271234567890182", "BIC": "CCFRFRPPXXX" }, "TransactionDetails": [] } ``` ```json REST { "Tag": "Created using Mangopay API Postman Collection", "AuthorId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "CreditedWalletId": "wlt_m_01JFAJS7838A32W7KPJ7NNGJ1D", "DeclaredDebitedFunds": { "Currency": "EUR", "Amount": 62789 }, "DeclaredFees": { "Currency": "EUR", "Amount": 7826 }, } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = 'user_m_01HQK25M6KVHKDV0S36JY9NRKR'; $walletId = 'wlt_m_01HQT6422EER2N7FPRXWTSDCSV'; $bankwirePayIn = new \MangoPay\PayIn(); $bankwirePayIn->AuthorId = $userId; $bankwirePayIn->CreditedWalletId = $walletId; $bankwirePayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsBankWire(); $bankwirePayIn->PaymentDetails->DeclaredDebitedFunds = new \MangoPay\Money(); $bankwirePayIn->PaymentDetails->DeclaredDebitedFunds->Amount = 1000; $bankwirePayIn->PaymentDetails->DeclaredDebitedFunds->Currency = 'EUR'; $bankwirePayIn->PaymentDetails->DeclaredFees = new \MangoPay\Money(); $bankwirePayIn->PaymentDetails->DeclaredFees->Amount = 0; $bankwirePayIn->PaymentDetails->DeclaredFees->Currency = 'EUR'; $bankwirePayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect(); $bankwirePayIn->ExecutionDetails->Culture = 'FR'; $response = $api->PayIns->Create($bankwirePayIn); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myDirectBankWirePayIn = { PaymentType: 'BANK_WIRE', ExecutionType: 'DIRECT', AuthorId: '146476890', Tag: 'Created with Mangopay Node.js SDK', CreditedUserId: '146476890', DeclaredDebitedFunds: { Currency: 'EUR', Amount: 1000, }, DeclaredFees: { Currency: 'EUR', Amount: 100, }, CreditedWalletId: '148968396', } const createDirectBankWirePayIn = async (payin) => { return await mangopay.PayIns.create(payin) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createDirectBankWirePayIn(myDirectBankWirePayIn) ``` ```ruby Ruby 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 createDirectBankWirePayIn(payInObject) begin response = MangoPay::PayIn::BankWire::Direct.create(payInObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create pay-in: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { AuthorId: '146476890', Tag: 'Created with Mangopay Node.js SDK', CreditedUserId: '146476890', DeclaredDebitedFunds: { Currency: 'EUR', Amount: 1000, }, DeclaredFees: { Currency: 'EUR', Amount: 100, }, CreditedWalletId: '148968396', } createDirectBankWirePayIn(myPayIn) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.entities.PayIn; import com.mangopay.entities.subentities.PayInExecutionDetailsDirect; import com.mangopay.entities.subentities.PayInPaymentDetailsBankWire; public class CreateDirectBankWirePayIn { 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_01HQK25M6KVHKDV0S36JY9NRKR"; var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; PayIn bankwirePayin = new PayIn(); PayInPaymentDetailsBankWire payinDetails = new PayInPaymentDetailsBankWire(); payinDetails.setDeclaredDebitedFunds(new Money(CurrencyIso.EUR, 1000)); payinDetails.setDeclaredFees(new Money(CurrencyIso.EUR, 1000)); bankwirePayin.setAuthorId(userId); bankwirePayin.setCreditedWalletId(walletId); bankwirePayin.setPaymentDetails(payinDetails); bankwirePayin.setExecutionDetails(new PayInExecutionDetailsDirect()); PayIn createPayIn = mangopay.getPayInApi().create(bankwirePayin); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayIn); System.out.println(prettyJson); } } ``` ```python Python 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, Wallet, BankWirePayIn from mangopay.utils import Money natural_user = NaturalUser.get('213753890') user_wallet = Wallet.get('215029593') direct_bank_wire_payin = BankWirePayIn( author_id=natural_user, credited_wallet_id=user_wallet.id, declared_debited_funds=Money(amount=1000, currency='EUR'), declared_fees=Money(amount=50, currency='EUR') ) create_direct_bank_wire_payin = direct_bank_wire_payin.save() pprint(create_direct_bank_wire_payin) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var payIn = new PayInBankWireDirectPostDTO( userId, walletId, new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR } ) { CreditedWalletId = walletId, AuthorId = userId, Tag = "Created using the Mangopay .NET SDK" }; PayInDTO createBankWirePayIn = await api.PayIns.CreateBankWireDirectAsync(payIn); string prettyPrint = JsonConvert.SerializeObject(createBankWirePayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a PayIn (Bank Wire) GET /v2.01/{ClientId}/payins/{PayInId} **Note – Pay-in data retained for 13 months** An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the pay-in. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. For a direct bank wire pay-in, the `DebitedFunds` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 fees. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). For a direct bank wire pay-in, the `CreditedFunds` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). For a direct bank wire pay-in, the `Fees` displays placeholder values (currency `XXX` and amount `0`) until the `Status` changes to `SUCCEEDED`. **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the declared funds to be wired by the end user to the returned bank account. **Returned 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 funds. 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`). Information about the fees to be taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). *Max. length: 255 characters* The reference which the end user must provide when making the bank wire. The `WireReference` is used to reconcile the funds that arrive on the bank account with the `DeclaredDebitedFunds` in the Direct Bank Wire PayIn object. **Caution:** This reference is specific to each payment and must be retrieved dynamically. Information about the bank account to which the bank wire must be made by the end user. **Caution:** Do not hardcode the returned values. Mangopay may change the underlying bank details without prior notice. Information about the address of residence of the bank account owner. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account. *Max. length: 255 characters* The full name of the owner of the bank account. The IBAN (international bank account number) for the bank account. The BIC (international identifier of the bank) for the bank account. Information received from banking partners for the transaction, based on the cash management (Camt) messages of ISO 20022. This information is only returned when the pay-in `Status` becomes `SUCCEEDED`. If data is not available then an empty array, `null`, or nulled fields are returned. If multiple wire payments are received for a single pay-in, then multiple objects are returned. **Max. length:** 50 characters The bank transaction domain code (e.g. PMNT). **Max. length:** 50 characters The bank transaction domain family code (e.g. ICDT). **Max. length:** 50 characters The domain sub-family code (e.g. ACDT). References for the transaction. If multiple references are available, multiple objects are returned. **Max. length:** 50 characters The type of the reference. **Max. length:** 100 characters The value of the reference. **Max. length:** 100 characters The name of the debtor (i.e. the registered owner of the account that was debited). **Max. length:** 50 characters The account identifier of the debtor (e.g. the account number). **Max. length:** 50 characters The agent of the debtor (e.g. the BIC or bank code). **Max. length:** 500 characters The first line of the debtor’s address. **Max. length:** 500 characters The second line of the debtor’s address. **Max. length:** 500 characters The third line of the debtor’s address. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. **Max. length:** 1,000 characters Remittance information for the transaction. ```json 200 - SUCCEEDED { "Id": "payin_m_01JFAJSSR3VW3SHX2X74C8GW82", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1734448310, "ResultCode": null, "ResultMessage": null, "AuthorId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "CreditedUserId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "DebitedFunds": { "Currency": "EUR", "Amount": 62789 }, "CreditedFunds": { "Currency": "EUR", "Amount": 54963 }, "Fees": { "Currency": "EUR", "Amount": 7826 }, "Status": "CREATED", "ExecutionDate": null, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01JFAJS7838A32W7KPJ7NNGJ1D", "DebitedWalletId": null, "PaymentType": "BANK_WIRE", "ExecutionType": "DIRECT", "DeclaredDebitedFunds": { "Currency": "EUR", "Amount": 62789 }, "DeclaredFees": { "Currency": "EUR", "Amount": 7826 }, "WireReference": "MGgq1y8jjb", "BankAccount": { "OwnerAddress": { "AddressLine1": "2 Avenue Amélie", "AddressLine2": null, "City": "Luxembourg", "Region": null, "PostalCode": "L-1125", "Country": "LU" }, "Type": "IBAN", "OwnerName": "MANGOPAY SA", "IBAN": "FR7630056009271234567890182", "BIC": "CCFRFRPPXXX" }, "TransactionDetails": [ { "BankTransactionDomainCode": "PMNT", "BankTransactionDomainFamilyCode": "RCDT", "BankTransactionDomainSubFamilyCode": null, "References": [ { "Type": "EndToEndId", "Value": "AAB.123.EU.ABC-00012345" } ], "DebtorName": "Example Business Services GmbH", "DebtorAccount": "DE95500400007892074911", "DebtorAgent": "COBADEFFXXX", "DebtorAddressLine1": null, "DebtorAddressLine2": null, "DebtorAddressLine3": null, "RemittanceInformationLine1": "MG12AB34CD", "RemittanceInformationLine2": "/SABF/9URQ", "RemittanceInformationLine3": null, "RemittanceInformationLine4": null } ] } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payinId = 'payin_m_01HYG8DRT5FHT1FV44MV9KR1BS'; $response = $api->PayIns->Get($payinId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myPayIn = { Id: '156279887', } const viewPayIn = async (payinId) => { return await mangopay.PayIns.get(payinId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewPayIn(myPayIn.Id) ``` ```ruby Ruby 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 viewPayIn(payinId) begin response = MangoPay::PayIn.fetch(payinId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch PayIn: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { Id: '156279887' } viewPayIn(myPayIn[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.PayIn; public class ViewPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); PayIn payin = mangopay.getPayInApi().get("your-payin-id"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(payin); System.out.println(prettyJson); } } ``` ```python Python 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 PayIn payin_id = 'wt_4fdf7754-6213-4016-be88-84587f093623' try: view_payin = PayIn.get(payin_id) pprint(view_payin._data) except PayIn.DoesNotExist: print('PayIn {} does not exist.'.format(payin_id)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var viewPayIn = await api.PayIns.GetBankWireDirectAsync("payin_m_01J3CZ2Y7V37TRNMD55AAA2J2A"); string prettyPrint = JsonConvert.SerializeObject(viewPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Banking Alias object ### Description Mangopay relies on the Banking Alias object to create a virtual IBAN or account number attached to a wallet. Once attached, the IBAN can be used by end users to wire funds directly to the wallet. **Note – Regulated feature** The virtual IBAN feature is regulated and has the following constraints: * Activation is required, including in Sandbox (contact our teams via the Dashboard) * A contract amendment is needed to specify the BIC to use for your platform * Only one banking alias can be created per wallet * Fees cannot be taken on pay-ins to banking aliases ### Attributes *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The banking alias details in local format. This parameter is only returned for applicable countries (for example, GB). The sort code of the banking alias in local format. The account number of the banking alias in local format. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Allowed values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active.\ Caution: Setting this value to `false` is irreversible. **Returned values:** `IBAN` The type of banking alias. The unique identifier of the object. The unique identifier of the wallet. ### Related resources Learn more about virtual IBAN Learn how to attach a virtual IBAN to a wallet # Create an IBAN Banking Alias POST /v2.01/{ClientId}/wallets/{WalletId}/bankingaliases/iban ### Path parameters The unique identifier of the wallet. ### Body parameters *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. **Allowed values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. ### Responses *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Returned values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. **Returned values:** `IBAN`, `GB` The type of banking alias. The `GB` value is only returned if the `Country` is `GB`. The unique identifier of the object. The unique identifier of the wallet. *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The banking alias details in local format. This parameter is only returned for applicable countries (for example, GB). The sort code of the banking alias in local format. The account number of the banking alias in local format. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Returned values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. **Returned values:** `IBAN`, `GB` The type of banking alias. The `GB` value is only returned if the `Country` is `GB`. The unique identifier of the object. The unique identifier of the wallet. ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "fd020620-8e5c-4b64-925c-aa980e42c237#1670340996", "Date": 1670340997.0, "errors": { "Country": "The requested country is not supported" } } ``` ```json { "Message": "There is already a banking alias existing for this wallet", "Type": "wallet_banking_alias_already_exists", "Id": "77b73aa3-e08e-4e04-9ffd-5c94ed4f73ff", "Date": 1732178114, "errors": null } ``` ```json { "Message": "Invalid country GB for EUR wallet. Possible value(s): LU/FR/ES/DE.", "Type": "country_not_associated_to_wallet_currency", "Id": "1eb1c947-bac2-4127-a636-fe7d811db9e7", "Date": 1725288513.0, "errors": null } ``` ```json { "Message": "This endpoint is not available for your account", "Type": "forbidden_ressource", "Id": "441d156a-ebd1-421e-851b-460a25c6a53f#1670262779", "Date": 1670262780.0, "errors": null } ``` ```json 200 - FR { "OwnerName": "Alex Smith", "IBAN": "FR7674521100005657670994474", "BIC": "MPAYFRP1PIN", "CreditedUserId": "user_m_01HSB23417BFG7YXR7E371JSEA", "Country": "FR", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1710846581, "Active": true, "Type": "IBAN", "Id": "wltbank_m_01HSB6E769Y3ZBYDJACSP3THGA", "WalletId": "wlt_m_01HSB6DE1YT1EMTH0K7ASYPG96" } ``` ```json 200 - GB { "OwnerName": "Alex Smith", "IBAN": "GB78SAPY60838221394585", "BIC": null, "LocalAccountDetails": { "SortCode": "608382", "AccountNumber": "21394585" }, "CreditedUserId": "user_m_01JADFDBCZS25REHAF6M0NJH5G", "Country": "GB", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1730883439, "Active": true, "Type": "GB", "Id": "wltbank_01JC0B2JH632KTAGSM0ZBJYG7Q", "WalletId": "wlt_m_01JC0B1VZA7YG1J4YC21E60PZM" } ``` ```json REST { "OwnerName": "Alex Smith", "Country": "FR", "Tag": "Created using Mangopay API Postman Collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $walletId = '194311530'; $bankingAlias = new \MangoPay\BankingAliasIBAN(); $bankingAlias->OwnerName = 'Alex Smith'; $bankingAlias->Tag = 'Updated using Mangopay PHP SDK'; $bankingAlias->Country ='FR'; $bankingAlias->WalletId = $walletId; $response = $api->BankingAliases->Create($bankingAlias); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myBankingAlias = { OwnerName: 'John', Tag: 'Created with Mangopay NodeJS SDK', Country: 'FR', Type: 'IBAN', WalletId: '172463559', } const createBankingAlias = async (bankingAlias) => { return await mangopay.BankingAliases.create(bankingAlias) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createBankingAlias(myBankingAlias) ``` ```ruby Ruby 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 createBankingAlias(bankingAliasObject, walletId) begin response = MangoPay::BankingAliasesIBAN.create(bankingAliasObject, walletId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create banking alias: #{error.message}" puts "Error details: #{error.details}" return false end end myBankingAlias = { OwnerName: 'John', Tag: 'Created with Mangopay NodeJS SDK', Country: 'FR', Type: 'IBAN', WalletId: '194311640' } myWallet = { Id: '194311640' } createBankingAlias(myBankingAlias, myWallet[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.enumerations.CountryIso; import com.mangopay.entities.BankingAlias; import com.mangopay.entities.UserNatural; public class CreateIbanBankingAlias { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); UserNatural user = mangopay.getUserApi().getNatural("user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"); var walletId = "wlt_m_01J1YRFBF1EDX4TK2A5G0MNRSN"; BankingAlias bankingAlias = new BankingAlias(); bankingAlias.setOwnerName(String.format("%s %s", user.getFirstName(), user.getLastName())); bankingAlias.setCountry(CountryIso.FR); BankingAlias createBankingAlias = mangopay.getBankingAliases().create(walletId, bankingAlias); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createBankingAlias); System.out.println(prettyJson); } } ``` ```python Python 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.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import NaturalUser, Wallet, BankingAliasIBAN natural_user = NaturalUser.get('213753890') user_wallet = Wallet.get('215029593') iban_alias = BankingAliasIBAN( owner_name = f'{natural_user.first_name} {natural_user.last_name}', credited_user = natural_user, wallet_id = user_wallet.id, tag = 'Create using the Mangopay Python SDK', country = 'FR' ) create_iban_alias = iban_alias.save() pprint(create_iban_alias) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; UserNaturalDTO user = await api.Users.GetNaturalAsync(userId); var walletId = "wlt_m_01J3D02K6ETV3BDP88C7PD2NDB"; var bankingAliasIban = new BankingAliasIbanPostDTO( user.FirstName + " " + user.LastName, CountryIso.FR ) { Tag = "Created using the Mangopay .NET SDK" }; var createBankingAlias = await api.BankingAlias.CreateIbanAsync(walletId, bankingAliasIban); string prettyPrint = JsonConvert.SerializeObject(createBankingAlias, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Deactivate a Banking Alias PUT /v2.01/{ClientId}/bankingaliases/{BankingAliasId} **Caution – Deactivating a Banking Alias is irreversible** Once the Banking Alias object is deactivated, you cannot reactivate it or attach another to the same wallet. Any funds wired to the banking alias won’t be credited to the corresponding wallet. If such cases arise, contact Mangopay via the Dashboard. ### Path parameters The unique identifier of the banking alias. ### Body parameters Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. ### Responses *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Returned values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. **Returned values:** `IBAN`, `GB` The type of banking alias. The `GB` value is only returned if the `Country` is `GB`. The unique identifier of the object. The unique identifier of the wallet. ```json 200 { "OwnerName": "John Doe.", "IBAN": "FR617452110000GJX2HRBQPLS41", "BIC": "MPAYFRP1PIN", "CreditedUserId": "145397183", "Country": "FR", "Tag": "ibanized", "CreationDate": 1670342493, "Active": false, "Type": "IBAN", "Id": "157688274", "WalletId": "157688124" } ``` ```json REST { "Active": false, } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $bankingAliasId = '199314046'; $bankingAliasIBAN = $api->BankingAliases->Get($bankingAliasId); $bankingAliasIBAN->Active = false; $response = $api->BankingAliases->Update($bankingAliasIBAN); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myBankingAlias = { Id: '169741679', } const deactivateBankingAlias = async (bankingAliasId) => { return await mangopay.BankingAliases.deactivate(bankingAliasId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } deactivateBankingAlias(myBankingAlias.Id) ``` ```ruby Ruby 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 deactivateBankingAlias(bankingAliasId) begin response = MangoPay::BankingAliases.update(bankingAliasId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to deactivate banking alias: #{error.message}" puts "Error details: #{error.details}" return false end end myBankingAlias = { Id: '194349049', Active: false } deactivateBankingAlias(myBankingAlias[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.BankingAlias; public class DeactivateIbanBankingAlias { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); BankingAlias bankingAlias = mangopay.getBankingAliases().get("wltbank_m_01HTHTXVG59ATHA89ZHG2CKADA"); bankingAlias.Active = false; BankingAlias deactivateIbanBankingAlias = mangopay.getBankingAliases().deactivate(bankingAlias.getId(), bankingAlias); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(deactivateIbanBankingAlias); System.out.println(prettyJson); } } ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var bankingAliasId = "wltbank_m_01J3CZJSQW4V3BGHGTNM34EA1P"; var bankingAliasPut = new BankingAliasPutDTO { Active = false }; var deactivateBankingAlias = await api.BankingAlias.UpdateAsync(bankingAliasPut, bankingAliasId); string prettyPrint = JsonConvert.SerializeObject(deactivateBankingAlias, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The External Instruction Bank Wire PayIn object ### Description The External Instruction Bank Wire PayIn object represents a pay-in made to a Banking Alias directly from the end user bank. This pay-in is therefore not generated with the Mangopay API but created automatically upon receiving the funds. In Sandbox, you can use the "Create a banking alias payin" feature in the Dashboard Sandbox operations to create this object. **Note – `DebitedBankAccount` only available for EU IBAN** The `DebitedBankAccount` information may not be available for pay-ins made from non-EU IBANs. ### Attributes **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. The unique identifier of the user at the source of the transaction. The unique identifier of the credited wallet. Information about the debited bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account. *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The unique identifier of the banking alias. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **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. The date and time at which the object was created. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. The reference of the wire made to a banking alias. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. 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. Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object. # View a Banking Alias GET /v2.01/{ClientId}/bankingaliases/{BankingAliasId} ### Query parameters The unique identifier of the banking alias. ### Responses *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Returned values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. **Returned values:** `IBAN`, `GB` The type of banking alias. The `GB` value is only returned if the `Country` is `GB`. The unique identifier of the object. The unique identifier of the wallet. *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The banking alias details in local format. This parameter is only returned for applicable countries (for example, GB). The sort code of the banking alias in local format. The account number of the banking alias in local format. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Returned values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. **Returned values:** `IBAN`, `GB` The type of banking alias. The `GB` value is only returned if the `Country` is `GB`. The unique identifier of the object. The unique identifier of the wallet. ```json 200 - FR { "OwnerName": "Alex Smith", "IBAN": "FR7674521100005657670994474", "BIC": "MPAYFRP1PIN", "CreditedUserId": "user_m_01HSB23417BFG7YXR7E371JSEA", "Country": "FR", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1710846581, "Active": true, "Type": "IBAN", "Id": "wltbank_m_01HSB6E769Y3ZBYDJACSP3THGA", "WalletId": "wlt_m_01HSB6DE1YT1EMTH0K7ASYPG96" } ``` ```json 200 - GB { "OwnerName": "Alex Smith", "IBAN": "GB78SAPY60838221394585", "BIC": null, "LocalAccountDetails": { "SortCode": "608382", "AccountNumber": "21394585" }, "CreditedUserId": "user_m_01JADFDBCZS25REHAF6M0NJH5G", "Country": "GB", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1730883439, "Active": true, "Type": "GB", "Id": "wltbank_01JC0B2JH632KTAGSM0ZBJYG7Q", "WalletId": "wlt_m_01JC0B1VZA7YG1J4YC21E60PZM" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $bankingAliasId = '157608228'; $response = $api->BankingAliases->Get($bankingAliasId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let bankingAlias = { Id: '172463615', } const getBankingAlias = async (bankingAliasId) => { return await mangopay.BankingAliases.get(bankingAliasId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } getBankingAlias(bankingAlias.Id) ``` ```ruby Ruby 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 viewBankingAlias(bankingAliasId) begin response = MangoPay::BankingAliases.fetch(bankingAliasId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch banking alias: #{error.message}" puts "Error details: #{error.details}" return false end end myBankingAlias = { Id: '157608228' } viewBankingAlias(myBankingAlias[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.BankingAlias; public class ViewBankingAlias { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); BankingAlias bankingAlias = mangopay.getBankingAliases().get("wltbank_m_01HTHTXVG59ATHA89ZHG2CKADA"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(bankingAlias); System.out.println(prettyJson); } } ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var bankingAliasId = "wltbank_m_01J3CZJSQW4V3BGHGTNM34EA1P"; var viewBankingAlias = await api.BankingAlias.GetAsync(bankingAliasId); string prettyPrint = JsonConvert.SerializeObject(viewBankingAlias, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a Banking Alias for a Wallet GET /v2.01/{ClientId}/wallets/{WalletId}/bankingaliases ### Path parameters The unique identifier of the wallet. ### Responses The list of banking aliases created by the platform. The Banking Alias object created by the platform. *Max. length: 255 characters* The owner of the banking alias. The `OwnerName` must match the name of the user owning the wallet (`FirstName` and `LastName` for a Natural User, `Name` for a Legal User). If Mangopay has provided your platform with a Technical Collection Virtual IBAN for reconciliation purposes, the `OwnerName` must be "Mangopay S.A." or "Mangopay S.A. - Your Trading Name". Please ensure your have confirmed this integration with our teams via the Dashboard. The IBAN (international bank account number) of the banking alias. The BIC (international identifier of the bank) for the banking alias. The banking alias details in local format. This parameter is only returned for applicable countries (for example, GB). The sort code of the banking alias in local format. The account number of the banking alias in local format. The unique identifier of the user whose wallet is credited, in other words, the Owner of the wallet for which the alias is created.\ Note: Once the banking alias is created, it is not possible to change the `CreditedUserId`. **Returned values:** DE, DK, ES, FR, GB, LU, PL The country of the banking alias. The country must correspond to the currency of the wallet. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. Whether or not the banking alias is active. **Caution:** Setting this value to `false` is irreversible. **Returned values:** `IBAN`, `GB` The type of banking alias. The `GB` value is only returned if the `Country` is `GB`. The unique identifier of the object. The unique identifier of the wallet. ```json 200 - FR [ { "OwnerName": "Alex Smith", "IBAN": "FR7674521100005657670994474", "BIC": "MPAYFRP1PIN", "CreditedUserId": "user_m_01HSB23417BFG7YXR7E371JSEA", "Country": "FR", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1710846581, "Active": true, "Type": "IBAN", "Id": "wltbank_m_01HSB6E769Y3ZBYDJACSP3THGA", "WalletId": "wlt_m_01HSB6DE1YT1EMTH0K7ASYPG96" } ] ``` ```json 200 - GB [ { "OwnerName": "Alex Smith", "IBAN": "GB78SAPY60838221394585", "BIC": null, "LocalAccountDetails": { "SortCode": "608382", "AccountNumber": "21394585" }, "CreditedUserId": "user_m_01JADFDBCZS25REHAF6M0NJH5G", "Country": "GB", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1730883439, "Active": true, "Type": "GB", "Id": "wltbank_01JC0B2JH632KTAGSM0ZBJYG7Q", "WalletId": "wlt_m_01JC0B1VZA7YG1J4YC21E60PZM" } ] ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myWallet = { Id: '169738660', } const getWalletBankingAlias = async (walletId) => { return await mangopay.BankingAliases.getAll(walletId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } getWalletBankingAlias(myWallet.Id) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.BankingAlias; import com.mangopay.entities.Wallet; import java.util.List; public class ViewWalletBankingAlias { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); Wallet wallet = mangopay.getWalletApi().get("wlt_m_01HTHTXEF4BJCTKMXNWMSZ6KP5"); List bankingAliases = mangopay.getBankingAliases().listForWallet(wallet.getId()); for (BankingAlias bankingAlias : bankingAliases) { Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(bankingAlias); System.out.println(prettyJson); } } } ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var walletId = "wlt_m_01J3D02K6ETV3BDP88C7PD2NDB"; var viewWalletBankingAlias = await api.BankingAlias.GetAllAsync(walletId, null, null); string prettyPrint = JsonConvert.SerializeObject(viewWalletBankingAlias, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a PayIn (Banking Alias) GET /v2.01/{ClientId}/payins/{PayInId} **Note – Pay-in data retained for 13 months** An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the pay-in. ### Responses **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. The unique identifier of the user at the source of the transaction. The unique identifier of the credited wallet. Information about the debited bank account. *Max. length: 255 characters* The full name of the owner of the bank account. (Format: FirstName LastName) **Returned values:** `IBAN`, `US`, `CA`, `GB`, `OTHER` The type of the bank account. *Length: Up to 34 characters* The IBAN (international bank account number) of the bank account. It follows the CCDDBBAN format in which: * CC represents the country code (ISO 3166-1 alpha 2) * DD represents two check digits used by banking systems to avoid simple errors * BBAN stands for the Basic Bank Account Number which is up to 30 alphanumeric characters that are country-specific.\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The BIC (international identifier of the bank) for IBAN or OTHER-type bank accounts.\ The BIC can have one of the two following formats: * BIC8 – 8-character BIC (AAAABBCC) * BIC11 – 11-character BIC (AAAABBCCDDD)\ In which: * AAAA represents the bank code: 4 characters defining the bank * BB represents the country code: 2 characters forming the country ISO code (ISO 3166 format) * CC represents the location code: 2 localization characters (alphabetical or numeric) to distinguish banks from the same country * DDD represents the branch code: 3 optional characters defining the branch as a branch of the bank\ Note: You will need a valid IBAN (i.e., existing in real life) when testing on a Sandbox account even if no actual payout will be processed. The unique identifier of the banking alias. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **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. The date and time at which the object was created. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. The reference of the wire made to a banking alias. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. 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. Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object. ```json 200 { "CreditedUserId": "user_m_01HSB23417BFG7YXR7E371JSEA", "AuthorId": "user_m_01HSB23417BFG7YXR7E371JSEA", "CreditedWalletId": "wlt_m_01HSB6DE1YT1EMTH0K7ASYPG96", "DebitedBankAccount": { "IBAN": "FR7630004000031234567890143", "BIC": "BNPAFRPP", "AccountNumber": null, "Country": null, "OwnerName": "Alex Smith", "Type": "IBAN" }, "BankingAliasId": "wltbank_m_01HSB6E769Y3ZBYDJACSP3THGA", "Type": "PAYIN", "Status": "SUCCEEDED", "ResultCode": "000000", "ResultMessage": "Success", "Nature": "REGULAR", "CreationDate": 1710847216, "ExecutionDate": 1710847216, "WireReference": "Example123", "PaymentType": "BANK_WIRE", "ExecutionType": "EXTERNAL_INSTRUCTION", "DebitedWalletId": null, "Fees": { "Currency": "EUR", "Amount": 0 }, "DebitedFunds": { "Currency": "EUR", "Amount": 14654 }, "CreditedFunds": { "Currency": "EUR", "Amount": 14654 }, "Id": "payin_m_01HSB71JKJ9FVYZ61D97ZQ1ASR", "Tag": null } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payinId = 'payin_m_01HYG8DRT5FHT1FV44MV9KR1BS'; $response = $api->PayIns->Get($payinId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myPayIn = { Id: '156279887', } const viewPayIn = async (payinId) => { return await mangopay.PayIns.get(payinId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewPayIn(myPayIn.Id) ``` ```ruby Ruby 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 viewPayIn(payinId) begin response = MangoPay::PayIn.fetch(payinId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch PayIn: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { Id: '156279887' } viewPayIn(myPayIn[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.PayIn; public class ViewPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); PayIn payin = mangopay.getPayInApi().get("your-payin-id"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(payin); System.out.println(prettyJson); } } ``` ```python Python 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 PayIn payin_id = 'wt_4fdf7754-6213-4016-be88-84587f093623' try: view_payin = PayIn.get(payin_id) pprint(view_payin._data) except PayIn.DoesNotExist: print('PayIn {} does not exist.'.format(payin_id)) ``` ```csharp .NET using MangoPay.SDK; 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 viewPayIn = await api.PayIns.GetAsync("payin_m_01J334XF2V6751GRG9M2M558HG"); string prettyPrint = JsonConvert.SerializeObject(viewPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The BLIK PayIn object ### Description The BLIK PayIn object enables you to process BLIK payments. There are two BLIK pay-in options: * With code (also known as BLIK Classic): users generate a temporary 6-digit BLIK code from their banking app, enter it on your platform's website or app, and then confirm the payment in their banking app. * Without code (also known as BLIK OneClick): after generating the temporary 6-digit BLIK code and confirming the payment, the users can save your platform which allows future payments to be processed directly. For both options, the endpoint is the same but the parameters required are different in each case. **Note – Timeout after 55 seconds** The payment session lasts for 55 seconds, at which point the pay-in fails automatically if no action has been taken by the user. **Note – Minimum amount in Production** In Production, the minimum accepted amount for BLIK is 0.01 PLN (`1`). ### Attributes The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned values:** `PLN` The currency of the funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned values:** `PLN` The currency of the funds. 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`). Information about the fees. **Returned values:** `PLN` The currency of the fees. 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`). The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. The 6-digit code from the user’s banking application. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Returned values:** `BLIK` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. ***Note:** This parameter is only returned if it is sent.* *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. ### Related resources Learn more about BLIK # Create a BLIK PayIn (with code) POST /v2.01/{ClientId}/payins/payment-methods/blik **Note – Timeout after 55 seconds** The payment session lasts for 55 seconds, at which point the pay-in fails automatically if no action has been taken by the user. **Note – Minimum amount in Production** In Production, the minimum accepted amount for BLIK is 0.01 PLN (`1`). ### Body parameters The unique identifier of the user at the source of the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique identifier of the credited wallet. Information about the debited funds. **Allowed values:** `PLN` The currency of the funds. 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`). Information about the fees. **Allowed values:** `PLN` The currency of the fees. 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`). The 6-digit code from the user’s banking application. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. ***Note**: This parameter is only returned if it is sent.* Information about the browser used by the end user (author) to perform the payment. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned values:** `PLN` The currency of the funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned values:** `PLN` The currency of the funds. 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`). Information about the fees. **Returned values:** `PLN` The currency of the fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Returned values:** `BLIK` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. ***Note:** This parameter is only returned if it is sent.* The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. The 6-digit code from the user’s banking application. Information about the browser used by the end user (author) to perform the payment. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. ```json 200 - Created { "Id": "wt_54874ce5-751d-4616-b7f0-7cee68aee39d", "Tag": "Created using Mangopay API Collection Postman", "CreationDate": 1718178213, "AuthorId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "DebitedFunds": { "Currency": "PLN", "Amount": 100 }, "CreditedFunds": { "Currency": "PLN", "Amount": 100 }, "Fees": { "Currency": "PLN", "Amount": 0 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1", "CreditedUserId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "PaymentType": "BLIK", "ExecutionType": "WEB", "ReturnURL": "https://www.mangopay.com/docs/please-ignore?transactionId=wt_54874ce5-751d-4616-b7f0-7cee68aee39d", "RedirectURL": "https://r3.girogate.de/ti/dumbdummy?tx=2263480064&rs=It3FPwW1ezPJlRIb84DFwDj2S7pk8n80&cs=2b704ceaa038b2519137369f883d4b560e63cf490adcc8e2426ae45524c965e9", "StatementDescriptor": "May2024", "Code": "777365", "BrowserInfo": null, "IpAddress": "159.180.248.187" } ``` ```json REST { "AuthorId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "CreditedWalletId": "wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1", "DebitedFunds": { "Currency": "PLN", "Amount": 100 }, "Fees": { "Currency": "PLN", "Amount": 0 }, "Code" : "777365", "IpAddress" : "159.180.248.187", "ReturnUrl": "https://www.mangopay.com/docs/please-ignore", "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", "JavascriptEnabled": true }, "Tag": "Created using Mangopay API Collection Postman", "StatementDescriptor" : "May2024" } ``` # Create a BLIK PayIn (without code) POST /v2.01/{ClientId}/payins/payment-methods/blik ### Body parameters The unique identifier of the user at the source of the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique identifier of the credited wallet. Information about the debited funds. **Allowed values:** `PLN` The currency of the funds. 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`). Information about the fees. **Allowed values:** `PLN` The currency of the fees. 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`). *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned values:** `PLN` The currency of the funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned values:** `PLN` The currency of the funds. 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`). Information about the fees. **Returned values:** `PLN` The currency of the fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Returned values:** `BLIK` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. The 6-digit code from the user’s banking application. Information about the browser used by the end user (author) to perform the payment. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. ```json 200 - Created { "Id": "wt_dbb46bf7-71e1-463c-bbd5-8217f3c4b474", "Tag": "Created using the Mangopay API Postman collection", "CreationDate": 1715610590, "AuthorId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "DebitedFunds": { "Currency": "PLN", "Amount": 100 }, "CreditedFunds": { "Currency": "PLN", "Amount": 100 }, "Fees": { "Currency": "PLN", "Amount": 0 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1", "CreditedUserId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "PaymentType": "BLIK", "ExecutionType": "WEB", "ReturnURL": "https://www.mangopay.com/docs/please-ignore?transactionId=wt_dbb46bf7-71e1-463c-bbd5-8217f3c4b474", "RedirectURL": "https://r3.girogate.de/ti/dumbdummy?tx=2246577013&rs=D4a2bjG5roOlXDEvsBOdb2NoCNtPxxKZ&cs=f3452531239c64143ec6a9ccd382553ec71a987cdcdc16a4f2046bc5e3b8d373", "StatementDescriptor": "May2024", "Code": null, "BrowserInfo": null, "IpAddress": null } ``` ```json REST { "AuthorId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "CreditedWalletId": "wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1", "DebitedFunds": { "Currency": "PLN", "Amount": 100 }, "Fees": { "Currency": "PLN", "Amount": 0 }, "ReturnUrl": "https://www.mangopay.com/docs/please-ignore", "Tag": "Created using the Mangopay API Postman collection", "StatementDescriptor": "May2024" } ``` ```java Java 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.core.enumerations.PayInExecutionType; import com.mangopay.core.enumerations.PayInPaymentType; import com.mangopay.entities.PayIn; import com.mangopay.entities.subentities.PayInExecutionDetailsWeb; import com.mangopay.entities.subentities.PayInPaymentDetailsBlik; public class CreateBLIKPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; var walletId = "wlt_m_01J291BGPEPVHWA1BEQPV0SWP6"; PayIn blikPayin = new PayIn(); blikPayin.setAuthorId(userId); blikPayin.setCreditedWalletId(walletId); blikPayin.setDebitedFunds(new Money(CurrencyIso.PLN, 1000)); blikPayin.setFees(new Money(CurrencyIso.PLN, 0)); blikPayin.setTag("Created using the Mangopay Java SDK"); PayInExecutionDetailsWeb executionDetails = new PayInExecutionDetailsWeb(); executionDetails.setReturnUrl("https://www.mangopay.com/docs/please-ignore"); blikPayin.setExecutionDetails(executionDetails); PayInPaymentDetailsBlik paymentDetails = new PayInPaymentDetailsBlik(); paymentDetails.setStatementDescriptor("Jul2024"); blikPayin.setPaymentDetails(paymentDetails); blikPayin.setPaymentType(PayInPaymentType.BLIK); blikPayin.setExecutionType(PayInExecutionType.WEB); PayIn createBlikPayin = mangopay.getPayInApi().create(blikPayin); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createBlikPayin); System.out.println(prettyJson); } } ``` ```python Python 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, BlikPayIn from mangopay.utils import Money blik_payin = BlikPayIn( author_id = 'user_m_01HWSRS7HK6S0XKKD4CJM3PQ04', credited_wallet_id = 'wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1', debited_funds = Money(amount=100, currency='PLN'), fees = Money(amount=0, currency='PLN'), return_url = 'https://www.mangopay.com/docs/please-ignore', tag = 'Created using Mangopay Python SDK', statement_descriptor = 'May2024' ) create_blik_payin = blik_payin.save() pprint(create_blik_payin) ``` ```csharp .NET 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_01J2Y06CEN8J3K19KP0F7YJVNT"; var returnUrl = "https://www.mangopay.com/docs/please-ignore/"; var payIn = new PayInBlikWebPostDTO( userId, new Money { Amount = 2000, Currency = CurrencyIso.PLN }, new Money { Amount = 0, Currency = CurrencyIso.PLN }, walletId, returnUrl, "Created using the Mangopay .NET SDK", "MGP"); var createBlikPayIn = await api.PayIns.CreateBlikWebAsync(payIn); string prettyPrint = JsonConvert.SerializeObject(createBlikPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a PayIn (BLIK) GET /v2.01/{ClientId}/payins/{PayInId} **Note – Pay-in data retained for 13 months** An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the pay-in. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned values:** `PLN` The currency of the funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned values:** `PLN` The currency of the funds. 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`). Information about the fees. **Returned values:** `PLN` The currency of the fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Returned values:** `BLIK` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. ***Note:** This parameter is only returned if it is sent.* The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. The 6-digit code from the user’s banking application. Information about the browser used by the end user (author) to perform the payment. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned values:** `PLN` The currency of the funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned values:** `PLN` The currency of the funds. 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`). Information about the fees. **Returned values:** `PLN` The currency of the fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. **Returned values:** `BLIK` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 255 characters* The URL to which the user is returned after the payment, whether the transaction is successful or not. The URL to which to redirect the user to complete the payment. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. The 6-digit code from the user’s banking application. Information about the browser used by the end user (author) to perform the payment. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. ```json 200 - Succeeded (with code) { "Id": "wt_54874ce5-751d-4616-b7f0-7cee68aee39d", "Tag": "Created using Mangopay API Collection Postman", "CreationDate": 1718178213, "AuthorId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "DebitedFunds": { "Currency": "PLN", "Amount": 100 }, "CreditedFunds": { "Currency": "PLN", "Amount": 100 }, "Fees": { "Currency": "PLN", "Amount": 0 }, "Status": "SUCCEEDED", "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1718178312, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1", "CreditedUserId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "PaymentType": "BLIK", "ExecutionType": "WEB", "ReturnURL": "https://www.mangopay.com/docs/please-ignore?transactionId=wt_54874ce5-751d-4616-b7f0-7cee68aee39d", "RedirectURL": "https://r3.girogate.de/ti/dumbdummy?tx=2263480064&rs=It3FPwW1ezPJlRIb84DFwDj2S7pk8n80&cs=2b704ceaa038b2519137369f883d4b560e63cf490adcc8e2426ae45524c965e9", "StatementDescriptor": "May2024", "Code": "777365", "BrowserInfo": null, "IpAddress": "159.180.248.187" } ``` ```json 200 - Succeeded (without code) { "Id": "wt_dbb46bf7-71e1-463c-bbd5-8217f3c4b474", "Tag": "Created using the Mangopay API Postman collection", "CreationDate": 1715610590, "AuthorId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "DebitedFunds": { "Currency": "PLN", "Amount": 100 }, "CreditedFunds": { "Currency": "PLN", "Amount": 100 }, "Fees": { "Currency": "PLN", "Amount": 0 }, "Status": "SUCCEEDED", "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1715610597, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "wlt_m_01HWSSQV8W6550FJ5NTJQE1DE1", "CreditedUserId": "user_m_01HWSRS7HK6S0XKKD4CJM3PQ04", "PaymentType": "BLIK", "ExecutionType": "WEB", "ReturnURL": "https://www.mangopay.com/docs/please-ignore?transactionId=wt_dbb46bf7-71e1-463c-bbd5-8217f3c4b474", "RedirectURL": "https://r3.girogate.de/ti/dumbdummy?tx=2246577013&rs=D4a2bjG5roOlXDEvsBOdb2NoCNtPxxKZ&cs=f3452531239c64143ec6a9ccd382553ec71a987cdcdc16a4f2046bc5e3b8d373", "StatementDescriptor": "May2024", "Code": null, "BrowserInfo": null, "IpAddress": null } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payinId = 'payin_m_01HYG8DRT5FHT1FV44MV9KR1BS'; $response = $api->PayIns->Get($payinId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myPayIn = { Id: '156279887', } const viewPayIn = async (payinId) => { return await mangopay.PayIns.get(payinId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewPayIn(myPayIn.Id) ``` ```ruby Ruby 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 viewPayIn(payinId) begin response = MangoPay::PayIn.fetch(payinId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch PayIn: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { Id: '156279887' } viewPayIn(myPayIn[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.PayIn; public class ViewPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); PayIn payin = mangopay.getPayInApi().get("your-payin-id"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(payin); System.out.println(prettyJson); } } ``` ```python Python 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 PayIn payin_id = 'wt_4fdf7754-6213-4016-be88-84587f093623' try: view_payin = PayIn.get(payin_id) pprint(view_payin._data) except PayIn.DoesNotExist: print('PayIn {} does not exist.'.format(payin_id)) ``` ```csharp .NET 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 viewPayIn = await api.PayIns.GetBlikAsync("wt_c5f8ce73-507f-44c8-92f3-f89a0f62ca5b"); string prettyPrint = JsonConvert.SerializeObject(viewPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Card Registration object Register card details to obtain a `CardId` token for one-time, recurring, or preauthorized card payments ### Description Mangopay relies on the Card Registration object to safely tokenize a card and create the [Card](/api-reference/cards/card-object) object. Successfully registering a card to create the Card object is a multiple-step process. It is necessary to process card payments (direct, preauthorized, and recurring card pay-ins) or validate the card. **Note – Card validation within 24 hours** A successful transaction (preauthorization, pay-in, or recurring) or card validation within 24 hours of the card registration is required to validate a card. Otherwise, the card becomes invalid and a new card registration will be necessary. **Warning – End user approval** Under no circumstances should card information be kept without the end user's approval. If you don’t have the end user’s approval, you need to deactivate the card. **Best practice – Use Checkout SDK** Simplify payments by card and other payment methods with the Mangopay [Checkout SDK](/sdks/checkout). ### Attributes The unique identifier of the Card Registration object. Custom data that can be added to this object.\ In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object `Tag` parameter and will not be editable. The date and time at which the object was created. The unique identifier of the user the card belongs to. The secure value to use when tokenizing the card via the dedicated endpoint. The secure value to identify the registration when tokenizing the card via the dedicated endpoint. The string returned by the tokenization server on the POST Tokenize the card endpoint. This string must be sent in full as the `RegistrationData` on the PUT Update a Card Registration endpoint to create the Card object. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. The URL to make the card tokenization call. **Caution:** This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned 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 card. **Returned values:** `CREATED`, `VALIDATED`, `ERROR` The status of the card registration: * `CREATED` – The card registration has been created, but no `RegistrationData` has been entered yet and the `CardId` value is `null`. * `VALIDATED` – The card registration has been successfully updated with the `RegistrationData` from the tokenization server. * `ERROR` – The card registration couldn’t be updated with the `RegistrationData` and no `CardId` was generated. For more information, refer to the `ResultCode` (105206, 105299) and `ResultMessage`. ### Related resources Learn how to process a card payment Learn about card registration and processing Learn more about testing all payment methods Simplify card registration with Checkout SDK for web and mobile # Create a Card Registration POST /v2.01/{ClientId}/cardregistrations [Read more about the Card Registration object →](/api-reference/card-registrations/card-registration-object) ### Body parameters Custom data that can be added to this object.\ In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object `Tag` parameter and will not be editable. The unique identifier of the user the card belongs to. **Allowed values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. **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 card. ### Responses The unique identifier of the Card Registration object. Custom data that can be added to this object.\ In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object `Tag` parameter and will not be editable. The date and time at which the object was created. The secure value to use when tokenizing the card via the dedicated endpoint. The secure value to identify the registration when tokenizing the card via the dedicated endpoint. The string returned by the tokenization server, which must be sent in full as the `RegistrationData` on the PUT Update a Card Registration endpoint to create the Card object. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. The URL to make the card tokenization call. **Caution:** This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned 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 card. **Returned values:** `CREATED`, `VALIDATED`, `ERROR` The status of the card registration: * `CREATED` – The card registration has been created, but no `RegistrationData` has been entered yet and the `CardId` value is `null`. * `VALIDATED` – The card registration has been successfully updated with the `RegistrationData` from the tokenization server. * `ERROR` – The card registration couldn’t be updated with the `RegistrationData` and no `CardId` was generated. For more information, refer to the `ResultCode` (105206, 105299) and `ResultMessage`. ```json 200 { "Id": "cardreg_wt_11ed4694-d244-4bd1-92fb-dc473c99a9d4", "Tag": null, "CreationDate": 1726239226, "UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS", "AccessKey": "ehvrHoPE6FpjCCAgmNvg", "PreregistrationData": "lhOJ6CFiDJPCXViyHjfcayh92nouB3AAaB5yqiLCBT6yjkLPCptmxsUdfffAc6EE4uj9AuSfmwbdfKN3BMechzUU3Gz8ectEx70TDeupudr", "RegistrationData": null, "CardId": null, "CardType": "CB_VISA_MASTERCARD", "CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJhbnRob255aF90ZXN0MSIsInRva2VuIjoiUlBQTVdJR1hrd0ZJSGFacyJ9", "ResultCode": null, "ResultMessage": null, "Currency": "EUR", "Status": "CREATED" } ``` ```json REST { "Tag": null, "UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS", "CardType": "CB_VISA_MASTERCARD", "Currency": "EUR" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $cardRegistration = new \MangoPay\CardRegistration(); $cardRegistration->UserId = '195627761'; $cardRegistration->CardType = 'CB_VISA_MASTERCARD'; $cardRegistration->Currency = 'EUR'; $cardRegistration->Tag = 'Created using Mangopay PHP SDK'; $response = $api->CardRegistrations->Create($cardRegistration); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "your-client-id", clientApiKey: "your-api-key", }) let user = { Id: 'user_m_01HQK25M6KVHKDV0S36JY9NRKR', } let userCardRegistration = { UserId: user.Id, Currency: 'EUR', CardType: 'CB_VISA_MASTERCARD' } const createCardRegistration = async(cardRegistration) => { return await mangopay.CardRegistrations.create(cardRegistration) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createCardRegistration(userCardRegistration) ``` ```ruby Ruby 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 createCardRegistration(params) begin response = MangoPay::CardRegistration.create(params) puts response return response rescue MangoPay::ResponseError => error puts "Failed : #{error.message}" puts "Error details: #{error.details}" return false end end params = { "UserId": "user_m_01J2BGH2PGWC4NNWGADT75ATB6", "CardType": "CB_VISA_MASTERCARD", "Currency": "EUR" } createCardRegistration(params) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.enumerations.CardType; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.entities.CardRegistration; public class CreateCardRegistration { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; CardRegistration cardReg = new CardRegistration(); cardReg.setUserId(userId); cardReg.setCardType(CardType.CB_VISA_MASTERCARD); cardReg.setCurrency(CurrencyIso.EUR); cardReg.setTag("Created using the Mangopay Java SDK"); CardRegistration createCardRegistration = mangopay.getCardRegistrationApi().create(cardReg); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createCardRegistration); System.out.println(prettyJson); } } ``` ```python Python 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, CardRegistration natural_user = NaturalUser.get('213600749') card_registration = CardRegistration( user_id = natural_user.id, currency = 'GBP', card_type = 'CB_VISA_MASTERCARD' ) create_card_registration = card_registration.save() pprint(create_card_registration) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; 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 cardRegistration = new CardRegistrationPostDTO( userId, CurrencyIso.EUR, CardType.CB_VISA_MASTERCARD ); var createCardRegistration = await api.CardRegistrations.CreateAsync(cardRegistration); string prettyPrint = JsonConvert.SerializeObject(createCardRegistration, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Tokenize the card POST {CardRegistrationURL} This call sends the necessary information to a PCI-DSS-compliant tokenization server without reaching Mangopay’s servers. The URL to use for this endpoint is returned in the `CardRegistrationURL` parameter on the POST Create a Card Registration call. The request must be made using the “application/x-www-form-urlencoded" content type. **Note – Do not hardcode the URL** The `CardRegistrationURL` is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. **Caution – Card details must never pass via your server** For security reasons, it is strictly forbidden to send the card details to your own server. You must rely on the dedicated PCI-DSS-compliant tokenization server by using the endpoint provided. ### Body parameters The value of the `AccessKey` attribute returned when creating a Card Registration. The value of the `PreregistrationData` attribute returned when creating a Card Registration. The number of the card to be tokenized. *Format: “MMYY”* The expiration date of the card. The card verification code (CVC) of the card (on the back, usually 3 digits). ### Responses The string returned by the tokenization server. This string must be sent in full as the `RegistrationData` on the PUT Update a Card Registration endpoint to create the Card object. ```json 200 data=acIcnwwLleiAvlZUea5VxYT1eCIn3MER8jyZXr-p8Bzb4Rm8GIA0MQtPs2NL7zPzPO_I7EjQm-m92V909JUL6KT-PmPzJfAQZV_8PIz6wKvjorGNaNd8Mg1rqN6eBpS5Nx0xgKTVnyDj15oG8jR875 ``` {/* python used as language only for highlighting (closest fit, seems cURL isn't supported) */} ```python cURL curl --request POST \ --url https://api.sandbox.mangopay.com/{CardRegistrationURL} \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data '{ "accessKeyRef": "ehvrHoPE6FpjCCAgmNvg", "data": "lhOJ6CFiDJPCXViyHjfcayh92nouB3AAaB5yqiLCBT6yjkLPCptmxsUdfffAc6EE4uj9AuSfmwbdfKN3BMechzUU3Gz8ectEx70TDeupudr", "cardNumber": "4970105181818183", "cardExpirationDate": "1229", "cardCvx": "123" }' ``` # Update a Card Registration PUT /v2.01/{ClientId}/cardregistrations/{CardRegistrationId} This call is used to add the string acquired from the tokenization to the Card Registration object in the parameter `RegistrationData`, thereby validating the registration. As a result, the Card object is created and the corresponding `CardId` returned. Platforms should also send the cardholder’s name as it appears on the payment card. The `CardHolderName` parameter is sent on this call but not returned in the response; it is added to the Card object. ### Path parameters The unique identifier of the Card Registration object. ### Body parameters The string returned by the tokenization server on the POST Tokenize the card endpoint. *Min. length: 2 characters; max. length: 45 characters passed to card network, 255 accepted by the API* The cardholder's name shown on the payment card. This value is passed to the card network for use in transaction risk analysis. The value should only contain unmarked alphabetic characters (A-Z, a-z), hyphens (-), apostrophes (‘), and spaces. Letters with diacritics (e.g. É, Ü, ẞ), honorifics (e.g. MRS.) and other special characters are not recommended. The `CardHolderName` is not returned in the Card Registration object; it is added to the Card object. ### Responses The unique identifier of the Card Registration object. Custom data that can be added to this object.\ In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object `Tag` parameter and will not be editable. The date and time at which the object was created. The unique identifier of the user the card belongs to. The secure value to use when tokenizing the card via the dedicated endpoint. The secure value to identify the registration when tokenizing the card via the dedicated endpoint. The string returned by the tokenization server, which must be sent in full as the `RegistrationData` on the PUT Update a Card Registration endpoint to create the Card object. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. The URL to make the card tokenization call. **Caution:** This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned 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 card. **Returned values:** `CREATED`, `VALIDATED`, `ERROR` The status of the card registration: * `CREATED` – The card registration has been created, but no `RegistrationData` has been entered yet and the `CardId` value is `null`. * `VALIDATED` – The card registration has been successfully updated with the `RegistrationData` from the tokenization server. * `ERROR` – The card registration couldn’t be updated with the `RegistrationData` and no `CardId` was generated. For more information, refer to the `ResultCode` (105206, 105299) and `ResultMessage`. The unique identifier of the Card Registration object. Custom data that can be added to this object.\ In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object `Tag` parameter and will not be editable. The date and time at which the object was created. The unique identifier of the user the card belongs to. The secure value to use when tokenizing the card via the dedicated endpoint. The secure value to identify the registration when tokenizing the card via the dedicated endpoint. The string returned by the tokenization server, which must be sent in full as the `RegistrationData` on the PUT Update a Card Registration endpoint to create the Card object. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. The URL to make the card tokenization call. **Caution:** This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned 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 card. **Returned values:** `CREATED`, `VALIDATED`, `ERROR` The status of the card registration: * `CREATED` – The card registration has been created, but no `RegistrationData` has been entered yet and the `CardId` value is `null`. * `VALIDATED` – The card registration has been successfully updated with the `RegistrationData` from the tokenization server. * `ERROR` – The card registration couldn’t be updated with the `RegistrationData` and no `CardId` was generated. For more information, refer to the `ResultCode` (105206, 105299) and `ResultMessage`. ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "a241d282-377f-4415-ab81-5dc11c63f972", "Date": 1723543647.0, "errors": { "CardHolderName": "The field CardHolderName must be between 2 and 255 characters long." } } ``` ```json 200 - Status "VALIDATED" { "Id": "cardreg_wt_11ed4694-d244-4bd1-92fb-dc473c99a9d4", "Tag": null, "CreationDate": 1726239226, "UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS", "AccessKey": "ehvrHoPE6FpjCCAgmNvg", "PreregistrationData": "lhOJ6CFiDJPCXViyHjfcayh92nouB3AAaB5yqiLCBT6yjkLPCptmxsUdfffAc6EE4uj9AuSfmwbdfKN3BMechzUU3Gz8ectEx70TDeupudr", "RegistrationData": "data=acIcnwwLleiAvlZUea5VxYT1eCIn3MER8jyZXr-p8Bzb4Rm8GIA0MQtPs2NL7zPzPO_I7EjQm-m92V909JUL6KT-PmPzJfAQZV_8PIz6wKvjorGNaNd8Mg1rqN6eBpS5Nx0xgKTVnyDj15oG8jR875", "CardId": "card_m_NioQspdYckEoRlzd", "CardType": "CB_VISA_MASTERCARD", "CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJhbnRob255aF90ZXN0MSIsInRva2VuIjoiUlBQTVdJR1hrd0ZJSGFacyJ9", "ResultCode": "000000", "ResultMessage": "Success", "Currency": "EUR", "Status": "VALIDATED" } ``` ```json 200 - Status "ERROR" { "Id": "cardreg_wt_80b891e6-15f2-4f41-92f6-6e1a4bd85f2c", "Tag": null, "CreationDate": 1726239743, "UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS", "AccessKey": "1X0m87dmM2LiwFgxPLBJ", "PreregistrationData": "YkgVxL1yNY4ZOfKtqEew_e0SsxIfYZWISRpVi5B_jKboe08cd0V_NE-iZ891ehPx2ddFLVXdicolcUIkv_kKEA", "RegistrationData": "data=R7hxMYui4h4rBkaNwbiH1PcCheeXpguO2974jNGgynAVfsmychzXX2Wj-MoseJpnl8C1taMnTBqWmjbSWmgMQNE2bMetrwzREAFpp6SMaYi3vFHtOVUf5ZCUjtEbhayaNx0xgKTVnyDj15oG8jR88g", "CardId": null, "CardType": "CB_VISA_MASTERCARD", "CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJjbGllbnRJZCIsInRva2VuIjoidW5xaXVlVG9rZW4ifQ==", "ResultCode": "105299", "ResultMessage": "Token input Error", "Currency": "EUR", "Status": "ERROR" } ``` ```json REST { "RegistrationData": "data=acIcnwwLleiAvlZUea5VxZlDBkf07H6B9-N7SrRv5Vv7oSLc1hhCdoFX4JxfZL2iUkLIQL3o9ehAOeaXCbc1KFWnr4ySDvkZ--mJxxdF-vw-gzLNe3lvG2loJvmwrDyRNx0xgKTVnyDj15oG8jR88g", "CardHolderName": "Alex Smith" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $cardRegistration = new \MangoPay\CardRegistration(); $cardRegistration->Id = '198660792'; $cardRegistration->RegistrationData = 'data=EwQibNkLWbGepaBektTHQcnk7KxDDpQybRm3BWmKLu4DKdgmC-JI0b4bK9UW5C3u1L4A4AkhT3LJqC3_FAvbwYQXIPvj1ElxL2OIJfvlS3YXlJyOctdX1PGkkgCkgl3j0ftIYwFxOdfmDQ5GtM_cIg'; $response = $api->CardRegistrations->Update($cardRegistration); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "your-client-id", clientApiKey: "your-api-key", }) let user = { Id: 'user_m_01HQK25M6KVHKDV0S36JY9NRKR', } let userCardRegistration = { Id: 'cardreg_m_01HRETW28RKJFC8RB9H625RVBD', UserId: user.Id, Currency: 'EUR', CardType: 'CB_VISA_MASTERCARD', RegistrationData: 'data=acIcnwwLleiAvlZUea5VxT5mw_fK696E0m-dvIdK-KnTCrftajOU7W3fTvYLnKiF68q7RUkmAEL86Wi8c0oX7wHD6vfA3lowMRD7SvlcCCl6Xl3Esy_DIyBzznraJzm70ftIYwFxOdfmDQ5GtM_cIg' } const updateCardRegistration = async(cardRegistration) => { return await mangopay.CardRegistrations.update(cardRegistration) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } updateCardRegistration(userCardRegistration) ``` ```ruby Ruby 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 updateCardRegistration(card_registration_id, params) begin response = MangoPay::CardRegistration.update(card_registration_id, params) puts response return response rescue MangoPay::ResponseError => error puts "Failed : #{error.message}" puts "Error details: #{error.details}" return false end end params = { "RegistrationData": "data=acIcnwwLleiAvlZUea5VxW4I8X8iCT0M1Z4j5kgkKf4KQzh0G0UQLpozaVZwyqUOQJM3kYVZIDlCIp6vDysQ6F0qIb1486gpwf_EGW9fTllJlstGZZo5YuZ8RWz_814ONx0xgKTVnyDj15oG8jR88g", "CardHolderName": "ALEX SMITH" } updateCardRegistration("cardreg_m_01J2C8JM4YHV1Z57RKRBK97B0Y", params) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.CardRegistration; public class UpdateCardRegistration { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); CardRegistration cardReg = mangopay.getCardRegistrationApi().get("cardreg_m_01HXY9VZN4J1TERYG1BNPDHENN"); cardReg.setRegistrationData("data=acIcnwwLleiAvlZUea5VxfRSGv9nDzXcMqBpL3byXCz_GKPvDDem-KDL6Tf_yaRZBYWP-ghC9O56GivqHUjmwR4Dq2M_FO0KhF_NWnd-fb5L_0I49NvwmWI1uPP5WuzcNx0xgKTVnyDj15oG8jR88g"); CardRegistration updateCardRegistration = mangopay.getCardRegistrationApi().update(cardReg); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(updateCardRegistration); System.out.println(prettyJson); } } ``` ```python Python 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 CardRegistration user_card_registration = CardRegistration( id = '213600973', registration_data = 'data=R7hxMYui4h4rBkaNwbiH1DvQL35Y-goFSYQI384_jNsDngV32O95BVgk3Pg7vqU_mZIFFs4gFl24VlSBXNiuoi4Be_uieN3jEegz77g8ElaToz_b7S91YuROvHH0w6J40ftIYwFxOdfmDQ5GtM_cIg' ) update_card_registration = user_card_registration.save() pprint(update_card_registration) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var cardRegistrationId = "cardreg_m_01J2Y3ZTFTZSKB5XWAKCNMPWFC"; var registrationData = "data=qc_ShKapgXF-A2t_OC72Ktbe2pgMGnalwOa7YhCbIDdpW0cgKABxbhU6R6yVTVJKZpvPpkvQy0HS6G3zrpUyXboAD2d1WLU2-FKrT2dHpcH9c8YxZgpdCs4Z6c6u-qDT0ftIYwFxOdfmDQ5GtM_cIg"; var cardRegistration = new CardRegistrationPutDTO { RegistrationData = registrationData, Tag = "Updated using the Mangopay .NET SDK" }; var updateCardRegistration = await api.CardRegistrations.UpdateAsync(cardRegistration, cardRegistrationId); string prettyPrint = JsonConvert.SerializeObject(updateCardRegistration, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a Card Registration GET /v2.01/{ClientId}/cardregistrations/{CardRegistrationId} ### Path parameters The unique identifier of the Card Registration object. ### Responses The unique identifier of the Card Registration object. Custom data that can be added to this object.\ In the case of the Card Registration, this parameter can be used to facilitate the link between the User object and its equivalent on your platform for instance. This value will be inherited by the Card object `Tag` parameter and will not be editable. The date and time at which the object was created. The unique identifier of the user the card belongs to. The secure value to use when tokenizing the card via the dedicated endpoint. The secure value to identify the registration when tokenizing the card via the dedicated endpoint. The string returned by the tokenization server, which must be sent in full as the `RegistrationData` on the PUT Update a Card Registration endpoint to create the Card object. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. The URL to make the card tokenization call. **Caution:** This variable URL is specific to each card registration. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned 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 card. **Returned values:** `CREATED`, `VALIDATED`, `ERROR` The status of the card registration: * `CREATED` – The card registration has been created, but no `RegistrationData` has been entered yet and the `CardId` value is `null`. * `VALIDATED` – The card registration has been successfully updated with the `RegistrationData` from the tokenization server. * `ERROR` – The card registration couldn’t be updated with the `RegistrationData` and no `CardId` was generated. For more information, refer to the `ResultCode` (105206, 105299) and `ResultMessage`. ```json 200 { "Id": "cardreg_wt_80b891e6-15f2-4f41-92f6-6e1a4bd85f2c", "Tag": null, "CreationDate": 1726239743, "UserId": "user_m_01J7KACBPAV7XAF8AH9BDCJPRS", "AccessKey": "0dEUcnUbQTdNXi3WF4WM", "PreregistrationData": "lW7pQ21Gv8eJh5u4qWUKd8PUVwdHTGBDaBGXeVcQdSjIGJ7HqsEgrWMKFcQlGUPrn6X2n88FG9yZmJa932yIDyK6lpGoNUYyrgeQDsluRU9", "RegistrationData": "data=qc_ShKapgXF-A2t_OC72KsUngOEnxFTIhI4U9nqKay8J_UGfLFelDx_8GUFWt5zp8HH5DRSTnhLZ_RIB_OJ35ZsP3bOVmF1YdoePYUxf8CWOxMdP0Uc0Rm6ABJRWHIWYn7Rs6J2udgLD-WrTkZpRtw", "CardId": "card_m_GhrYYFpBoNeXXRFx", "CardType": "CB_VISA_MASTERCARD", "CardRegistrationURL": "https://pci.sandbox.mangopay.com/api/mangopay/vault/tokenize/eyJjbGllbnQiOiJhbnRob255aF90ZXN0MSIsInRva2VuIjoiRU50VVhTc2RhSUpBVUJ6VCJ9", "ResultCode": "000000", "ResultMessage": "Success", "Currency": "EUR", "Status": "VALIDATED" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $cardRegistrationId = '192900791'; $response = $api->CardRegistrations->Get($cardRegistrationId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "your-client-id", clientApiKey: "your-api-key", }) let userCardRegistration = { Id: 'cardreg_m_01HRETW28RKJFC8RB9H625RVBD', } const viewCardRegistration = async (cardRegistrationId) => { return await mangopay.CardRegistrations.get(cardRegistrationId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewCardRegistration(userCardRegistration.Id) ``` ```ruby Ruby 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 viewCardRegistration(cardRegistrationId) begin response = MangoPay::CardRegistration.fetch(cardRegistrationId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch Card Registration: #{error.message}" puts "Error details: #{error.details}" return false end end myCardRegistration = { Id: '195067583' } viewCardRegistration(myCardRegistration[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.CardRegistration; public class ViewCardRegistration { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String cardRegId = "cardreg_m_01HXY9VZN4J1TERYG1BNPDHENN"; CardRegistration viewCardRegistration = mangopay.getCardRegistrationApi().get(cardRegId); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(viewCardRegistration); System.out.println(prettyJson); } } ``` ```python Python 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 CardRegistration card_registration = CardRegistration( id = '213600973' ) try: view_card_registration = CardRegistration.get(card_registration.id) pprint(vars(view_card_registration)) except CardRegistration.DoesNotExist: print('Card registration {} does not exist.'.format(view_card_registration.id)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; 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 cardRegistrationId = "cardreg_m_01J2Y3ZTFTZSKB5XWAKCNMPWFC"; var viewCardRegistration = await api.CardRegistrations.GetAsync(cardRegistrationId); string prettyPrint = JsonConvert.SerializeObject(viewCardRegistration, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Card Validation object ### Description The Card Validation object allows you to validate an user’s card using 3DS authentication without processing a payment. A Card object's `Validity` is automatically set to `INVALID` after 24 hours unless it is validated through successful authentication with a Card Validation or a payment (Direct Card PayIn, Preauthorization, Recurring Registration). **Note – Card validation only available for CB\_VISA\_MASTERCARD** The card validation feature is only available for cards with the `CardType` `CB_VISA_MASTERCARD`. **Note – Card validation expires after 5 minutes** Because you cannot create two requests at once for the same card, the card validation will expire after 5 minutes, setting the `Status` of the Card Validation object to `FAILED`.  The Card `Validity`, however, will remain `UNKNOWN`, which allows you to request a new Card Validation. ### Attributes The unique identifier of the user at the source of the transaction. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. Whether or not the `SecureMode` was used. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. **Returned values:** `CARD_VALIDATION` The type of the card validation. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **Default value:** DEFAULT\ **Allowed values:** DEFAULT, FORCE, NO\_CHOICE The mode applied for the [3DS protocol](/guides/payment-methods/card/3ds) 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. *Note: Sending the FORCE value automatically sets the ValidationUsage value to MIT.* **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). **Default value:** MIT\ **Allowed values:** MIT, CIT Indicates the intended usage of the card: * CIT – For customer-initiated transactions (CITs), meaning 3DS is less likely to be required on the card validation. * MIT – For merchant-initiated transactions (MITs), meaning 3DS is more likely to be required on the card validation. *Note: The MIT value is returned automatically if the SecureMode value is FORCE, even if CIT is sent.* **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The date and time at which the object was created. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the card used for the transaction. \ If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. # Create a Card Validation POST /V2.01/{ClientId}/cards/{CardId}/validation ### Path parameters The unique identifier of the Card object, obtained during the card registration process. ### Body parameters The unique identifier of the user at the source of the transaction. *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`). The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. **Allowed values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). **Allowed values:** `DEFAULT`, `FORCE`, `NO_CHOICE` **Default value:** `DEFAULT` 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. **Note:** Sending the FORCE value automatically sets the ValidationUsage value to MIT. **Default value:** MIT\ **Allowed values:** MIT, CIT Indicates the intended usage of the card: * CIT – For customer-initiated transactions (CITs), meaning 3DS is less likely to be required on the card validation. * MIT – For merchant-initiated transactions (MITs), meaning 3DS is more likely to be required on the card validation. *Note: The MIT value is returned automatically if the SecureMode value is FORCE, even if CIT is sent.* The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Responses The unique identifier of the object. The unique identifier of the user at the source of the transaction. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). **Default value:** DEFAULT\ **Allowed values:** DEFAULT, FORCE, NO\_CHOICE The mode applied for the [3DS protocol](/guides/payment-methods/card/3ds) 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. *Note: Sending the FORCE value automatically sets the ValidationUsage value to MIT.* **Default value:** MIT\ **Allowed values:** MIT, CIT Indicates the intended usage of the card: * CIT – For customer-initiated transactions (CITs), meaning 3DS is less likely to be required on the card validation. * MIT – For merchant-initiated transactions (MITs), meaning 3DS is more likely to be required on the card validation. *Note: The MIT value is returned automatically if the SecureMode value is FORCE, even if CIT is sent.* **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The date and time at which the object was created. **Returned values:** `CARD_VALIDATION` The type of the card validation. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "c67ea4b3-c144-4142-8fbd-aca45be840da", "Date": 1706044641.0, "errors": { "CardId": "The underlying card type is invalid. Only card type CB_VISA_MASTERCARD is accepted on this feature." } } ``` ```json { "Message":"One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type":"param_error", "Id":"7a2d1d57-6c0e-4689-bb80-62222ae073ed#1687358437", "Date":1687358438.0, "errors":{ "CardId":"This card is already being validated." } } ``` ```json { "Message":"One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type":"param_error", "Id":"7af030d9-c652-4cfa-a76b-ae445018ed6e#1687358113", "Date":1687358114.0, "errors":{ "CardId":"This card is already VALID." } } ``` ```json { "Message":"One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type":"param_error", "Id":"7af030d9-c652-4cfa-a76b-ae445018ed6e#1687358113", "Date":1687358114.0, "errors":{ "CardId":"This card is INVALID." } } ``` ```json 200 - Created { "Id": "110e5f73-9bdc-4333-860d-84dc3ab0fb3a", "AuthorId": "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT", "Status": "SUCCEEDED", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore?cardValidationId=110e5f73-9bdc-4333-860d-84dc3ab0fb3a", "SecureModeRedirectURL": null, "SecureModeNeeded": false, "IpAddress": "159.180.248.187", "BrowserInfo": { "AcceptHeader": "application/json,text/javascript,*/*;q=0.01<", "JavaEnabled": true, "Language": "fr", "ColorDepth": 32, "ScreenHeight": 667, "ScreenWidth": 375, "TimeZoneOffset": -120, "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 }, "PreferredCardNetwork": "CB", "SecureMode": "NO_CHOICE", "PaymentCategory": "ECommerce", "ValidationUsage": "CIT", "Validity": "VALID", "CreationDate": 1717085089, "AuthorizationDate": 1717085089, "Type": "CARD_VALIDATION", "Applied3DSVersion": "V2_1", "ResultCode": "000000", "ResultMessage": "Success", "Tag": "Custom meta", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json REST { "AuthorId": "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore", "IpAddress": "159.180.248.187", "Tag": "Custom meta", "BrowserInfo": { "AcceptHeader": "application/json,text/javascript,*/*;q=0.01<", "JavaEnabled": true, "Language": "fr", "ColorDepth": 32, "ScreenHeight": 667, "ScreenWidth": 375, "TimeZoneOffset": "-120", "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 }, "PreferredCardNetwork":"CB", "SecureMode":"NO_CHOICE", "ValidationUsage":"CIT" } ``` ```ruby Ruby 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 ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.CardValidation; import com.mangopay.entities.subentities.BrowserInfo; public class CreateCardValidation { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; String cardId = "card_m_01HY0MA4E2WQ0NRYQJP8X8SXMB"; BrowserInfo browserInfo = new BrowserInfo(); browserInfo.setAcceptHeader("application/json,text/javascript,*/*;q=0.01<"); browserInfo.setJavaEnabled(true); browserInfo.setLanguage("fr"); browserInfo.setColorDepth(32); browserInfo.setScreenHeight(667); browserInfo.setScreenWidth(375); browserInfo.setTimeZoneOffset("-120"); browserInfo.setUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"); browserInfo.setJavascriptEnabled(true); CardValidation cardVal = new CardValidation(); cardVal.setAuthorId(userId); cardVal.setSecureModeReturnUrl("https://mangopay.com/docs/please-ignore"); cardVal.setIpAddress("159.180.248.187"); cardVal.setBrowserInfo(browserInfo); cardVal.setTag("Created using the Mangopay Java SDK"); CardValidation createCardValidation = mangopay.getCardApi().validate(cardId, cardVal); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createCardValidation); System.out.println(prettyJson); } } ``` ```python Python 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, CardValidation from mangopay.utils import BrowserInfo natural_user = NaturalUser.get('213600749') user_card_validation = CardValidation( author = natural_user, secure_mode_return_url = 'https://mangopay.com/docs/please-ignore', ip_address = '159.180.248.187', tag = 'Created with Mangopay Python SDK', 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 ), card_id = '213601128' ) create_card_validation = user_card_validation.validate(card_id = user_card_validation.card_id) pprint(create_card_validation) ``` ```csharp .NET using MangoPay.SDK; 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 cardId = "card_m_01J3049JBA2XPA7GC7GEFJRQG4"; var cardValidation = new CardValidationPostDTO( userId, "http://www.mangopay.com/docs/please-ignore", "2001:0620:0000:0000:0211:24FF:FE80:C12C", 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" }, "Created using the Mangopay .NET SDK" ); var createCardValidation = await api.Cards.ValidateAsync(cardId, cardValidation); string prettyPrint = JsonConvert.SerializeObject(createCardValidation, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a Card Validation GET /V2.01/{ClientId}/cards/{CardId}/validation/{ValidationId} ### Path parameters The unique identifier of the Card object, obtained during the card registration process. The unique identifier of the Card Validation object. ### Responses The unique identifier of the object. The unique identifier of the user at the source of the transaction. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **Default value:** DEFAULT\ **Allowed values:** DEFAULT, FORCE, NO\_CHOICE The mode applied for the [3DS protocol](/guides/payment-methods/card/3ds) 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. *Note: Sending the FORCE value automatically sets the ValidationUsage value to MIT.* **Default value:** MIT\ **Allowed values:** MIT, CIT Indicates the intended usage of the card: * CIT – For customer-initiated transactions (CITs), meaning 3DS is less likely to be required on the card validation. * MIT – For merchant-initiated transactions (MITs), meaning 3DS is more likely to be required on the card validation. *Note: The MIT value is returned automatically if the SecureMode value is FORCE, even if CIT is sent.* **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The date and time at which the object was created. **Returned values:** `CARD_VALIDATION` The type of the card validation. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 - Succeeded { "Id": "110e5f73-9bdc-4333-860d-84dc3ab0fb3a", "AuthorId": "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT", "Status": "SUCCEEDED", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore?cardValidationId=110e5f73-9bdc-4333-860d-84dc3ab0fb3a", "SecureModeRedirectURL": null, "SecureModeNeeded": false, "IpAddress": "159.180.248.187", "BrowserInfo": { "AcceptHeader": "application/json,text/javascript,*/*;q=0.01<", "JavaEnabled": true, "Language": "fr", "ColorDepth": 32, "ScreenHeight": 667, "ScreenWidth": 375, "TimeZoneOffset": -120, "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 }, "PreferredCardNetwork": "CB", "SecureMode": "NO_CHOICE", "PaymentCategory": "ECommerce", "ValidationUsage": "CIT", "Validity": "VALID", "CreationDate": 1717085089, "AuthorizationDate": 1717085089, "Type": "CARD_VALIDATION", "Applied3DSVersion": "V2_1", "ResultCode": "000000", "ResultMessage": "Success", "Tag": "Custom meta", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "your-client-id", clientApiKey: "your-api-key", }) let myCard = { Id: 'card_m_01HRAB5X7K39MDNS5NV6DD68G8' } let myCardValidation = { Id: '5b0ab172-e1fd-47d7-a1f8-d674986630d2' } const viewCardValidation = async (cardValidationId) => { return await mangopay.Cards.getCardValidation(myCard.Id, cardValidationId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewCardValidation(myCardValidation.Id) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.CardValidation; public class ViewCardValidation { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String cardId = "card_m_01HY0MA4E2WQ0NRYQJP8X8SXMB"; String cardValidationId = "68230c33-fcf7-486a-9275-74c9e6064968"; CardValidation viewCardValidation = mangopay.getCardApi().getCardValidation(cardId, cardValidationId); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(viewCardValidation); System.out.println(prettyJson); } } ``` ```csharp .NET using MangoPay.SDK; 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 cardId = "card_m_01J3049JBA2XPA7GC7GEFJRQG4"; var cardValidationId = "a5309b17-0455-45cb-9f94-061784604bd3"; var viewCardValidation = await api.Cards.GetCardValidationAsync(cardId, cardValidationId); string prettyPrint = JsonConvert.SerializeObject(viewCardValidation, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Card object ### Description The Card object is the virtual and secured version (i.e., the tokenized version) of a card that can be used to make a payment. The card object is created upon successfully completing the card registration process. The same actual card can be registered several times for security and privacy purposes. As a consequence, for a single real-life card, multiple Card objects can be created in the Mangopay environment. **Caution – Card validation within 24 hours** A successful transaction (preauthorization, pay-in, or recurring) or card validation within 24 hours of the card registration is required to validate a card. Otherwise, the card becomes invalid and a new card registration will be necessary. ### Attributes *Format: “MMYY”* The expiration date of the card. The card number, partially obfuscated. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. **Allowed values:** `CB`, `VISA`, `MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC`, `JCB`, `DISCOVER` The provider of the card. *Format: ISO-3166-1 alpha-3 three-letter country code (e.g., “FRA”)* The country of the card (which is the same as the country of the issuer). The product type of the card. You can find the list of products in the Card products article (coming soon). The unique 5-number code of the issuer. Whether the card is active or not. Setting this parameter to `false` is irreversible and should be done once the pay-in is successful. **Returned 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 card. **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The unique identifier of the user the card belongs to. The unique identifier of the Card object. Custom data added to this object.\ In the case of the Card object, the tag value is inherited from the Card Registration object and is not editable. The date and time at which the object was created. The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential. *Max. length: 45 characters* The cardholder’s name shown on the payment card. This value is passed to the card network for use in transaction risk analysis. ### Related resources Learn how to process a card payment Learn about card registration and processing Learn more about testing all payment methods Simplify card registration with Checkout SDK for web and mobile # Deactivate or edit a Card PUT /v2.01/{ClientId}/cards/{CardId} This call serves one of two purposes: * Setting the card as inactive, and thereby disabling it from being used again. This action is irreversible but doesn’t prevent the card being registered again with [POST Create a Card Registration](/api-reference/card-registrations/create-card-registration). * Adding the `CardHolderName` to an existing Card object. The `CardHolderName` cannot be modified once added to a Card object. It can also be done during registration with [PUT Update a Card Registration](/api-reference/card-registrations/update-card-registration). **Warning – Implement card deactivation** Because card information cannot be kept without the end user's approval, you should implement a way to deactivate the end user’s card systematically when relevant. ### Path parameters The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. ### Body parameters Whether the card is active or not. Setting this parameter to `false` is irreversible and should be done once the pay-in is successful. *Max. length: 45 characters passed to card network, 255 accepted by the API* The cardholder’s name shown on the payment card. This value is passed to the card network for use in transaction risk analysis. The value should only contain unmarked alphabetic characters (A-Z, a-z), hyphens (-), apostrophes (‘), and spaces. Letters with diacritics (e.g. É, Ü, ẞ), honorifics (e.g. MRS.) and other special characters are not recommended (they are transformed before being sent to the card network). The `CardHolderName` is not returned in the Card Registration object; it is added to the Card object. ### Responses *Format: “MMYY”* The expiration date of the card. The card number, partially obfuscated. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. **Allowed values:** `CB`, `VISA`, `MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC`, `JCB`, `DISCOVER` The provider of the card. *Format: ISO-3166-1 alpha-3 three-letter country code (e.g., “FRA”)* The country of the card (which is the same as the country of the issuer). The product type of the card. You can find the list of products in the Card products article (coming soon). The unique 5-number code of the issuer. Whether the card is active or not. Setting this parameter to `false` is irreversible and should be done once the pay-in is successful. **Returned 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 card. **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The unique identifier of the user the card belongs to. The unique identifier of the Card object. Custom data added to this object.\ In the case of the Card object, the tag value is inherited from the Card Registration object and is not editable. The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential. *Max. length: 45 characters* The cardholder’s name shown on the payment card. This value is passed to the card network for use in transaction risk analysis. ```json { "Message": "The card has already been deactivated", "Type": "card_already_not_active", "Id": "8ebd2256-e596-4404-8c76-cd14b505d7a4", "Date": 1690292341.0, "errors": null } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "b89e7138-7812-486e-be79-ee817e4441ac#1718650010", "Date": 1718650011, "errors": { "cardHolderName": "card holder name already exists" } } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "e92e4d2a-81fc-4ca6-9a2b-4b3a0cba57e9", "Date": 1723036573.0, "errors": { "CardHolderName": "The field CardHolderName must be between 2 and 255 characters long." } } ``` ```json 200 { "ExpirationDate": "1229", "Alias": "497010XXXXXX8183", "CardType": "CB_VISA_MASTERCARD", "CardProvider": "VISA", "Country": "FRA", "Product": "I", "BankCode": "unknown", "Active": true, "Currency": "EUR", "Validity": "VALID", "UserId": "user_m_01HZSK5MX04KS9Q7SQSSRGQQ4Q", "Id": "card_m_01J0KPBMM32MMSET50CZZ3RMVJ", "Tag": null, "CreationDate": 1718647902, "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d", "CardHolderName": "ALEX SMITH" } ``` ```json REST { "Active": false } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $card = new \MangoPay\Card(); $card->Id = '198660883'; $card->Active = false; $response = $api->Cards->Update($card); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myCard = { Id: '156285393', Active: false, } const deactivateCard = async (card) => { return await mangopay.Cards.update(card) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } deactivateCard(myCard) ``` ```ruby Ruby 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 deactivateCard(cardId, cardObject) begin response = MangoPay::Card.update(cardId, cardObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to deactivate card: #{error.message}" puts "Error details: #{error.details}" return false end end myCard = { Id: '194579926', Active: false } deactivateCard(myCard[:Id], myCard) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Card; public class DeactivateCard { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String cardId = "card_m_01HXYAVH217SC0ARVDHSE0HQJ0"; Card card = mangopay.getCardApi().get(cardId); Card disableCard = mangopay.getCardApi().disable(card); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(disableCard); System.out.println(prettyJson); } } ``` ```python Python 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 Card user_card = Card( id = '213601128', active = False ) deactive_card = user_card.save() pprint(deactive_card) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var cardId = "card_m_01J2Y4W2R4RWKVEME5WG180SQ3"; var card = new CardPutDTO { Active = false }; var deactivateCard = await api.Cards.UpdateAsync(card, cardId); string prettyPrint = JsonConvert.SerializeObject(deactivateCard, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # List Cards for a Fingerprint GET /v2.01/{ClientId}/cards/fingerprints/{Fingerprint} This call returns all the cards with the same `Fingerprint` value. This can be useful to detect abnormal or fraudulent behavior. Learn more about card fingerprint → ### Path parameters The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential. ### Responses The list of the cards created by the platform. The card object created by the platform. *Format: “MMYY”* The expiration date of the card. The card number, partially obfuscated. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. **Allowed values:** `CB`, `VISA`, `MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC`, `JCB`, `DISCOVER` The provider of the card. *Format: ISO-3166-1 alpha-3 three-letter country code (e.g., “FRA”)* The country of the card (which is the same as the country of the issuer). The unique 5-number code of the issuer. Whether the card is active or not. Setting this parameter to `false` is irreversible and should be done once the pay-in is successful. **Returned 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 card. **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The unique identifier of the user the card belongs to. The unique identifier of the Card object. Custom data added to this object.\ In the case of the Card object, the tag value is inherited from the Card Registration object and is not editable. The date and time at which the object was created. The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential. ```json 200 [ { "ExpirationDate": "1229", "Alias": "497010XXXXXX8183", "CardType": "CB_VISA_MASTERCARD", "CardProvider": "VISA", "Country": "FRA", "Product": "I", "BankCode": "unknown", "Active": true, "Currency": "EUR", "Validity": "UNKNOWN", "UserId": "user_m_01HWQ0VWBTFSWCPF29SR3E7PK9", "Id": "card_m_01HXVF29TMRSTBRE11RY6EY6PT", "Tag": null, "CreationDate": 1715687466, "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d", "CardHolderName": "Jody Smith" }, { "ExpirationDate": "1229", "Alias": "497010XXXXXX8183", "CardType": "CB_VISA_MASTERCARD", "CardProvider": "VISA", "Country": "FRA", "Product": "I", "BankCode": "unknown", "Active": true, "Currency": "EUR", "Validity": "UNKNOWN", "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T", "Id": "card_m_01HXVD91R8QEDY7MYC8TX9R9M8", "Tag": null, "CreationDate": 1715685590, "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d", "CardHolderName": "Alex Smith" } ] ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $fingerprint = '36c74d2e60ba474eab6d6f6d46a642b0'; $response = $api->Cards->GetByFingerprint($fingerprint); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myCard = { fingerprint: '48d63bbcfc2c47fcbc19df35e47b2f8d', } const listCardsFingerprint = async (fingerprint) => { return await mangopay.Cards.getByFingerprint(fingerprint) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listCardsFingerprint(myCard.fingerprint) ``` ```ruby Ruby 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 listFingerprintCards(fingerprint) begin response = MangoPay::Card.get_by_fingerprint(fingerprint) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch cards for fingerprint: #{error.message}" puts "Error details: #{error.details}" return false end end myCard = { Fingerprint: '36c74d2e60ba474eab6d6f6d46a642b0', } listFingerprintCards(myCard[:Fingerprint]) ``` ```python Python 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 Card fingerprint = '48d63bbcfc2c47fcbc19df35e47b2f8d' cards = Card.get_by_fingerprint(fingerprint) for card in cards: pprint(vars(card)) ``` ```csharp .NET using MangoPay.SDK; 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 fingerprint = "48d63bbcfc2c47fcbc19df35e47b2f8d"; var userCards = await api.Cards.GetCardsByFingerprintAsync(fingerprint, null, null); string prettyPrint = JsonConvert.SerializeObject(userCards, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # List Cards for a User GET /v2.01/{ClientId}/users/{UserId}/cards ### Query parameters Whether the card is active or not. ### Path parameters The unique identifier of the user. ### Responses The list of the cards created by the platform. The card object created by the platform. *Format: “MMYY”* The expiration date of the card. The card number, partially obfuscated. **Returned values:** `CB_VISA_MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC` **Default value:** `CB_VISA_MASTERCARD` The type of the card. If not supplied, the default value will be taken into account. **Allowed values:** `CB`, `VISA`, `MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC`, `JCB`, `DISCOVER` The provider of the card. *Format: ISO-3166-1 alpha-3 three-letter country code (e.g., “FRA”)* The country of the card (which is the same as the country of the issuer). The unique 5-number code of the issuer. Whether the card is active or not. Setting this parameter to `false` is irreversible and should be done once the pay-in is successful. **Returned 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 card. **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The unique identifier of the user the card belongs to. The unique identifier of the Card object. Custom data added to this object.\ In the case of the Card object, the tag value is inherited from the Card Registration object and is not editable. The date and time at which the object was created. The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential. ```json 200 [ { "ExpirationDate": "1229", "Alias": "497010XXXXXX8183", "CardType": "CB_VISA_MASTERCARD", "CardProvider": "VISA", "Country": "FRA", "Product": "I", "BankCode": "unknown", "Active": true, "Currency": "EUR", "Validity": "UNKNOWN", "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T", "Id": "card_m_01HXVD91R8QEDY7MYC8TX9R9M8", "Tag": null, "CreationDate": 1715685590, "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d", "CardHolderName": "Alex Smith" }, { "ExpirationDate": "0626", "Alias": "497010XXXXXX1119", "CardType": "CB_VISA_MASTERCARD", "CardProvider": "VISA", "Country": "FRA", "Product": "I", "BankCode": "unknown", "Active": true, "Currency": "EUR", "Validity": "UNKNOWN", "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T", "Id": "card_m_01HXVF4VAM59ZT3FT42T1ZH35Y", "Tag": null, "CreationDate": 1715687550, "Fingerprint": "36c74d2e60ba474eab6d6f6d46a642b0", "CardHolderName": "Jody Smith" } ] ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = '146476890'; $response = $api->Users->GetCards($userId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let user = { Id: '146476890', } const listUserCards = async (userId) => { return await mangopay.Users.getCards(userId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listUserCards(user.Id) ``` ```ruby Ruby 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 listUserCards(userId) begin response = MangoPay::User.cards(userId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch cards for the user: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '146476890' } listUserCards(myUser[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Card; import java.util.List; public class ListUserCards { 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"; List cards = mangopay.getUserApi().getCards(userId, null, null); for (Card card : cards) { Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(card); System.out.println(prettyJson); } } } ``` ```python Python 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 natural_user = NaturalUser.get('211919260') cards = natural_user.cards.all() for card in cards: pprint(vars(card)) ``` ```csharp .NET using MangoPay.SDK; 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_01HQK25M6KVHKDV0S36JY9NRKR"; var userCards = await api.Users.GetCardsAsync(userId, null, null); string prettyPrint = JsonConvert.SerializeObject(userCards, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a Card GET /v2.01/{ClientId}/cards/{CardId} ### Path parameters The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. ### Responses *Format: “MMYY”* The expiration date of the card. The card number, partially obfuscated. **Allowed values:** `CB`, `VISA`, `MASTERCARD`, `AMEX`, `MAESTRO`, `BCMC`, `JCB`, `DISCOVER` The provider of the card. *Format: ISO-3166-1 alpha-3 three-letter country code (e.g., “FRA”)* The country of the card (which is the same as the country of the issuer). The product type of the card. You can find the list of products in the Card products article (coming soon). The unique 5-number code of the issuer. **Returned values:** `UNKNOWN`, `VALID`, `INVALID` Whether the card is valid or not. * `UNKNOWN` – No payment or card validation has been processed, so the validity of the card remains unknown. * `VALID` – The first payment or card validation using the card was processed successfully within 24 hours of the initial card registration. * `INVALID` – The first payment or card validation using the card was attempted and failed, or the status of the corresponding card registration was `CREATED` for more than 24 hours.\ Once a card is set to `INVALID`, it cannot be set back to `VALID`. A new card registration will be necessary to make a payment. The unique identifier of the user the card belongs to. The unique identifier of the Card object. Custom data added to this object.\ In the case of the Card object, the tag value is inherited from the Card Registration object and is not editable. The date and time at which the object was created. The unique representation of the card number. This string can be used to track the card behavior while keeping the card information confidential. ```json 200 { "ExpirationDate": "1229", "Alias": "497010XXXXXX8183", "CardType": "CB_VISA_MASTERCARD", "CardProvider": "VISA", "Country": "FRA", "Product": "I", "BankCode": "unknown", "Active": true, "Currency": "EUR", "Validity": "UNKNOWN", "UserId": "user_m_01HWWPNMR93ASQYJEH6XVDW44T", "Id": "card_m_01HXVD91R8QEDY7MYC8TX9R9M8", "Tag": null, "CreationDate": 1715685590, "Fingerprint": "48d63bbcfc2c47fcbc19df35e47b2f8d", "CardHolderName": "Alex Smith" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $cardId = '193935874'; $response = $api->Cards->Get($cardId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myCard = { Id: '192775715', } const viewCard = async (cardId) => { return await mangopay.Cards.get(cardId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewCard(myCard.Id) ``` ```ruby Ruby 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 viewCard(cardId) begin response = MangoPay::Card.fetch(cardId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch card: #{error.message}" puts "Error details: #{error.details}" return false end end myCard = { Id: '194579926' } viewCard(myCard[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Card; public class ViewCard { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String cardId = "card_m_01HXYAVH217SC0ARVDHSE0HQJ0"; Card viewCard = mangopay.getCardApi().get(cardId); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(viewCard); System.out.println(prettyJson); } } ``` ```python Python 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, Card natural_user = NaturalUser.get('213600749') user_card_id = '213601128' try: view_user_card = Card.get(user_card_id) pprint(vars(view_user_card)) except Card.DoesNotExist: print('The Card {} does not exist for User {}'.format(user_card_id, natural_user.id)) ``` ```csharp .NET using MangoPay.SDK; 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 cardId = "card_m_01J2Y4W2R4RWKVEME5WG180SQ3"; var viewCard = await api.Cards.GetAsync(cardId); string prettyPrint = JsonConvert.SerializeObject(viewCard, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Client Wallet object ### Description The Client Wallet object represents one of two wallets created automatically by Mangopay for each currency: * Fees Wallet - Stores all `Fees` taken on transactions (see the Fees guide for more information). The `FundsType` of the Fees Wallet is `FEES`. * Repudiation Wallet - Manages funds relating to disputes management. The `FundsType` of the Repudiation Wallet is `CREDIT`. There can be only one wallet per `FundsType` and `Currency`. **Note – Latency of balance update** The client wallet balance can take a few minutes to be updated after a transfer with fees has been done. ### Attributes The current balance of the wallet. **Returned 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 balance. 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`). **Returned 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 wallet. **Returned values:** `DEFAULT`, `FEES`, `CREDIT` The type of funds in the wallet: * `DEFAULT` – Regular funds for user-owned wallets. Wallets with this `FundsType` cannot have a negative balance. * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object. * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. The unique identifier of the wallet. In the specific case of the Client Wallet object, this value has the format `FundsType`\_`Currency` (e.g., `FEES_EUR`). *Max. length: 255 characters* This parameter usually allows you to enter custom data, but in the case of the Client Wallet object, it is always “null” as the object is automatically created. The date and time at which the wallet was created. # List all Client Wallets GET /v2.01/{ClientId}/clients/wallets ### Responses The list of Client Wallets. The Client Wallet object created by MANGOPAY. The current balance of the wallet. **Returned 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 balance. 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`). **Returned 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 wallet. **Returned values:** `DEFAULT`, `FEES`, `CREDIT` The type of funds in the wallet: * `DEFAULT` – Regular funds for user-owned wallets. Wallets with this `FundsType` cannot have a negative balance. * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object. * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. The unique identifier of the wallet. In the specific case of the Client Wallet object, this value has the format `FundsType`\_`Currency` (e.g., `FEES_EUR`). *Max. length: 255 characters* Custom data that you can add to this object.\ For wallets, you can use this parameter to identify the corresponding end user in your platform. The date and time at which the wallet was created. ```json 200 [ { "Balance": { "Currency": "EUR", "Amount": 1027 }, "Currency": "EUR", "FundsType": "FEES", "Id": "FEES_EUR", "Tag": null, "CreationDate": 1658926202 }, { "Balance": { "Currency": "EUR", "Amount": 5000 }, "Currency": "EUR", "FundsType": "CREDIT", "Id": "CREDIT_EUR", "Tag": null, "CreationDate": 1658926202 } ] ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $response = $api->Clients->GetWallets(); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) const listClientWallets = async () => { return await mangopay.Clients.getClientWallets() .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listClientWallets() ``` ```ruby Ruby 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 listClientWallets() begin response = MangoPay::Client.fetch_wallets() puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch client wallets: #{error.message}" puts "Error details: #{error.details}" return false end end listClientWallets() ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.Pagination; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.FundsType; import com.mangopay.entities.Wallet; public class ListClientWallets { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); List clientWallets = mangopay.getClientApi().getWallets(FundsType.DEFAULT, new Pagination(1, 100)); for (Wallet clientWallet : clientWallets) { Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(updateUbo); System.out.println(clientWallet); } } } ``` ```python Python 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 ClientWallet client_wallets = ClientWallet.all() for client_wallet in client_wallets: pprint(vars(client_wallet)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; using MangoPay.SDK.Entities; 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 clientWallets = await api.Clients.GetWalletsAsync(FundsType.DEFAULT, new Pagination(1, 10)); string prettyPrint = JsonConvert.SerializeObject(clientWallets, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # List Client Wallets by FundsType GET /v2.01/{ClientId}/clients/wallets/{FundsType} ### Path parameters **Allowed values:** `FEES`, `CREDIT` The type of funds in the Client Wallet: * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object. * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. ### Responses The list of Client Wallets. The Client Wallet object created by MANGOPAY. The current balance of the wallet. **Returned 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 balance. 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`). **Returned 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 wallet. **Returned values:** `DEFAULT`, `FEES`, `CREDIT` The type of funds in the wallet: * `DEFAULT` – Regular funds for user-owned wallets. Wallets with this `FundsType` cannot have a negative balance. * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object. * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. The unique identifier of the wallet. In the specific case of the Client Wallet object, this value has the format `FundsType`\_`Currency` (e.g., `FEES_EUR`). *Max. length: 255 characters* Custom data that you can add to this object.\ For wallets, you can use this parameter to identify the corresponding end user in your platform. The date and time at which the wallet was created. ```json 200 [ { "Balance": { "Currency": "EUR", "Amount": 1027 }, "Currency": "EUR", "FundsType": "FEES", "Id": "FEES_EUR", "Tag": null, "CreationDate": 1658926202 } ] ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; //To get only Fees Wallets try { $fundsType = \MangoPay\FundsType::FEES; $response = $api->Clients->GetWallets($fundsType); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } // To only get Credit Wallets try { $fundsType = \MangoPay\FundsType::CREDIT $response = $api->Clients->GetWallets($fundsType); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myWallets = { FundsType: 'FEES', } //* FundsType may be 'DEFAULT', 'FEES', or 'CREDIT' const listClientWalletsByFundsType = async (fundsType) => { return await mangopay.Clients.getClientWalletsByFundsType(fundsType) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listClientWalletsByFundsType(myWallets.FundsType) ``` ```ruby Ruby 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 listClientWalletsByFundsType(fundsType) begin response = MangoPay::Client.fetch_wallets(fundsType) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch client wallets: #{error.message}" puts "Error details: #{error.details}" return false end end myWallets = { FundsType: 'FEES' } listClientWalletsByFundsType(myWallets[:FundsType]) ``` ```java Java import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.Pagination; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.FundsType; import com.mangopay.entities.Wallet; public class ListClientWallets { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); List clientWallets = mangopay.getClientApi().getWallets(FundsType.FEES, new Pagination(1, 100)); for (Wallet clientWallet : clientWallets) { Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(updateUbo); System.out.println(clientWallet); } } } ``` ```python Python 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 ClientWallet client_wallets = ClientWallet.all_by_funds_type(fund_type = 'CREDIT') for client_wallet in client_wallets: pprint(vars(client_wallet)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; using MangoPay.SDK.Entities; 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 clientWallets = await api.Clients.GetWalletsAsync(FundsType.FEES, new Pagination(1, 10)); string prettyPrint = JsonConvert.SerializeObject(clientWallets, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a Client Wallet GET /v2.01/{ClientId}/clients/wallets/{FundsType}/{Currency} ### Path parameters **Allowed values:** `FEES`, `CREDIT` The type of funds in the Client Wallet: * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object. * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. **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 wallet. ### Responses The current balance of the wallet. **Returned 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 balance. 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`). **Returned 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 wallet. **Returned values:** `DEFAULT`, `FEES`, `CREDIT` The type of funds in the wallet: * `DEFAULT` – Regular funds for user-owned wallets. Wallets with this `FundsType` cannot have a negative balance. * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object. * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object. **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency. The unique identifier of the wallet. In the specific case of the Client Wallet object, this value has the format `FundsType`\_`Currency` (e.g., `FEES_EUR`). *Max. length: 255 characters* Custom data that you can add to this object.\ For wallets, you can use this parameter to identify the corresponding end user in your platform. The date and time at which the wallet was created. ```json 200 { "Balance": { "Currency": "EUR", "Amount": 2027 }, "Currency": "EUR", "FundsType": "FEES", "Id": "FEES_EUR", "Tag": null, "CreationDate": 1658926202 } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myWallet = { FundsType: 'FEES', Currency: 'EUR', } const viewClientWallet = async (fundsType, currency) => { return await mangopay.Clients.getClientWallet(fundsType, currency) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewClientWallet(myWallet.FundsType, myWallet.Currency) ``` ```ruby Ruby 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 viewClientWallet(fundsType, currency) begin response = MangoPay::Client.fetch_wallet(fundsType, currency) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch client wallets: #{error.message}" puts "Error details: #{error.details}" return false end end myClientWallet = { FundsType: 'FEES', Currency: 'EUR' } viewClientWallet(myClientWallet[:FundsType], myClientWallet[:Currency]) ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = '/tmp/'; try { // $fundsType = MangoPay\FundsType::FEES; $fundsType = MangoPay\FundsType::CREDIT; $response = $api->Clients->GetWallets($fundsType); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java 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.core.enumerations.FundsType; import com.mangopay.entities.Wallet; public class ViewClientWallet { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); Wallet clientWallet = mangopay.getClientApi().getWallet(FundsType.FEES, CurrencyIso.EUR); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(updateUbo); System.out.println(clientWallet); } } ``` ```python Python 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 ClientWallet client_wallet = ClientWallet.get(funds_type = 'FEES', currency = 'GBP') pprint(vars(client_wallet)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; 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 viewWallet = await api.Clients.GetWalletAsync(FundsType.FEES, CurrencyIso.EUR, null); string prettyPrint = JsonConvert.SerializeObject(viewWallet, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Client object ### Description The Client object allows you to view and edit information regarding your platform account. ### Attributes The unique identifier associated with the API key, giving access to either the Sandbox or Production environment. The trading name of the company operating the platform. The registered legal name of the company operating the platform. *Emails must be ≤ 40 characters* List of email addresses to contact the platform for technical matters. \ Important: If the email length exceeds 40 characters, it will be be impossible to process some payments. List of email addresses to contact the platform for administrative or commercial matters. List of email addresses to contact the platform for billing matters. List of email addresses to contact the platform for fraud and compliance matters. The address of the platform operator’s headquarters. This parameter must be provided for the platform’s payouts to be processed. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. *Max. length: 15 characters; international telephone numbering plan E.164 (+ followed by the country code, then the number)* The phone number of the platform operator’s headquarters. The tax (or VAT) number for the company operating the platform. The categorization of the platform in terms of business and sector of activity. The business type of the platform. The sector of activity of the platform. The URL of the platform’s website. *Max. length: 2,000 characters* The description of what the platform does. The unique reference for the platform, which should be used when contacting Mangopay. *Hex color code* The primary color of your branding, which is displayed on some payment pages (e.g., mandate confirmation). *Hex color code* The primary color of your branding, which is displayed in call-to-action buttons on some payment pages (e.g., mandate confirmation). The URL of the platform’s logo. Logos may be added by using the Upload a Client Logo endpoint. The registration number of the company operating the platform, assigned by the relevant national authority. 4-digit merchant category code. The MCC is used to classify a business by the types of goods or services it provides. # Update a Client PUT /v2.01/{ClientId}/clients This endpoint allows you to update some of your platform information directly via the API. ### Body parameters *Emails must be ≤ 40 characters* List of email addresses to contact the platform for technical matters. \ Important: If the email length exceeds 40 characters, it will be be impossible to process some payments. List of email addresses to contact the platform for administrative or commercial matters. List of email addresses to contact the platform for billing matters. List of email addresses to contact the platform for fraud and compliance matters. The address of the platform operator’s headquarters. This parameter must be provided for the platform’s payouts to be processed. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* Required if `HeadquarterAddress` is sent. The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Max. length: 15 characters; international telephone numbering plan E.164 (+ followed by the country code, then the number)* The phone number of the platform operator’s headquarters. The tax (or VAT) number for the company operating the platform. The URL of the platform’s website. *Max. length: 2,000 characters* The description of what the platform does. *Hex color code* The primary color of your branding, which is displayed on some payment pages (e.g., mandate confirmation). *Hex color code* The primary color of your branding, which is displayed in call-to-action buttons on some payment pages (e.g., mandate confirmation). ### Responses Type of the platform. This field has been replaced by the `PlatformCategorization` object. The unique identifier associated with the API key, giving access to either the Sandbox or Production environment. The trading name of the company operating the platform. The registered legal name of the company operating the platform. *Emails must be ≤ 40 characters* List of email addresses to contact the platform for technical matters. \ Important: If the email length exceeds 40 characters, it will be be impossible to process some payments. List of email addresses to contact the platform for administrative or commercial matters. List of email addresses to contact the platform for billing matters. List of email addresses to contact the platform for fraud and compliance matters. The address of the platform operator’s headquarters. This parameter must be provided for the platform’s payouts to be processed. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Max. length: 15 characters; international telephone numbering plan E.164 (+ followed by the country code, then the number)* The phone number of the platform operator’s headquarters. The tax (or VAT) number for the company operating the platform. The categorization of the platform in terms of business and sector of activity. The business type of the platform. The sector of activity of the platform. The URL of the platform’s website. *Max. length: 2,000 characters* The description of what the platform does. The unique reference for the platform, which should be used when contacting Mangopay. *Hex color code* The primary color of your branding, which is displayed on some payment pages (e.g., mandate confirmation). *Hex color code* The primary color of your branding, which is displayed in call-to-action buttons on some payment pages (e.g., mandate confirmation). The URL of the platform’s logo. Logos may be added by using the Upload a Client Logo endpoint. The registration number of the company operating the platform, assigned by the relevant national authority. 4-digit merchant category code. The MCC is used to classify a business by the types of goods or services it provides. ```json 200 { "PlatformType": null, "ClientId": "sandbox4586", "Name": "Platform’s name", "RegisteredName": "Platform’s SA", "TechEmails": [ "platformtech@example.com" ], "AdminEmails": [], "BillingEmails": [], "FraudEmails": [], "HeadquartersAddress": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "Paris", "Region": "Ile de France", "PostalCode": "75010", "Country": "FR" }, "HeadquartersPhoneNumber": "+330606060606", "TaxNumber": "n/a", "PlatformCategorization": { "BusinessType": "MARKETPLACE", "Sector": "RENTALS" }, "PlatformURL": "http://mangopay.com/docs/please-ignore", "PlatformDescription": "n/a", "CompanyReference": null, "PrimaryThemeColour": "#afafaf", "PrimaryButtonColour": "#ff974b", "Logo": null, "CompanyNumber": "00000000000000000000", "MCC": "0742" } ``` ```json REST { "TechEmails": [ "platformtech@example.com" ], "AdminEmails": [], "BillingEmails": [], "FraudEmails": [], "HeadquartersAddress": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "Paris", "Region": "Ile de France", "PostalCode": "75010", "Country": "FR" }, "HeadquartersPhoneNumber": "+330606060606", "TaxNumber": "n/a", "PlatformURL": "http://mangopay.com/docs/please-ignore", "PlatformDescription": "n/a", "PrimaryThemeColour": "#afafaf", "PrimaryButtonColour": "#ff974b" } ``` # Upload a Client logo PUT /v2.01/{ClientId}/clients/logo This endpoint allows you to upload the logo of the platform that is displayed on some payment pages to which end users may be redirected (e.g., mandate confirmation). ### Body parameters *Format: Base64 encoded file* The encoded file of the logo to upload. ### Responses *No response body parameters* ```json REST { "File": "iVBORw0KGgoAAAANSUhEUgAAACEAAAATCAYAAAAeVmTJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHzSURBVHgBrZbfTfMwFMXvvU7y9eGTqNQW8RgmaDYgbNANgAlgA2AC2ACYAJiAskHZILwVASK8oAJtL7YLUuw4cYg4UhX51r+bE/vkD8Iv1O10Y5gHsR78n09yqb/gsPdvnU0Eb5/fH1KjSdBPSdAJAiTFOjOfL+nzOJ/lGTjUi3ojRnHo4wg86nf6h0LQjd1I20XcJY5u9JU6OEBxWccNwkHiNdELB7vMdFQ3R54kFhyeteEWhJddqfqVINhx4PeOWqq27GfEhPtNOGWE3qKDShPKoWperDHDscxLHCJt2vNJ4EhzcmvKGShwDLllJKk0Id6i1K5FROfqOJ1NM3kwrgwZY80to6SWQ3g1DCIMK00wcmqVsu+Tu4XY1RzwyDQHk1oOaoIpl2loFBjG0ESIQxODiQ9xmnDlAYhvwSPFOW7Jax/nNBHMgtK+hiDG4JErRyFRu5VYLim1SplvX5V+naM6E4i8ZXaHO2igtjkKKtqlxpD4CjySd8UaAiYW582RnmY/PGS7rdKkRTnhMvUvxbHrHdEkR7q/3McLz5zs8fOxZILQm/pGedC9IhSnCqiagEh7rvq889GKc5pQbuUzfVt9R1j/ZbLR9tNsOnaB6sNkxZVWpJaT58lWL7PVD/WvoI3ORjyXbzZcLHLXFlSpLfejL4BI06DoOrygAAAAAElFTkSuQmCC" } ``` # View a Client GET /v2.01/{ClientId}/clients ### Responses Type of the platform. This field has been replaced by the `PlatformCategorization` object. The unique identifier associated with the API key, giving access to either the Sandbox or Production environment. The trading name of the company operating the platform. The registered legal name of the company operating the platform. *Emails must be ≤ 40 characters* List of email addresses to contact the platform for technical matters. \ Important: If the email length exceeds 40 characters, it will be be impossible to process some payments. List of email addresses to contact the platform for administrative or commercial matters. List of email addresses to contact the platform for billing matters. List of email addresses to contact the platform for fraud and compliance matters. The address of the platform operator’s headquarters. This parameter must be provided for the platform’s payouts to be processed. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Max. length: 15 characters; international telephone numbering plan E.164 (+ followed by the country code, then the number)* The phone number of the platform operator’s headquarters. The tax (or VAT) number for the company operating the platform. The categorization of the platform in terms of business and sector of activity. The business type of the platform. The sector of activity of the platform. The URL of the platform’s website. *Max. length: 2,000 characters* The description of what the platform does. The unique reference for the platform, which should be used when contacting Mangopay. *Hex color code* The primary color of your branding, which is displayed on some payment pages (e.g., mandate confirmation). *Hex color code* The primary color of your branding, which is displayed in call-to-action buttons on some payment pages (e.g., mandate confirmation). The URL of the platform’s logo. Logos may be added by using the Upload a Client Logo endpoint. The registration number of the company operating the platform, assigned by the relevant national authority. 4-digit merchant category code. The MCC is used to classify a business by the types of goods or services it provides. ```json 200 { "PlatformType": null, "ClientId": "sandbox4586", "Name": "Platform’s name", "RegisteredName": "Platform’s SA", "TechEmails": [ "platformtech@example.com" ], "AdminEmails": [], "BillingEmails": [], "FraudEmails": [], "HeadquartersAddress": { "AddressLine1": "Rue des plantes", "AddressLine2": "The Oasis", "City": "Paris", "Region": "Ile de France", "PostalCode": "75010", "Country": "FR" }, "HeadquartersPhoneNumber": "+330606060606", "TaxNumber": "n/a", "PlatformCategorization": { "BusinessType": "MARKETPLACE", "Sector": "RENTALS" }, "PlatformURL": "http://mangopay.com/docs/please-ignore", "PlatformDescription": "n/a", "CompanyReference": null, "PrimaryThemeColour": "#afafaf", "PrimaryButtonColour": "#ff974b", "Logo": null, "CompanyNumber": "00000000000000000000", "MCC": "0742" } ``` # The Conversion Rate object (FX) ### Description The Conversion Rate object represents a foreign exchange rate offered by Mangopay for a currency pair.  **Note – Activation required** Foreign exchange requires activation for your API environment, even in Sandbox. In Production, the feature is subject to a contract amendment. For more information or to activate contact the Support team via the Dashboard. ### Attributes **Returned values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The sell currency (the currency of the debited wallet during a conversion). **Returned values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The buy currency (the currency of the credited wallet during a conversion). *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. The date and time at which the market rate was retrieved. ### Related resources Learn more about FX # View an indicative Conversion Rate GET /v2.01/{ClientId}/conversions/rate/{DebitedCurrency}/{CreditedCurrency} **Note – Rate is not guaranteed** The rate returned by the API is indicative of the rate offered by Mangopay, but it is not a guaranteed rate. For quoted conversions, the rate is guaranteed by the quote. For instant conversions, the rate is displayed in the response. Learn more about FX **→** ### Path parameters **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The sell currency (the currency of the debited wallet during a conversion). **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The buy currency (the currency of the credited wallet during a conversion). ### Responses **Returned values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The sell currency (the currency of the debited wallet during a conversion). **Returned values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The buy currency (the currency of the credited wallet during a conversion). *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. The date and time at which the market rate was retrieved. ```json { "Message": "Forex module is not enabled. Contact your support to activate this feature.", "Type": "forbidden_ressource", "Id": "51199cfd-d8ca-4f30-8262-955c1d2f97ec", "Date": 1699977915.0, "errors": null } ``` ```json 200 - EURGBP currency pair with markup of 100 basis points (1% or 0.01) { "DebitedCurrency": "EUR", "CreditedCurrency": "GBP", "ClientRate": 0.8315406, "MarketRate": 0.83994, "MarketRateDate": 1721742951 } ``` ```php PHP Config->ClientId = 'client-id'; $api->Config->ClientPassword = 'api-key'; $api->Config->TemporaryFolder = '../tmp/'; $api->Config->DebugMode = false; try { $response = $api->Conversions->GetConversionRate("EUR", "GBP"); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.ConversionRate; public class ViewConversionRate { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-client-password"); ConversionRate conversionRate = mangopay.getConversionsApi().getConversionRate("EUR", "GBP"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(conversionRate); System.out.println(prettyJson); } } ``` ```csharp .NET using MangoPay.SDK; using Newtonsoft.Json; using MangoPay.SDK.Entities.GET; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; ConversionRateDTO conversionRate = await api.Conversions.GetConversionRate("EUR", "GBP"); string prettyPrint = JsonConvert.SerializeObject(conversionRate, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Conversion object (FX) ### Description The Conversion object allows you to convert funds in the Mangopay environment from one currency to another. The transaction takes place between two wallets of different currencies with the same owner. The two wallets can be either two Wallets created by the platform for its users, or two Client Wallets. There are two types of conversion: * **Instant (Spot FX)** – Conversion executed without a quote, at the rate returned in the call. * **Quoted (Guaranteed FX)** – Conversion executed against an active Quote that previously locked in the rate. **Caution – Conversions can’t be refunded** A refund is not possible for a quoted or instant conversion. You must reconvert the funds by creating another conversion with the reverse currency pair. **Note – Activation required for feature and currencies** In Production, foreign exchange services are subject to a contract amendment. In Sandbox, both the feature and currencies require activation for your API environment. For more information or to activate contact the Support team via the Dashboard. ### Attributes The unique identifier of the object. The unique identifier of the active quote which guaranteed the rate for the conversion. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. **Returned 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 fees. 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`). The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object. ### Related resources Learn more about FX # Create an Instant Conversion between Client Wallets POST /v2.01/{ClientId}/clients/conversions/instant-conversion This call triggers an immediate conversion at the market rate, of the debited funds to the credited wallet at the market rate. A quote is not required for an instant conversion. ### Body parameters **Allowed values:** `FEES`, `CREDIT` The type of the client wallet to be debited: * `FEES` – Fees Wallet, for fees collected by the platform. * `CREDIT` – Repudiation Wallet, for funds related to dispute management. The amount and currency of the debited funds are defined by the quote. Information about the debited funds. **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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  **Allowed values:** `FEES`, `CREDIT` The type of the client wallet to be credited: * `FEES` – Fees Wallet, for fees collected by the platform. * `CREDIT` – Repudiation Wallet, for funds related to dispute management. The amount and currency of the credited funds are defined by the quote. Information about the credited funds. **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 credited funds (the buy currency). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ### Responses The unique identifier of the object. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object. Functional errors (`ResultCode`) are possible on a 200 response. Read more **→** *** ```json 200 - Succeeded { "Id": "cvr_01J47619CVSEVWZE480Z245AMB", "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1722523100, "Status": "SUCCEEDED", "AuthorId": "client-id", "DebitedWalletId": "FEES_EUR", "CreditedWalletId": "FEES_USD", "DebitedFunds": { "Currency": "EUR", "Amount": 5000 }, "CreditedFunds": { "Currency": "USD", "Amount": 5399 }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1722523101, "ConversionRateResponse": { "ClientRate": 1.071231, "MarketRate": 1.07987 }, "Tag": "Created using Mangopay API Collection Postman" } ``` ```json REST { "DebitedWalletType": "FEES", "DebitedFunds": { "Currency": "EUR", "Amount": 5000 }, "CreditedWalletType": "FEES", "CreditedFunds": { "Currency": "USD" }, "Tag": "Created using Mangopay API Collection Postman" } ``` # Create an Instant Conversion between user Wallets POST /v2.01/{ClientId}/conversions/instant-conversion This call triggers an immediate conversion at the market rate, of the debited funds to the credited wallet at the market rate. A quote is not required for an instant conversion. ### Body parameters The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **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 credited funds (the buy currency). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). Required if `Fees` is sent. The currency of the fees. Required if `Fees` is sent. 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`). *Max. length: 255 characters* Custom data that you can add to this object. ### Responses The unique identifier of the object. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. **Returned 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 fees. 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`). The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object. Functional errors (`ResultCode`) are possible on a 200 response. Read more **→** *** ```json { "Message": "Author 45671234 is not debited wallet 204089031 owner.", "Type": "author_is_not_debited_wallet_owner", "Id": "5251717e-0965-4e33-a85a-a1042775913f", "Date": 1699532783, "errors": null } ``` ```json { "Message": "Author 204068024 is not credited wallet 208282959 owner.", "Type": "author_is_not_credited_wallet_owner", "Id": "f072dcfd-d02c-4489-835f-7abe0b11fa66", "Date": 1699532982, "errors": null } ``` ```json { "Message": "Debited currency incompatibility.", "Type": "currency_incompatibility", "Id": "af071186-b891-4e0d-baeb-736c15a757e8", "Date": 1699532861, "errors": null } ``` ```json { "Message": "Credited currency incompatibility.", "Type": "currency_incompatibility", "Id": "2466e688-5f4f-4dfa-8ebe-97b5608c3dd5", "Date": 1699532915, "errors": null } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "f19eafbd-0310-4814-8f6b-691910b7b4a2", "Date": 1707323047, "errors": { "Fees.Currency": "Provided currency USD does not match debit currency of GBP" } } ``` ```json { "Message": "The currency JPY is not enabled for Forex. Contact your support to activate this feature.", "Type": "forex_not_available", "Id": "f8701d45-2540-4497-a7ce-4a3bc3181d68", "Date": 1699533051, "errors": null } ``` ```json { "Message": "Forex module is not enabled. Contact your support to activate this feature.", "Type": "forbidden_ressource", "Id": "812b8909-9fb1-45b5-9000-06e8c8d73687", "Date": 1699533020, "errors": null } ``` ```json 200 - Succeeded { "Id": "cvr_01J3G21RF2R88PCA34P287ZQPQ", "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1721747169, "Status": "SUCCEEDED", "AuthorId": "user_m_01HSB23417BFG7YXR7E371JSEA", "DebitedWalletId": "wlt_m_01HSJTVB0JKMMHXBEJBV6TMF96", "CreditedWalletId": "wlt_m_01J3G1CY4VH5FNMSAM8M0S5A64", "DebitedFunds": { "Currency": "GBP", "Amount": 1000 }, "CreditedFunds": { "Currency": "USD", "Amount": 1161 }, "Fees": { "Currency": "GBP", "Amount": 100 }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1721747170, "ConversionRateResponse": { "ClientRate": 1.277585, "MarketRate": 1.2904899 }, "Tag": "Created using the Mangopay API Postman collection" } ``` ```json REST { "AuthorId": "user_m_01HSB23417BFG7YXR7E371JSEA", "DebitedWalletId": "wlt_m_01HSJTVB0JKMMHXBEJBV6TMF96", "CreditedWalletId": "wlt_m_01J3G1CY4VH5FNMSAM8M0S5A64", "DebitedFunds": { "Currency": "GBP", "Amount": 1000 }, "CreditedFunds": { "Currency": "USD" }, "Fees": { "Currency": "GBP", "Amount": 100 }, "Tag": "Created using the Mangopay API Postman collection" } ``` ```php PHP Config->ClientId = 'client-id'; $api->Config->ClientPassword = 'api-key'; $api->Config->TemporaryFolder = '../tmp/'; $api->Config->DebugMode = false; try { $instantConversion = new \MangoPay\Conversion(); $debitedUserId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; $debitedWalletId = "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV"; $creditedWalletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; $instantConversion->AuthorId = $debitedUserId; $instantConversion->DebitedWalletId = $debitedWalletId; $instantConversion->CreditedWalletId = $creditedWalletId; $instantConversion->DebitedFunds = new Money(); $instantConversion->DebitedFunds->Amount = 100; $instantConversion->DebitedFunds->Currency = "GBP"; $instantConversion->CreditedFunds = new Money(); $instantConversion->CreditedFunds->Currency = "EUR"; $instantConversion->Tag = "Created using the Mangopay PHP SDK"; $response = $api->Conversions->CreateInstantConversion($instantConversion); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java 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.Conversion; import com.mangopay.entities.CreateInstantConversion; public class CreatingInstantConversion { 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 debitedUserId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var debitedWalletId = "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV"; var creditedWalletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; CreateInstantConversion instantConversion = new CreateInstantConversion(); instantConversion.setAuthorId(debitedUserId); instantConversion.setCreditedWalletId(creditedWalletId); instantConversion.setDebitedWalletId(debitedWalletId); Money debitedFunds = new Money(); debitedFunds.setCurrency(CurrencyIso.GBP); debitedFunds.setAmount(100); Money creditedFunds = new Money(); creditedFunds.setCurrency(CurrencyIso.EUR); Money fees = new Money(); fees.setCurrency(CurrencyIso.GBP); fees.setAmount(10); instantConversion.setCreditedFunds(creditedFunds); instantConversion.setDebitedFunds(debitedFunds); instantConversion.setFees(fees); instantConversion.setTag("Created using the Mangopay Java SDK"); Conversion createInstantConversion = mangopay.getConversionsApi().createInstantConversion(instantConversion, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createInstantConversion); System.out.println(prettyJson); } } ``` # Create a Quoted Conversion between Client Wallets POST /v2.01/{ClientId}/clients/conversions/quoted-conversion This call triggers a conversion at the rate defined in its quote. The debited funds (buy currency), credited funds (sell currency) and currencies are defined in the quote. The Client Wallets to debit and credit are defined in the conversion. Each quoted conversion requires a dedicated Quote object, linked in the `QuoteId`. **Note - Quote cannot contain fees** For a quoted conversion between client wallets, the quote cannot have fees specified. ### Body parameters The unique identifier of the active quote which guaranteed the rate for the conversion. **Allowed values:** `FEES`, `CREDIT` The type of the client wallet to be debited: * `FEES` – Fees Wallet, for fees collected by the platform. * `CREDIT` – Repudiation Wallet, for funds related to dispute management. The amount and currency of the debited funds are defined by the quote. **Allowed values:** `FEES`, `CREDIT` The type of the client wallet to be credited: * `FEES` – Fees Wallet, for fees collected by the platform. * `CREDIT` – Repudiation Wallet, for funds related to dispute management. The amount and currency of the credited funds are defined by the quote. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ### Responses The unique identifier of the object. The unique identifier of the active quote which guaranteed the rate for the conversion. Returned `null` in the case of an instant conversion. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object. Functional errors (`ResultCode`) are possible on a 200 response. Read more **→** *** ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "b4372752-a7dd-4751-b894-d2c960df3e5c", "Date": 1721729683.0, "errors": { "QuoteId": "No fees allowed on client quoted conversion" } } ``` ```json 200 { "Id": "cvr_01J475ZYZ6WBZK3JK3HSZFXHVN", "QuoteId": "cvrquote_01J475ZRENK67V9A62JCQ6PYVW", "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1722523057, "Status": "SUCCEEDED", "AuthorId": "your-client-id", "DebitedWalletId": "FEES_EUR", "CreditedWalletId": "CREDIT_GBP", "DebitedFunds": { "Currency": "EUR", "Amount": 10 }, "CreditedFunds": { "Currency": "GBP", "Amount": 8 }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1722523057, "ConversionRateResponse": { "ClientRate": 0.8352637, "MarketRate": 0.84336 }, "Tag": "Created using Mangopay API Collection Postman" } ``` ```json REST { "QuoteId" : "cvrquote_01J475ZRENK67V9A62JCQ6PYVW", "DebitedWalletType" : "FEES", "CreditedWalletType" : "CREDIT", "Tag": "Created using Mangopay API Collection Postman" } ``` # Create a Quoted Conversion between user Wallets POST /v2.01/{ClientId}/conversions/quoted-conversion This call triggers a conversion at the rate defined in its quote. The debited funds (buy currency), credited funds (sell currency) and currencies are defined in the quote. Each quoted conversion requires a dedicated Quote object, linked in the `QuoteId`. ### Body parameters The unique identifier of the active quote which guaranteed the rate for the conversion. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ### Responses The unique identifier of the object. The unique identifier of the active quote which guaranteed the rate for the conversion. Returned `null` in the case of an instant conversion. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. **Returned 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 fees. 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`). The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Functional errors (`ResultCode`) are possible on a 200 response. Read more **→** *** ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "ffaf5ad6-d9f1-47bf-832c-ea5da626037e", "Date": 1706192320, "errors": { "QuoteId": "Quote not found" } } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "31dc86e1-783e-4e34-94d0-4e1891fd74bb", "Date": 1707301282, "errors": { "QuoteId": "The quote is expired" } } ``` ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "2b989396-3dc7-4fcf-8a7e-2c6463262633", "Date": 1707301113, "errors": { "QuoteId": "The quote is already consumed" } } ``` ```json { "Message": "Credited currency incompatibility.", "Type": "currency_incompatibility", "Id": "47ade3b3-0c5d-4c32-ae11-1cfd23720a11", "Date": 1707314958, "errors": null } ``` ```json { "Message": "Debited currency incompatibility.", "Type": "currency_incompatibility", "Id": "f83e073e-287d-4781-bbba-87256dad4aa0", "Date": 1707315285, "errors": null } ``` ```json { "Message": "Author 204071581 is not debited wallet 214818911 owner.", "Type": "author_is_not_debited_wallet_owner", "Id": "c16cb140-0f02-4c5f-a705-9cfdb11fb499", "Date": 1708382645.0, "errors": null } ``` ```json { "Message": "Author 204071581 is not credited wallet 214818911 owner.", "Type": "author_is_not_credited_wallet_owner", "Id": "5586bf7e-8e33-4e7a-a140-107f7a9e3a26", "Date": 1708382704.0, "errors": null } ``` ```json 200 - Succeeded { "Id": "cvr_01J3G1FKHQ5NAPM2ZG8RKKD706", "QuoteId": "cvrquote_01J3G1FBKHNSB88AJ7RDRCFK9S", "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1721746574, "Status": "SUCCEEDED", "AuthorId": "user_m_01HSB23417BFG7YXR7E371JSEA", "DebitedWalletId": "wlt_m_01HSJTVB0JKMMHXBEJBV6TMF96", "CreditedWalletId": "wlt_m_01J3G1CY4VH5FNMSAM8M0S5A64", "DebitedFunds": { "Currency": "GBP", "Amount": 1000 }, "CreditedFunds": { "Currency": "USD", "Amount": 1162 }, "Fees": { "Currency": "GBP", "Amount": 100 }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1721746575, "ConversionRateResponse": { "ClientRate": 1.2787055, "MarketRate": 1.2911001 }, "Tag": "Created using the Mangopay API Postman collection" } ``` ```json REST { "QuoteId": "cvrquote_01HP1H6EK4H39SCQ8WJ349WMBB", "AuthorId": "204071581", "DebitedWalletId": "204079338", "CreditedWalletId": "209408867", "Tag": "Created using the Mangopay API Postman collection" } ``` ```php PHP Config->ClientId = 'client-id'; $api->Config->ClientPassword = 'api-key'; $api->Config->TemporaryFolder = '../tmp/'; $api->Config->DebugMode = false; try { $quotedConversion = new \MangoPay\Conversion(); $debitedUserId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; $debitedWalletId = "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV"; $creditedWalletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; $quoteId = "cvrquote_01JE92SJATA0X9YXNXKP9N1VFT"; $quotedConversion->QuoteId = $quoteId; $quotedConversion->AuthorId = $debitedUserId; $quotedConversion->DebitedWalletId = $debitedWalletId; $quotedConversion->CreditedWalletId = $creditedWalletId; $quotedConversion->Tag = "Created using the Mangopay PHP SDK"; $response = $api->Conversions->CreateQuotedConversion($quotedConversion); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "client-id", clientApiKey: "api-key" }) let myConversion = { QuoteId: "cvrquote_01JDHAEJF2QRC0MZ6WTJHETDQZ", AuthorId: "user_m_01HQK25M6KVHKDV0S36JY9NRKR", DebitedWalletId: "wlt_m_01HT2J9Q2M6GMFW4Z7GYBAFJ4T", CreditedWalletId: "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV", Tag: "Created using the Mangopay NodeJS SDK" } const createQuotedUserConversion = async (conversion) => { return await mangopay.Conversions.createQuotedConversion(conversion) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createQuotedUserConversion(myConversion) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Conversion; import com.mangopay.entities.CreateQuotedConversion; public class CreatingQuotedConversion { 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 debitedUserId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var debitedWalletId = "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV"; var creditedWalletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; var quoteId = "cvrquote_01J1YPZQXF6A5AAG7YCZAM9D9N"; CreateQuotedConversion quotedConversion = new CreateQuotedConversion(); quotedConversion.setQuoteId(quoteId); quotedConversion.setAuthorId(debitedUserId); quotedConversion.setDebitedWalletId(debitedWalletId); quotedConversion.setCreditedWalletId(creditedWalletId); quotedConversion.setTag("Created using the Mangopay Java SDK"); Conversion createQuotedConversion = mangopay.getConversionsApi().createQuotedConversion(quotedConversion, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createQuotedConversion); System.out.println(prettyJson); } } ``` # View a Conversion GET /v2.01/{ClientId}/conversions/{ConversionId} All conversions returned by this endpoint contain the `QuoteId` parameter. For instant conversions, it is `null`. **Note – Conversion data retained for 13 months** An API call to retrieve a conversion whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the conversion. ### Responses The unique identifier of the object. The unique identifier of the active quote which guaranteed the rate for the conversion. Returned `null` in the case of an instant conversion. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. **Returned 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 fees. 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`). The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object. The unique identifier of the object. The unique identifier of the active quote which guaranteed the rate for the conversion. Returned `null` in the case of an instant conversion. The type of transaction. **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. The date and time at which the object was created. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. The unique identifier of the debited wallet (in the sell currency). The unique identifier of the credited wallet (in the buy currency). Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  Information about the credited funds. **Returned 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 credited funds (the buy currency). 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`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) \* `MarketRate`.  Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. **Returned 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 fees. 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`). The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. Information about the conversion rate used during the transaction. *Max. 7 decimal places* The rate including Mangopay’s markup, indicative of the rate invoiced during the billing cycle: `ClientRate` = `MarketRate` \* (1 - markup).  The `ClientRate` fluctuates in line with the `MarketRate`. *Max. 7 decimal places* The rate used to convert funds during a conversion: (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ```json 200 - Instant conversion { "Id": "cvr_01HQ1QSE554QW3HYQ9DMVF0D5H", "QuoteId": null, "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1708381747, "Status": "SUCCEEDED", "AuthorId": "204071581", "DebitedWalletId": "204844308", "CreditedWalletId": "204079338", "DebitedFunds": { "Currency": "EUR", "Amount": 10000 }, "CreditedFunds": { "Currency": "GBP", "Amount": 8468 }, "Fees": { "Currency": "EUR", "Amount": 100 }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1708381747, "ConversionRateResponse": { "ClientRate": 0.8468, "MarketRate": 0.8554 }, "Tag": "Created using the Mangopay API Postman collection" } ``` ```json 200 - Quoted conversion { "Id": "cvr_01HP1H6P56SSSTBZK1K9THFP79", "QuoteId": "cvrquote_01HP1H6EK4H39SCQ8WJ349WMBB", "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1707301099, "Status": "SUCCEEDED", "AuthorId": "204071581", "DebitedWalletId": "204079338", "CreditedWalletId": "209408867", "DebitedFunds": { "Currency": "GBP", "Amount": 1000 }, "CreditedFunds": { "Currency": "USD", "Amount": 1263 }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1707301100, "ConversionRateResponse": { "ClientRate": 1.2504, "MarketRate": 1.263 }, "Tag": "Created using the Mangopay API Postman collection" } ``` ```php PHP Config->ClientId = 'client-id'; $api->Config->ClientPassword = 'api-key'; $api->Config->TemporaryFolder = '../tmp/'; $api->Config->DebugMode = false; try { $response = $api->Conversions->GetConversion("cvr_01JE92STKQNGZ2W67D224J4S2R"); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Conversion; public class ViewConversion { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); Conversion conversion = mangopay.getConversionsApi().getConversion("cvr_01HTFQG61V40A3SSBMPB50QQZ0"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(conversion); System.out.println(prettyJson); } } ``` ```csharp .NET using MangoPay.SDK; 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 conversionId = "cvr_01J53K1QWW4PHD8GN8DDYXMPTA"; var viewConversion = await api.Conversions.GetInstantConversion(conversionId); string prettyPrint = JsonConvert.SerializeObject(viewConversion, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Country Authorizations object ### Description The Country Authorization object provides information about whether or not a country is subject to the following restrictions: * Blocked user creation * Blocked bank account creation * Blocked payout creation ### Attributes **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The code of the country. Name of the country. Information about the country’s restrictions. Whether or not user creation is possible based on the user’s country of residence, address, and nationality. Whether or not bank account creation is possible based on the bank’s country of domiciliation. Whether or not payout creation is possible based on the bank’s country of domiciliation. The date and time when at least one of the country's authorizations has been last updated. ### Related resources Learn more about country restrictions # List Authorizations for all countries GET /v2.01/countries/authorizations This call returns the restrictions of all countries. ### Responses The list of countries and their restrictions. The country authorization object indicating if there are restrictions for a given country. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The code of the country. Name of the country. Information about the country’s restrictions. Whether or not user creation is possible based on the user’s country of residence, address, and nationality. Whether or not bank account creation is possible based on the bank’s country of domiciliation. Whether or not payout creation is possible based on the bank’s country of domiciliation. The date and time when at least one of the country's authorizations has been last updated. ```json 200 [ { "CountryCode":"FI", "CountryName":"Finland", "Authorization":{ "BlockUserCreation":false, "BlockBankAccountCreation":false, "BlockPayout":false }, "LastUpdate":1644574249 }, { "CountryCode":"FR", "CountryName":"France", "Authorization":{ "BlockUserCreation":false, "BlockBankAccountCreation":false, "BlockPayout":false }, "LastUpdate":1644574249 } ] ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) const listCountryAuthorizations = async () => { return await mangopay.Regulatory.getAllCountriesAuthorizations() .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } listCountryAuthorizations() ``` ```ruby Ruby 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 listCountryAuthorization() begin response = MangoPay::Regulatory.get_all_countries_authorizations() puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch country authorizations: #{error.message}" puts "Error details: #{error.details}" return false end end listCountryAuthorization() ``` ```java Java import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Pagination; import com.mangopay.entities.CountryAuthorization; public class ListCountryAuthorizations { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); List countryAuthorizations = mangopay.getRegulatoryApi().getAllCountriesAuthorizations(new Pagination(1, 100), null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(countryAuthorizations); System.out.println(prettyJson); } } ``` ```python Python 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 CountryAuthorization country_authorizations = CountryAuthorization.get_all_countries_authorizations() for country_authorization in country_authorizations: pprint(country_authorization._data) pprint(vars(country_authorization.authorization)) print() ``` ```csharp .NET using MangoPay.SDK; 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 countryAuthorizations = await api.Regulatory.GetAllCountriesAuthorizations(); string prettyPrint = JsonConvert.SerializeObject(countryAuthorizations, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View Authorizations for a country GET /v2.01/countries/{CountryCode}/authorizations This call returns the restrictions for a specific country. ### Path parameters **Allowed values:** Two-letter country code (ISO 3166-1 alpha-2 format). The code of the country. ### Responses **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The code of the country. Name of the country. Information about the country’s restrictions. Whether or not user creation is possible based on the user’s country of residence, address, and nationality. Whether or not bank account creation is possible based on the bank’s country of domiciliation. Whether or not payout creation is possible based on the bank’s country of domiciliation. The date and time when at least one of the country's authorizations has been last updated. ```json 200 { "CountryCode":"FR", "CountryName":"France", "Authorization":{ "BlockUserCreation":false, "BlockBankAccountCreation":false, "BlockPayout":false }, "LastUpdate":1463494366 } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myCountry = { code: 'FR' } const viewCountryAuthorizations = async (countryCode) => { return await mangopay.Regulatory.getCountryAuthorizations(countryCode) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewCountryAuthorizations(myCountry.code) ``` ```ruby Ruby 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 viewCountryAuthorization(countryCode) begin response = MangoPay::Regulatory.get_country_authorizations(countryCode) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch country authorizations: #{error.message}" puts "Error details: #{error.details}" return false end end myCountry = { Code: 'FR' } viewCountryAuthorization(myCountry[:Code]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.enumerations.CountryIso; import com.mangopay.entities.CountryAuthorization; public class ViewCountryAuthorization { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); CountryAuthorization viewCountryAuthorization = mangopay.getRegulatoryApi().getCountryAuthorizations(CountryIso.FR); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(viewCountryAuthorization); System.out.println(prettyJson); } } ``` ```python Python 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 CountryAuthorization view_country_authorization = CountryAuthorization.get_country_authorizations(country_code='FR') pprint(view_country_authorization._data) pprint(vars(view_country_authorization.authorization)) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Core.Enumerations; using MangoPay.SDK.Entities.GET; 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"; CountryAuthorizationDTO countryAuthorization = await api.Regulatory.GetCountryAuthorizations(CountryIso.FR); string prettyPrint = JsonConvert.SerializeObject(countryAuthorization, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Cancel a Deposit Preauthorization or request a no-show PUT /v2.01/{ClientId}/deposit-preauthorizations/{DepositId} This endpoints allows you to take one of two actions against a deposit preauthorization, in both cases provided that no preauthorized pay-ins have been made to capture funds: * Cancel it manually by setting the `PaymentStatus` to `CANCEL`. A canceled deposit preauthorization can’t be used for any further action. * Request a no-show by setting the `PaymentStatus` to `NO_SHOW_REQUESTED`. If successful, the `PaymentStatus` `NO_SHOW` indicates that you can use the Create a Deposit Preauthorized PayIn complement endpoint to capture additional funds. ### Path parameters The unique identifier of the deposit preauthorization. ### Body parameters **Allowed values:** `CANCELED`,`NO_SHOW_REQUESTED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. ### Responses *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 preauthorized funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json { "Message": "The capture has a success status.", "Type": "invalid_action", "Id": "37b05486-e0de-4b17-9056-b3197a4d85e2", "Date": 1699264645.0, "errors": null } ``` ```json 200 { "Id": "bca6b50b-b808-4b6b-ae46-145259dd01b5", "CreationDate": 1669137965, "ExpirationDate": 1671729965, "AuthorId": "156671912", "DebitedFunds": { "Currency": "EUR", "Amount": 500 }, "Status": "SUCCEEDED", "PaymentStatus": "CANCELED", "PayinsLinked": { "PayinCaptureId": null, "PayinComplementId": null }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "156674899", "PreferredCardNetwork": null, "SecureModeReturnURL": "https://docs.mangopay.com/please-ignore?depositId=bca6b50b-b808-4b6b-ae46-145259dd01b5", "SecureModeRedirectURL": null, "SecureModeNeeded": true, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": "EN", "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": "80.236.38.245", "Billing": { "FirstName": "Joe", "LastName": "Bloggs", "Address": { "AddressLine1": null, "AddressLine2": null, "City": null, "Region": null, "PostalCode": null, "Country": null } }, "Shipping": { "FirstName": "Joe", "LastName": "Bloggs", "Address": { "AddressLine1": null, "AddressLine2": null, "City": null, "Region": null, "PostalCode": null, "Country": null } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "Tag": "Custom meta", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json REST { "PaymentStatus": "CANCELED" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $depositId = 'deposit_m_01JH5W6ZE4FZFYY583XGK1AJAT'; $cancel = new CancelDeposit(); $cancel->PaymentStatus = "CANCELED"; $cancelDeposit = $api->Deposits->Cancel($depositId, $cancel); print_r($cancelDeposit); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.enumerations.PaymentStatus; import com.mangopay.entities.CardPreAuthorization; public class CancelPreauthorization { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); CardPreAuthorization preauthorization = mangopay.getCardPreAuthorizationApi().get("preauth_m_01J1Z336RKEZ0MF2YR26JPZCC5"); preauthorization.setPaymentStatus(PaymentStatus.CANCELED); CardPreAuthorization cancelPreauthorization = mangopay.getCardPreAuthorizationApi().update(preauthorization); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(cancelPreauthorization); System.out.println(prettyJson); } } ``` ```python Python 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 Deposit deposit_preauthorization = Deposit( id = '5ac7a986-cf01-47f0-a882-8b0928ae5458', payment_status = 'CANCELED' ) cancel_deposit_preauthorization = deposit_preauthorization.save() pprint(cancel_deposit_preauthorization) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var depositId = "deposit_m_01J333VFZYAYF6QTZ4Q5ENA9F9"; var cancelDeposit = await api.Deposits.CancelAsync(depositId); string prettyPrint = JsonConvert.SerializeObject(cancelDeposit, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a Deposit Preauthorization POST /v2.01/{ClientId}/deposit-preauthorizations/card/direct ### Body parameters The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **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 funds. 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`). The unique identifier of the Card object, obtained during the card registration process. **Allowed values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Allowed values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Responses *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 { "Id": "524a7e9c-cad9-4df7-9fe3-03b8948930fe", "CreationDate": 1669137219, "ExpirationDate": 1671729219, "AuthorId": "156671912", "DebitedFunds": { "Currency": "EUR", "Amount": 500 }, "Status": "CREATED", "PaymentStatus": "WAITING", "PayinsLinked": { "PayinCaptureId": null, "PayinComplementId": null }, "ResultCode": null, "ResultMessage": null, "CardId": "156674899", "PreferredCardNetwork": null, "SecureModeReturnURL": "https://docs.mangopay.com/please-ignore?depositId=524a7e9c-cad9-4df7-9fe3-03b8948930fe", "SecureModeRedirectURL": "https://api.sandbox.mangopay.com/deposit-preauthorizations/Acs/Redirect?secureSessionToken=8bf75b26-01c1-4745-8f82-727e8a047dcb", "SecureModeNeeded": true, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": "EN", "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": "80.236.38.245", "Billing": { "FirstName": "Joe", "LastName": "Bloggs", "Address": { "AddressLine1": null, "AddressLine2": null, "City": null, "Region": null, "PostalCode": null, "Country": null } }, "Shipping": { "FirstName": "Joe", "LastName": "Bloggs", "Address": { "AddressLine1": null, "AddressLine2": null, "City": null, "Region": null, "PostalCode": null, "Country": null } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "Tag": "Custom meta", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json REST { "AuthorId": "203063430", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "CardId": "203076791", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore", "StatementDescriptor": null, "Culture": "EN", "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": "97d6:24d6:357a:8acc:5190:606b:91a2:f60c", "Billing": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75004", "Country": "FR" } }, "Shipping": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75004", "Country": "FR" } }, "Tag": "Created using Mangopay API Postman Collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = 'user_m_01HQK25M6KVHKDV0S36JY9NRKR'; $cardId = 'card_m_01J420XC7KAW655XPP12SC28HS'; $depositPreauth = new MangoPay\CreateDeposit; $depositPreauth->AuthorId = $userId; $depositPreauth->CardId = $cardId; $depositPreauth->DebitedFunds = new Money(); $depositPreauth->DebitedFunds->Amount = 1000; $depositPreauth->DebitedFunds->Currency = 'EUR'; $depositPreauth->BrowserInfo = new BrowserInfo(); $depositPreauth->BrowserInfo->AcceptHeader = "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8"; $depositPreauth->BrowserInfo->JavaEnabled = true; $depositPreauth->BrowserInfo->Language = "en"; $depositPreauth->BrowserInfo->ColorDepth = 4; $depositPreauth->BrowserInfo->ScreenHeight = 1800; $depositPreauth->BrowserInfo->ScreenWidth = 400; $depositPreauth->BrowserInfo->TimeZoneOffset = 60; $depositPreauth->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"; $depositPreauth->BrowserInfo->JavascriptEnabled = true; $depositPreauth->IpAddress = "192.158.1.38"; $depositPreauth->Culture = "FR"; $depositPreauth->SecureModeReturnURL = "https://docs.mangopay.com/please-ignore"; $createDepositPreauth = $api->Deposits->Create($depositPreauth); print_r($createDepositPreauth); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CultureCode; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.entities.Deposit; import com.mangopay.entities.subentities.BrowserInfo; import com.mangopay.entities.subentities.CreateDeposit; public class CreateDepositPreauth { 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_01HY0MA4E2WQ0NRYQJP8X8SXMB"; CreateDeposit deposit = new CreateDeposit(); deposit.setAuthorId(userId); deposit.setCardId(cardId); deposit.setDebitedFunds(new Money(CurrencyIso.EUR, 1000)); deposit.setSecureModeReturnUrl("https://mangopay.com/docs/please-ignore"); deposit.setCulture(CultureCode.EN); deposit.setIpAddress("192.158.1.38"); deposit.setBrowserInfo(new BrowserInfo()); deposit.getBrowserInfo().setAcceptHeader("text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8"); deposit.getBrowserInfo().setJavaEnabled(true); deposit.getBrowserInfo().setLanguage("EN"); deposit.getBrowserInfo().setColorDepth(4); deposit.getBrowserInfo().setScreenHeight(1800); deposit.getBrowserInfo().setScreenWidth(400); deposit.getBrowserInfo().setTimeZoneOffset("60"); deposit.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"); deposit.getBrowserInfo().setJavascriptEnabled(true); Deposit createDeposit = mangopay.getDepositApi().create(deposit, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createDeposit); System.out.println(prettyJson); } } ``` ```python Python 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, Deposit from mangopay.utils import Money, BrowserInfo natural_user = NaturalUser.get('213753890') deposit_preauthorization = Deposit( author_id = natural_user.id, debited_funds = Money(amount=3000, currency='EUR'), card_id = '213944219', secure_mode_return_url = 'https://mangopay.com/docs/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', tag = 'Created using the Mangopay Python SDK' ) create_deposit_preauthorization = deposit_preauthorization.save() pprint(create_deposit_preauthorization) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var cardId = "card_m_01J3049JBA2XPA7GC7GEFJRQG4"; var deposit = new DepositPostDTO ( userId, new Money { Amount = 2000, Currency = CurrencyIso.EUR }, cardId, "http://www.mangopay.com/docs/please-ignore", "2001:0620:0000:0000:0211:24FF:FE80:C12C", 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" } ) { 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 } }, Tag = "Created using the Mangopay .NET SDK" }; var createDepositPreauthorization = await api.Deposits.CreateAsync(deposit); string prettyPrint = JsonConvert.SerializeObject(createDepositPreauthorization, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a Deposit Preauthorized PayIn complement POST /v2.01/{ClientId}/payins/deposit-preauthorized/direct/complement This endpoint allows you to make an additional capture linked to a deposit preauthorization in the following cases: * After using the Create a Deposit Preauthorized PayIn prior to complement endpoint to capture the preauthorized funds. You can use this endpoint once the `PaymentStatus` is `TO_BE_COMPLETED`. * After using the Cancel a Deposit Preauthorization or request a no-show endpoint to set the Deposit object’s `PaymentStatus` to `NO_SHOW_REQUESTED`. You can use this endpoint once the `PaymentStatus` is `NO_SHOW`. ### Body parameters The unique identifier of the user at the source of the transaction. The unique identifier of the credited wallet. Information about the debited funds. **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 funds. 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`). Information about the fees. **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 fees. 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`). The unique identifier of the deposit preauthorization. *Max. length: 255 characters* Custom data that you can add to this object.\ For preauthorizations, you can use this parameter to identify corresponding information regarding the user or transaction on your platform. ### Responses The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. The unique identifier of the credited wallet. The unique identifier of the deposit preauthorization. The unique identifier of the object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the debited funds. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 funds. 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`). Information about the fees. **Returned 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 fees. 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`). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. ```json { "Message": "Deposit mode is not compatible with Complement.", "Type": "invalid_action", "Id": "c47da3ff-e846-4a5f-abf0-47a0d0ce8704", "Date": 1699263277.0, "errors": null } ``` ```json 200 { "AuthorId": "203063430", "CreditedUserId": "203063430", "CreditedWalletId": "203063456", "DepositId": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "Id": "0c267115-230a-4333-bcc1-2edac84c8224", "CreationDate": 1695114758, "ResultCode": "000000", "ResultMessage": "Success", "Status": "SUCCEEDED", "ExecutionDate": 1695114759, "Type": "PAYIN", "Nature": "REGULAR", "PaymentType": "PREAUTHORIZED", "ExecutionType": "DIRECT", "DebitedFunds": { "Currency": "EUR", "Amount": 10000 }, "CreditedFunds": { "Currency": "EUR", "Amount": 9000 }, "Fees": { "Currency": "EUR", "Amount": 1000 }, "Tag": "Created using Mangopay API Postman Collection", "StatementDescriptor": null } ``` ```json REST { "AuthorId": "203063430", "CreditedWalletId": "203063456", "DebitedFunds": { "Currency": "EUR", "Amount": 10000 }, "Fees": { "Currency": "EUR", "Amount": 1000 }, "DepositId": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "Tag": "Created using Mangopay API Postman Collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = 'user_m_01HQK25M6KVHKDV0S36JY9NRKR'; $cardId = 'card_m_01HT2C9KB8A6NZCN2X4PRMHHRX'; $walletId = 'wlt_m_01HQT6422EER2N7FPRXWTSDCSV'; $depositId = 'deposit_m_01HT2F0KX72D4JE70T4RQRT9XN'; $depositPayIn = new CreateCardPreAuthorizedDepositPayIn(); $depositPayIn->AuthorId = $userId; $depositPayIn->DepositId = $depositId; $depositPayIn->CreditedWalletId = $walletId; $depositPayIn->DebitedFunds = new Money(); $depositPayIn->DebitedFunds->Amount = 1000; $depositPayIn->DebitedFunds->Currency = 'EUR'; $depositPayIn->Fees = new Money(); $depositPayIn->Fees->Amount = 0; $depositPayIn->Fees->Currency = 'EUR'; $createPayIn = $api->PayIns->CreateCardPreAuthorizedDepositPayIn($depositPayIn); print_r($createPayIn); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java 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.CardPreAuthorizedDepositPayIn; import com.mangopay.entities.subentities.CreateCardPreAuthorizedDepositPayIn; public class CreateDepositPreauthPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; var walletId = "wlt_m_01HTF5S9MG0XXBZ8A0550MED3Z"; var depositId = "deposit_m_01J21R19BR04YQ9XTPH7860BFV"; CreateCardPreAuthorizedDepositPayIn payin = new CreateCardPreAuthorizedDepositPayIn(); payin.setAuthorId(userId); payin.setCreditedWalletId(walletId); payin.setDebitedFunds(new Money(CurrencyIso.EUR, 1000)); payin.setFees(new Money(CurrencyIso.EUR, 1000)); payin.setDepositId(depositId); payin.setTag("Created using the Mangopay Java SDK"); CardPreAuthorizedDepositPayIn createPayin = mangopay.getPayInApi().createCardPreAuthorizedDepositPayIn(payin, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayin); System.out.println(prettyJson); } } ``` ```python Python 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, CardPreAuthorizedDepositPayIn from mangopay.utils import Money natural_user = NaturalUser.get('213753890') preauthorized_deposit_payin = CardPreAuthorizedDepositPayIn( author_id = natural_user.id, credited_wallet_id = '213754077', deposit_id = '3766b5f6-717b-4863-b0e9-aab4d174ad88', debited_funds = Money(amount=10, currency='EUR'), fees = Money(amount=0, currency='EUR'), tag='Created using the Mangopay Python SDK' ) create_preauthorized_deposit_payin = preauthorized_deposit_payin.save() pprint(create_preauthorized_deposit_payin) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var depositId = "deposit_m_01J332W8CHP62NYWXTQFHSQ6SR"; var depositPayIn = new CardPreAuthorizedDepositPayInPostDTO ( walletId, new Money { Amount = 1200, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, depositId ) { Tag = "Created using the Mangopay .NET SDK" }; var createDepositPayIn = await api.PayIns.CreateCardPreAuthorizedDepositPayIn(depositPayIn); string prettyPrint = JsonConvert.SerializeObject(createDepositPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a Deposit Preauthorized PayIn prior to complement POST /v2.01/{ClientId}/payins/deposit-preauthorized/direct/capture-with-complement This endpoint allows you to capture the preauthorized funds without closing the preauthorization deposit object. It can be used prior to capturing additional funds with the Create a Deposit Preauthorized PayIn complement endpoint. **Note – Pay-in prior to complement must be full capture** The pay-in requested on this endpoint (prior to complement) must be a full capture of the preauthorized amount - it can’t be partial. ### Body parameters The unique identifier of the user at the source of the transaction. The unique identifier of the credited wallet. Information about the debited funds. **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 funds. 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`). Information about the fees. **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 fees. 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`). The unique identifier of the deposit preauthorization. *Max. length: 255 characters* Custom data that you can add to this object.\ For preauthorizations, you can use this parameter to identify corresponding information regarding the user or transaction on your platform. ### Responses The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. The unique identifier of the credited wallet. The unique identifier of the deposit preauthorization. The unique identifier of the object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the debited funds. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 funds. 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`). Information about the fees. **Returned 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 fees. 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`). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. ```json { "Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.", "Type": "param_error", "Id": "c15a0451-5f23-46b9-b6ec-74f3a74f18c6", "Date": 1699263395, "errors": { "DebitedFunds": "The value should be equal to 20000" } } ``` ```json { "Message": "The deposit is not in the PreAuthorized status.", "Type": "invalid_action", "Id": "bc763733-37ca-4eb9-88bb-0829194652db", "Date": 1695118133, "errors": null } ``` ```json 200 - Succeeded { "AuthorId": "203063430", "CreditedUserId": "203063430", "CreditedWalletId": "203063456", "DepositId": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "Id": "265d22b6-a3dc-48a4-a685-8655e5bcac6f", "CreationDate": 1695114697, "ResultCode": "000000", "ResultMessage": "Success", "Status": "SUCCEEDED", "ExecutionDate": 1695114698, "Type": "PAYIN", "Nature": "REGULAR", "PaymentType": "PREAUTHORIZED", "ExecutionType": "DIRECT", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "CreditedFunds": { "Currency": "EUR", "Amount": 19000 }, "Fees": { "Currency": "EUR", "Amount": 1000 }, "Tag": "Created using Mangopay API Postman Collection" } ``` ```json REST { "AuthorId": "203063430", "CreditedWalletId": "203063456", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "Fees": { "Currency": "EUR", "Amount": 1000 }, "DepositId": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "Tag": "Created using Mangopay API Postman Collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = 'user_m_01HQK25M6KVHKDV0S36JY9NRKR'; $cardId = 'card_m_01HT2C9KB8A6NZCN2X4PRMHHRX'; $walletId = 'wlt_m_01HQT6422EER2N7FPRXWTSDCSV'; $depositId = 'deposit_m_01HT2F0KX72D4JE70T4RQRT9XN'; $depositPayIn = new CreateCardPreAuthorizedDepositPayIn(); $depositPayIn->AuthorId = $userId; $depositPayIn->DepositId = $depositId; $depositPayIn->CreditedWalletId = $walletId; $depositPayIn->DebitedFunds = new Money(); $depositPayIn->DebitedFunds->Amount = 1000; $depositPayIn->DebitedFunds->Currency = 'EUR'; $depositPayIn->Fees = new Money(); $depositPayIn->Fees->Amount = 0; $depositPayIn->Fees->Currency = 'EUR'; $createPayIn = $api->PayIns->CreateCardPreAuthorizedDepositPayIn($depositPayIn); print_r($createPayIn); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java 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.CardPreAuthorizedDepositPayIn; import com.mangopay.entities.subentities.CreateCardPreAuthorizedDepositPayIn; public class CreateDepositPreauthPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; var walletId = "wlt_m_01HTF5S9MG0XXBZ8A0550MED3Z"; var depositId = "deposit_m_01J21R19BR04YQ9XTPH7860BFV"; CreateCardPreAuthorizedDepositPayIn payin = new CreateCardPreAuthorizedDepositPayIn(); payin.setAuthorId(userId); payin.setCreditedWalletId(walletId); payin.setDebitedFunds(new Money(CurrencyIso.EUR, 1000)); payin.setFees(new Money(CurrencyIso.EUR, 1000)); payin.setDepositId(depositId); payin.setTag("Created using the Mangopay Java SDK"); CardPreAuthorizedDepositPayIn createPayin = mangopay.getPayInApi().createCardPreAuthorizedDepositPayIn(payin, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayin); System.out.println(prettyJson); } } ``` ```python Python 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, CardPreAuthorizedDepositPayIn from mangopay.utils import Money natural_user = NaturalUser.get('213753890') preauthorized_deposit_payin = CardPreAuthorizedDepositPayIn( author_id = natural_user.id, credited_wallet_id = '213754077', deposit_id = '3766b5f6-717b-4863-b0e9-aab4d174ad88', debited_funds = Money(amount=10, currency='EUR'), fees = Money(amount=0, currency='EUR'), tag='Created using the Mangopay Python SDK' ) create_preauthorized_deposit_payin = preauthorized_deposit_payin.save() pprint(create_preauthorized_deposit_payin) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var depositId = "deposit_m_01J332W8CHP62NYWXTQFHSQ6SR"; var depositPayIn = new CardPreAuthorizedDepositPayInPostDTO ( walletId, new Money { Amount = 1200, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, depositId ) { Tag = "Created using the Mangopay .NET SDK" }; var createDepositPayIn = await api.PayIns.CreateCardPreAuthorizedDepositPayIn(depositPayIn); string prettyPrint = JsonConvert.SerializeObject(createDepositPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a Deposit Preauthorized PayIn without complement POST /v2.01/{ClientId}/payins/deposit-preauthorized/direct/full-capture ### Body parameters The unique identifier of the user at the source of the transaction. The unique identifier of the credited wallet. The unique identifier of the deposit preauthorization. Information about the debited funds. **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 funds. 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`). Information about the fees. **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 fees. 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`). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ### Responses **Default values:** The `AuthorId` of the Deposit Preauthorization object. **Returned values:** The `AuthorId` of the Deposit Preauthorization object. The unique identifier of the user at the source of the transaction. On the Deposit Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Deposit Preauthorization object, regardless of the value sent. **Default value:** The `AuthorId` of the Deposit Preauthorization object. The unique identifier of the user whose wallet is credited. On the Deposit Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Deposit Preauthorization object, regardless of the value sent. The unique identifier of the credited wallet. The unique identifier of the deposit preauthorization. The unique identifier of the object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the debited funds. **Returned 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 funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 funds. 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`). Information about the fees. **Returned 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 fees. 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`). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ```json { "Message": "CreditedUserExternalId:204069570 must be Equal to authorId:204068024.", "Type": "invalid_action", "Id": "42ba6af2-75ba-4d2b-92e9-b72650db3787", "Date": 1696492277, "errors": null } ``` ```json 200 { "AuthorId": "156671912", "CreditedUserId": "156671912", "CreditedWalletId": "154851912", "DepositId": "524a7e9c-cad9-4df7-9fe3-03b8948930fe", "Id": "1719d157-5a97-4af3-91b0-7d660b34b21c", "CreationDate": 1669137480, "ResultCode": "000000", "ResultMessage": "Success", "Status": "SUCCEEDED", "ExecutionDate": 1669137481, "Type": "PAYIN", "Nature": "REGULAR", "PaymentType": "PREAUTHORIZED", "ExecutionType": "DIRECT", "DebitedFunds": { "Currency": "EUR", "Amount": 500 }, "CreditedFunds": { "Currency": "EUR", "Amount": 500 }, "Fees": { "Currency": "EUR", "Amount": 0 }, "Tag": "custom meta" } ``` ```json REST { "AuthorId": "203063430", "CreditedWalletId": "203063456", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "Fees": { "Currency": "EUR", "Amount": 1000 }, "DepositId": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "Tag": "Created using Mangopay API Postman Collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $userId = 'user_m_01HQK25M6KVHKDV0S36JY9NRKR'; $cardId = 'card_m_01HT2C9KB8A6NZCN2X4PRMHHRX'; $walletId = 'wlt_m_01HQT6422EER2N7FPRXWTSDCSV'; $depositId = 'deposit_m_01HT2F0KX72D4JE70T4RQRT9XN'; $depositPayIn = new CreateCardPreAuthorizedDepositPayIn(); $depositPayIn->AuthorId = $userId; $depositPayIn->DepositId = $depositId; $depositPayIn->CreditedWalletId = $walletId; $depositPayIn->DebitedFunds = new Money(); $depositPayIn->DebitedFunds->Amount = 1000; $depositPayIn->DebitedFunds->Currency = 'EUR'; $depositPayIn->Fees = new Money(); $depositPayIn->Fees->Amount = 0; $depositPayIn->Fees->Currency = 'EUR'; $createPayIn = $api->PayIns->CreateCardPreAuthorizedDepositPayIn($depositPayIn); print_r($createPayIn); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java 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.CardPreAuthorizedDepositPayIn; import com.mangopay.entities.subentities.CreateCardPreAuthorizedDepositPayIn; public class CreateDepositPreauthPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; var walletId = "wlt_m_01HTF5S9MG0XXBZ8A0550MED3Z"; var depositId = "deposit_m_01J21R19BR04YQ9XTPH7860BFV"; CreateCardPreAuthorizedDepositPayIn payin = new CreateCardPreAuthorizedDepositPayIn(); payin.setAuthorId(userId); payin.setCreditedWalletId(walletId); payin.setDebitedFunds(new Money(CurrencyIso.EUR, 1000)); payin.setFees(new Money(CurrencyIso.EUR, 1000)); payin.setDepositId(depositId); payin.setTag("Created using the Mangopay Java SDK"); CardPreAuthorizedDepositPayIn createPayin = mangopay.getPayInApi().createCardPreAuthorizedDepositPayIn(payin, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayin); System.out.println(prettyJson); } } ``` ```python Python 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, CardPreAuthorizedDepositPayIn from mangopay.utils import Money natural_user = NaturalUser.get('213753890') preauthorized_deposit_payin = CardPreAuthorizedDepositPayIn( author_id = natural_user.id, credited_wallet_id = '213754077', deposit_id = '3766b5f6-717b-4863-b0e9-aab4d174ad88', debited_funds = Money(amount=10, currency='EUR'), fees = Money(amount=0, currency='EUR'), tag='Created using the Mangopay Python SDK' ) create_preauthorized_deposit_payin = preauthorized_deposit_payin.save() pprint(create_preauthorized_deposit_payin) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities.PUT; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var depositId = "deposit_m_01J332W8CHP62NYWXTQFHSQ6SR"; var depositPayIn = new CardPreAuthorizedDepositPayInPostDTO ( walletId, new Money { Amount = 1200, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, depositId ) { Tag = "Created using the Mangopay .NET SDK" }; var createDepositPayIn = await api.PayIns.CreateCardPreAuthorizedDepositPayIn(depositPayIn); string prettyPrint = JsonConvert.SerializeObject(createDepositPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Deposit Preauthorization object ### Description The Deposit Preauthorization object enables you to reserve funds on a card so they can be captured later. A deposit preauthorization thus has two parts: * Authorization of the transaction, handled by the Deposit Preauthorization object * Capture of the funds, handled by the Deposit Preauthorized PayIn object The preauthorized funds can be captured within 29.5 days of a successful authorization. Note that preauthorizations may not be permitted by some issuers and for some card types. The Deposit Preauthorization feature also allows you to charge a complement against it, either on top of the preauthorized amount or instead of it (by declaring a no-show). **Caution – Multi-capture not possible with the Deposit Preauthorization** A maximum of two captures are possible against a Deposit Preauthorization: (i) the initial pay-in to capture the preauthorized amount, and/or (ii) a pay-in complement to capture an additional amount. Multiple partial captures are not possible with the Deposit Preauthorization like they are with the Preauthorization object. ### Attributes *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object. Information about the card used for the transaction. \ If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Related resources Learn more about 30-day preauthorization # The Deposit Preauthorized PayIn object ### Description The Deposit Preauthorized PayIn object represents a request to capture funds previously authorized with a Deposit Preauthorization object.  The preauthorized pay-in must be: * Of an amount equal to or less than the preauthorized amount * Done within 30 days of a successful authorization ### Attributes The unique identifier of the user at the source of the transaction. **Default value:** The `AuthorId` of the Deposit Preauthorization object. The unique identifier of the user whose wallet is credited. On the Deposit Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Deposit Preauthorization object, regardless of the value sent. The unique identifier of the deposit preauthorization. The unique identifier of the object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). *Max. length: 255 characters* Custom data that you can add to this object. # List Deposit Preauthorizations for a Card GET /v2.01/{ClientId}/cards/{CardId}/deposit-preauthorizations ### Query parameters The code indicating the result of the operation. You can filter on multiple values by separating them with a comma. **Allowed values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. You can filter on multiple values by separating them with a comma. **Allowed values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. ### Responses List of deposit preauthorizations created by the platform. The deposit preauthorization created by the platform. *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `KLARNA` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: CS, DA, DE, EL, EN, ES, FI, FR, HU, IT, NL, NO, PL, PT, SK, SV. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **Default value:** FirstName, LastName, and Address information of the Shipping object if supplied. Information about the end user's billing address. If left empty, the default values will be automatically taken into account. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. Information about the end user’s shipping address. If left empty, the default values will be automatically taken into account. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For preauthorizations, you can use this parameter to identify corresponding information regarding the user or transaction on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 [ { "Id": "78e82d95-bf01-4633-84d9-f433e1130eba", "CreationDate": 1696256380, "ExpirationDate": 1698848380, "AuthorizationDate": 1696256388, "AuthorId": "204068024", "DebitedFunds": { "Currency": "EUR", "Amount": 22223 }, "Status": "SUCCEEDED", "PaymentStatus": "CANCELED", "PayinsLinked": { "PayinCaptureId": null, "PayinComplementId": null }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "204068248", "PreferredCardNetwork": null, "SecureModeReturnURL": null, "SecureModeRedirectURL": null, "SecureModeNeeded": null, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": null, "BrowserInfo": null, "IpAddress": null, "Billing": null, "Shipping": null, "Requested3DSVersion": null, "Applied3DSVersion": null, "Tag": "Created using Mangopay API Postman Collection", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ] ``` # List Deposit Preauthorizations for a User GET /v2.01/{ClientId}/users/{UserId}/deposit-preauthorizations ### Query parameters The code indicating the result of the operation. You can filter on multiple values by separating them with a comma. **Allowed values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. You can filter on multiple values by separating them with a comma. **Allowed values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. ### Responses List of deposit preauthorizations created by the platform. The deposit preauthorization created by the platform. *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. The unique identifier of the user at the source of the transaction. Information about the debited funds. **Returned 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 debited funds (the sell currency). 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`). During a conversion, (`DebitedFunds.Amount` - `Fees`) \* `MarketRate` = `CreditedFunds.Amount`.  **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, which is returned after updating the Card Registration object with the `RegistrationData`. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `KLARNA` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: CS, DA, DE, EL, EN, ES, FI, FR, HU, IT, NL, NO, PL, PT, SK, SV. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **Default value:** FirstName, LastName, and Address information of the Shipping object if supplied. Information about the end user's billing address. If left empty, the default values will be automatically taken into account. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. Information about the end user’s shipping address. If left empty, the default values will be automatically taken into account. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For preauthorizations, you can use this parameter to identify corresponding information regarding the user or transaction on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 [ { "Id": "748bfd3c-96f0-4475-949b-3aedfa3bdcfc", "CreationDate": 1696255231, "ExpirationDate": 1698847231, "AuthorizationDate": 1696255242, "AuthorId": "204068024", "DebitedFunds": { "Currency": "EUR", "Amount": 22220 }, "Status": "SUCCEEDED", "PaymentStatus": "CANCELED", "PayinsLinked": { "PayinCaptureId": null, "PayinComplementId": null }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "204068248", "PreferredCardNetwork": null, "SecureModeReturnURL": null, "SecureModeRedirectURL": null, "SecureModeNeeded": null, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": null, "BrowserInfo": null, "IpAddress": null, "Billing": null, "Shipping": null, "Requested3DSVersion": null, "Applied3DSVersion": null, "Tag": "Created using Mangopay API Postman Collection", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ] ``` # View a Deposit Preauthorization GET /v2.01/{ClientId}/deposit-preauthorizations/{DepositId} ### Path parameters The unique identifier of the deposit preauthorization. ### Responses *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 preauthorized funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 preauthorized funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For preauthorizations, you can use this parameter to identify corresponding information regarding the user or transaction on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 preauthorized funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object.\ For preauthorizations, you can use this parameter to identify corresponding information regarding the user or transaction on your platform. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. *Max. length: 255 characters* The date and time at which the object was created. The date and time at which the hold period ends and the preauthorized funds are released.\ At the expiration date, the deposit preauthorization’s `PaymentStatus` changes to `EXPIRED` if no captures were made. The date and time at which successful authorization occurred. If authorization failed, the value is `null`. The unique identifier of the user at the source of the transaction. Information about the preauthorized funds. **Returned 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 preauthorized funds. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the authorization. **Returned values:** `WAITING`, `CANCELED`, `CANCEL_REQUESTED`, `EXPIRED`, `TO_BE_COMPLETED`, `NO_SHOW_REQUESTED`, `NO_SHOW`, `VALIDATED`, `FAILED` The payment status of the deposit preauthorization object: * `WAITING` – The deposit preauthorization can be used: the preauthorized funds can be captured (without or prior to complement); a no-show can be declared; or the preauthorization can be canceled manually. * `CANCELED` – Value to pass to manually cancel the deposit preauthorization before use (whether for capture or no-show); indicates that the deposit preauthorization was canceled manually. * `CANCEL_REQUESTED` – The cancellation of the deposit preauthorization has been requested but not yet processed. * `EXPIRED` – The hold period on the preauthorized funds has ended without it being used (whether for capture or no-show). * `TO_BE_COMPLETED` – The preauthorized funds were captured (prior to complement) but the complement has not yet been captured. * `NO_SHOW_REQUESTED` – Value to pass to request a no-show, signaling no capture of the preauthorized funds but the intent to capture a complement. * `NO_SHOW` – A no-show was requested but a complement not yet been captured. * `VALIDATED` – Indicates either (i) that the preauthorized funds were captured without complement; (ii) that the preauthorized funds and a complement were captured; or (iii) that a no-show was declared and a complement was captured. * `FAILED` – The action against the preauthorization has failed (whether capture without complement, capture prior to complement, no-show request, complement), but a retry may be possible. Information about the deposit preauthorized pay-ins made against the deposit preauthorization. The unique identifier of the preauthorized pay-in (capture) made against the deposit preauthorization to debit the preauthorized funds. The unique identifier of the deposit preauthorized pay-in complement made against the deposit preauthorization to debit additional funds. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The unique identifier of the Card object, obtained during the card registration process. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. *Max. length: 255 characters* Custom data that you can add to this object. Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 - Capture without complement { "Id": "524a7e9c-cad9-4df7-9fe3-03b8948930fe", "CreationDate": 1669137219, "ExpirationDate": 1671729219, "AuthorizationDate": 1669137235, "AuthorId": "156671912", "DebitedFunds": { "Currency": "EUR", "Amount": 1000 }, "Status": "SUCCEEDED", "PaymentStatus": "VALIDATED", "PayinsLinked": { "PayinCaptureId": "1719d157-5a97-4af3-91b0-7d660b34b21c", "PayinComplementId": null }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "156674899", "PreferredCardNetwork": null, "SecureModeReturnURL": "https://docs.mangopay.com/please-ignore?depositId=524a7e9c-cad9-4df7-9fe3-03b8948930fe", "SecureModeRedirectURL": "https://api.sandbox.mangopay.com/deposit-preauthorizations/Acs/Redirect?secureSessionToken=8bf75b26-01c1-4745-8f82-727e8a047dcb", "SecureModeNeeded": true, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": "EN", "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": "80.236.38.245", "Billing": { "FirstName": "Joe", "LastName": "Bloggs", "Address": { "AddressLine1": null, "AddressLine2": null, "City": null, "Region": null, "PostalCode": null, "Country": null } }, "Shipping": { "FirstName": "Joe", "LastName": "Bloggs", "Address": { "AddressLine1": null, "AddressLine2": null, "City": null, "Region": null, "PostalCode": null, "Country": null } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "Tag":"Custom meta", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json 200 - Capture made prior to complement { "Id": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "CreationDate": 1695114673, "ExpirationDate": 1697706673, "AuthorizationDate": 1695114682, "AuthorId": "203063430", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "Status": "SUCCEEDED", "PaymentStatus": "TO_BE_COMPLETED", "PayinsLinked": { "PayinCaptureId": "265d22b6-a3dc-48a4-a685-8655e5bcac6f", "PayinComplementId": null }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "203076791", "PreferredCardNetwork": null, "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore?depositId=09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "SecureModeRedirectURL": "https://api.sandbox.mangopay.com/deposit-preauthorizations/Acs/Redirect?secureSessionToken=fb86b917-c81a-47a0-83bc-a737b2199819", "SecureModeNeeded": true, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": "EN", "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": "97d6:24d6:357a:8acc:5190:606b:91a2:f60c", "Billing": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75004", "Country": "FR" } }, "Shipping": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75004", "Country": "FR" } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "Tag": "Created using Mangopay API Postman Collection", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json 200 - Capture and complement made { "Id": "09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "CreationDate": 1695114673, "ExpirationDate": 1697706673, "AuthorizationDate": 1695114682, "AuthorId": "203063430", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "Status": "SUCCEEDED", "PaymentStatus": "VALIDATED", "PayinsLinked": { "PayinCaptureId": "265d22b6-a3dc-48a4-a685-8655e5bcac6f", "PayinComplementId": "0c267115-230a-4333-bcc1-2edac84c8224" }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "203076791", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore?depositId=09d21294-f9ac-4797-b2b9-8cc7b4f05f1d", "SecureModeRedirectURL": "https://api.sandbox.mangopay.com/deposit-preauthorizations/Acs/Redirect?secureSessionToken=fb86b917-c81a-47a0-83bc-a737b2199819", "SecureModeNeeded": true, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": "EN", "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": "97d6:24d6:357a:8acc:5190:606b:91a2:f60c", "Billing": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75004", "Country": "FR" } }, "Shipping": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75004", "Country": "FR" } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "Tag": "Created using Mangopay API Postman Collection", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json 200 - No-show declared and complement made { "Id": "4f6e5390-48f1-4a04-abd1-ede66da94466", "CreationDate": 1695115172, "ExpirationDate": 1697707172, "AuthorizationDate": 1695115194, "AuthorId": "203063430", "DebitedFunds": { "Currency": "EUR", "Amount": 20000 }, "Status": "SUCCEEDED", "PaymentStatus": "VALIDATED", "PayinsLinked": { "PayinCaptureId": null, "PayinComplementId": "7c89d633-2023-440c-843a-ac8ce2a683a4" }, "ResultCode": "000000", "ResultMessage": "Success", "CardId": "203076791", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore?depositId=4f6e5390-48f1-4a04-abd1-ede66da94466", "SecureModeRedirectURL": "https://api.sandbox.mangopay.com/deposit-preauthorizations/Acs/Redirect?secureSessionToken=48c40631-31de-40d6-bbac-3a59d0ae7e5b", "SecureModeNeeded": true, "PaymentType": "CARD", "ExecutionType": "DIRECT", "StatementDescriptor": null, "Culture": "EN", "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": "1e34:f7f8:c8c8:fb03:b603:7479:abcd:65c8", "Billing": { "FirstName": "Nels", "LastName": "Littel", "Address": { "AddressLine1": "9675 Gussie Crescent", "AddressLine2": "Mortimer Shores", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75001", "Country": "FR" } }, "Shipping": { "FirstName": "Nels", "LastName": "Littel", "Address": { "AddressLine1": "9675 Gussie Crescent", "AddressLine2": "Mortimer Shores", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75001", "Country": "FR" } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "Tag": "Created using Mangopay API Postman Collection", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $depositId = 'deposit_m_01JH3BWB8K89TDQC54FFZY6MFV'; $response = $api->Deposits->Get($depositId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Deposit; public class ViewDepositPreauth { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); Deposit getDeposit = mangopay.getDepositApi().cancel("deposit_m_01J21RMN7TET5VNNJJQTMYEX8Z"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(getDeposit); System.out.println(prettyJson); } } ``` ```python Python 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 Deposit deposit_preauthorization = Deposit( id = '11057b51-7bfc-43e9-bdec-268ba41148cc' ) try: view_deposit_preauthorization = Deposit.get(deposit_preauthorization.id) pprint(vars(view_deposit_preauthorization)) pprint(vars(view_deposit_preauthorization.billing)) pprint(vars(view_deposit_preauthorization.browser_info)) pprint(vars(view_deposit_preauthorization.payins_linked)) pprint(vars(view_deposit_preauthorization.shipping)) except Deposit.DoesNotExist: print('The Deposit PreAuthorization {} does not exist'.format(deposit_preauthorization.id)) ``` ```csharp .NET using MangoPay.SDK; 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 depositId = "deposit_m_01J332W8CHP62NYWXTQFHSQ6SR"; var viewDeposit = await api.Deposits.GetAsync(depositId); string prettyPrint = JsonConvert.SerializeObject(viewDeposit, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # View a PayIn (Deposit Preauthorized Card) GET /v2.01/{ClientId}/payins/{PayInId} **Note – Pay-in data retained for 13 months** An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the pay-in. ### Responses The unique identifier of the user at the source of the transaction. **Default value:** The `AuthorId` of the Deposit Preauthorization object. The unique identifier of the user whose wallet is credited. On the Deposit Preauthorized PayIn, this parameter returns the same value as the `AuthorId` of the Deposit Preauthorization object, regardless of the value sent. The unique identifier of the credited wallet. The unique identifier of the deposit preauthorization. The unique identifier of the object. The date and time at which the object was created. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. ```json 200 { "AuthorId": "204068024", "CreditedUserId": "204068024", "CreditedWalletId": "204089031", "DepositId": "bda62a05-2d3d-4cd8-8763-53d8dffdab49", "Id": "b45fb6f7-75d4-4757-a8e5-6fe46d9edde2", "CreationDate": 1696583378, "ResultCode": "000000", "ResultMessage": "Success", "Status": "SUCCEEDED", "ExecutionDate": 1696583379, "Type": "PAYIN", "Nature": "REGULAR", "PaymentType": "PREAUTHORIZED", "ExecutionType": "DIRECT", "DebitedFunds": { "Currency": "EUR", "Amount": 10000 }, "CreditedFunds": { "Currency": "EUR", "Amount": 9000 }, "Fees": { "Currency": "EUR", "Amount": 1000 }, "Tag": "Created using Mangopay API Postman Collection" } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payinId = 'payin_m_01HYG8DRT5FHT1FV44MV9KR1BS'; $response = $api->PayIns->Get($payinId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myPayIn = { Id: '156279887', } const viewPayIn = async (payinId) => { return await mangopay.PayIns.get(payinId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewPayIn(myPayIn.Id) ``` ```ruby Ruby 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 viewPayIn(payinId) begin response = MangoPay::PayIn.fetch(payinId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch PayIn: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { Id: '156279887' } viewPayIn(myPayIn[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.PayIn; public class ViewPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); PayIn payin = mangopay.getPayInApi().get("your-payin-id"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(payin); System.out.println(prettyJson); } } ``` ```python Python 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 PayIn payin_id = 'wt_4fdf7754-6213-4016-be88-84587f093623' try: view_payin = PayIn.get(payin_id) pprint(view_payin._data) except PayIn.DoesNotExist: print('PayIn {} does not exist.'.format(payin_id)) ``` ```csharp .NET using MangoPay.SDK; 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 viewPayIn = await api.PayIns.GetAsync("payin_m_01J334XF2V6751GRG9M2M558HG"); string prettyPrint = JsonConvert.SerializeObject(viewPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a Direct Card PayIn POST /v2.01/{ClientId}/payins/card/direct [Read more about the Direct Card PayIn object →](/api-reference/direct-card-payins/direct-card-payin-object) ### Body parameters *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. **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 debited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **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 fees. 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`). The unique identifier of the credited wallet. **Allowed values:** `DEFAULT`, `FORCE`, `NO_CHOICE` **Default value:** `DEFAULT` 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. The unique identifier of the Card object, obtained during the card registration process. *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`). The language in which the payment page is to be displayed. *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Allowed values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. **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. The unique identifier of the Card object, obtained during the card registration process. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information regarding security and anti-fraud tools. The result of the Address Verification System check (only available for UK, US, and Canada). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The unique identifier of the recurring pay-in registration. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json { "Message": "Error: multi-currency usage is not authorized", "Type": "currency_incompatibility", "Id": "e384d310-ab19-4455-bf27-f54822361bd3", "Date": 1700045351.0, "errors": { "currency": "The card's currency GBP and the debitedAmount's currency EUR must be the same" } } ``` ```json { "Message": "Error: multi-currency usage is not authorized", "Type": "currency_incompatibility", "Id": "1f29b2ff-cf01-4185-9cfd-c0545f6cbd0c", "Date": 1700044992.0, "errors": { "currency": "The Wallet's currency GBP and the DebitedFunds's currency EUR must be the same" } } ``` ```json 200 { "Id": "209160523", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1700210889, "AuthorId": "204069570", "CreditedUserId": "204069570", "DebitedFunds": { "Currency": "EUR", "Amount": 57842 }, "CreditedFunds": { "Currency": "EUR", "Amount": 48965 }, "Fees": { "Currency": "EUR", "Amount": 8877 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYIN", "Nature": "REGULAR", "CreditedWalletId": "204069727", "DebitedWalletId": null, "PaymentType": "CARD", "ExecutionType": "DIRECT", "SecureMode": "DEFAULT", "CardId": "209160226", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore?transactionId=209160523", "SecureModeRedirectURL": "https://api.sandbox.mangopay.com:443/Redirect/ACSWithValidation?token=39265d841d7044a98e44253fbda2870c&mgpsecureid=39265d841d7044a98e44253fbda2870c", "SecureModeNeeded": true, "Culture": "EN", "SecurityInfo": { "AVSResult": "NO_CHECK" }, "StatementDescriptor": "Mangopay", "BrowserInfo": { "AcceptHeader": "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8", "JavaEnabled": true, "Language": "en", "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": "658e:1b88:7f7a:a60b:32af:0b7f:56e1:2e9a", "Billing": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75001", "Country": "FR" } }, "Shipping": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75001", "Country": "FR" } }, "Requested3DSVersion": null, "Applied3DSVersion": "V2_1", "RecurringPayinRegistrationId": null, "PreferredCardNetwork": null, "PaymentCategory": "ECommerce", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```json REST { "Tag": "Created using Mangopay API Postman Collection", "AuthorId": "204069570", "CreditedUserId": "204069570", "DebitedFunds": { "Currency": "EUR", "Amount": 57842 }, "Fees": { "Currency": "EUR", "Amount": 8877 }, "CreditedWalletId": "204069727", "SecureMode": "DEFAULT", "CardId": "209160226", "SecureModeReturnURL": "https://mangopay.com/docs/please-ignore", "StatementDescriptor": "Mangopay", "BrowserInfo": { "AcceptHeader": "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8", "JavaEnabled": true, "Language": "en", "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": "658e:1b88:7f7a:a60b:32af:0b7f:56e1:2e9a", "Billing": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75001", "Country": "FR" } }, "Shipping": { "FirstName": "Alex", "LastName": "Smith", "Address": { "AddressLine1": "6 rue de la Cité", "AddressLine2": "Appartement 3", "City": "Paris", "Region": "Ile-de-France", "PostalCode": "75001", "Country": "FR" } } } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payIn = new \MangoPay\PayIn(); $payIn->Tag = "Created using Mangopay PHP SDK"; $payIn->CreditedWalletId = "148968396"; $payIn->PaymentType = "CARD"; $payIn->AuthorId = "146476890"; $payIn->DebitedFunds = new \MangoPay\Money(); $payIn->DebitedFunds->Amount = 1000; $payIn->DebitedFunds->Currency = "EUR"; $payIn->Fees = new \MangoPay\Money(); $payIn->Fees->Amount = 10; $payIn->Fees->Currency = "EUR"; $payIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsCard(); $payIn->PaymentDetails->CardId = "169687329"; $payIn->PaymentDetails->StatementDescriptor = "Mangopay"; $payIn->PaymentDetails->IpAddress = "2001:0620:0000:0000:0211:24FF:FE80:C12C"; $payIn->PaymentDetails->BrowserInfo = new \MangoPay\BrowserInfo(); $payIn->PaymentDetails->BrowserInfo->AcceptHeader = "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8"; $payIn->PaymentDetails->BrowserInfo->JavaEnabled = true; $payIn->PaymentDetails->BrowserInfo->Language = "FR-FR"; $payIn->PaymentDetails->BrowserInfo->ColorDepth = 4; $payIn->PaymentDetails->BrowserInfo->ScreenHeight = 1800; $payIn->PaymentDetails->BrowserInfo->ScreenWidth = 400; $payIn->PaymentDetails->BrowserInfo->TimeZoneOffset = 60; $payIn->PaymentDetails->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"; $payIn->PaymentDetails->BrowserInfo->JavascriptEnabled = true; $payIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect(); $payIn->ExecutionDetails->SecureModeReturnURL = "https://mangopay.com/docs/please-ignore"; $payIn->ExecutionDetails->Culture = 'FR'; $response = $api->PayIns->Create($payIn); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myDirectCardPayIn = { PaymentType: 'CARD', ExecutionType: 'DIRECT', AuthorId: '146476890', Tag: 'Created with Mangopay Node.js SDK', CreditedUserId: '146476890', DebitedFunds: { Currency: 'EUR', Amount: 1000, }, Fees: { Currency: 'EUR', Amount: 100, }, CreditedWalletId: '148968396', CardId: '169687329', CardType: 'CB_VISA_MASTERCARD', SecureMode: 'DEFAULT', SecureModeReturnURL: 'https://mangopay.com/docs/please-ignore', 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', 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', }, }, StatementDescriptor: 'Nov2023', } const createDirectCardPayIn = async (payin) => { return await mangopay.PayIns.create(payin) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createDirectCardPayIn(myDirectCardPayIn) ``` ```ruby Ruby 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 createDirectCardPayIn(payInObject) begin response = MangoPay::PayIn::Card::Direct.create(payInObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create pay-in: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { AuthorId: '192822811', Tag: 'Created with Mangopay Ruby SDK', CreditedUserId: '192822811', DebitedFunds: { Currency: 'EUR', Amount: 1200, }, Fees: { Currency: 'EUR', Amount: 100, }, CreditedWalletId: '192822814', CardId: '192822826', CardType: 'CB_VISA_MASTERCARD', SecureMode: 'DEFAULT', SecureModeReturnURL: 'https://mangopay.com/docs/please-ignore', 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', 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', }, }, StatementDescriptor: 'Nov2023', } createDirectCardPayIn(myPayIn) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Address; import com.mangopay.core.Billing; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CountryIso; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.PayInExecutionType; import com.mangopay.core.enumerations.PayInPaymentType; import com.mangopay.core.enumerations.SecureMode; import com.mangopay.entities.PayIn; import com.mangopay.entities.subentities.BrowserInfo; import com.mangopay.entities.subentities.PayInExecutionDetailsDirect; import com.mangopay.entities.subentities.PayInPaymentDetailsCard; public class CreateDirectCardPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); String userId = "user_m_01HT2NFK7Z2BRQNGNHMY30VVTT"; String walletId = "wlt_m_01HTHTXEF4BJCTKMXNWMSZ6KP5"; String cardId = "card_m_01HY0MA4E2WQ0NRYQJP8X8SXMB"; PayIn payIn = new PayIn(); Money debitedFunds = new Money(); debitedFunds.setAmount(500); debitedFunds.setCurrency(CurrencyIso.EUR); Money fees = new Money(); fees.setAmount(0); fees.setCurrency(CurrencyIso.EUR); BrowserInfo browserInfo = new BrowserInfo(); browserInfo.setAcceptHeader("application/json,text/javascript,*/*;q=0.01<"); browserInfo.setJavaEnabled(true); browserInfo.setLanguage("fr"); browserInfo.setColorDepth(32); browserInfo.setScreenHeight(667); browserInfo.setScreenWidth(375); browserInfo.setTimeZoneOffset("-120"); browserInfo.setUserAgent("Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"); browserInfo.setJavascriptEnabled(true); Address address = new Address(); Billing billing = new Billing(); address.setAddressLine1("2795 Edgewood Road"); address.setCity("Little Rock"); address.setRegion("Arkansas"); address.setPostalCode("72212"); address.setCountry(CountryIso.FR); billing.setFirstName("Alex"); billing.setLastName("Smith"); billing.setAddress(address); PayInExecutionDetailsDirect executionDetails = new PayInExecutionDetailsDirect(); executionDetails.setBilling(billing); executionDetails.setCardId(cardId); executionDetails.setSecureModeReturnUrl("https://mangopay.com/docs/please-ignore"); executionDetails.setSecureMode(SecureMode.DEFAULT); PayInPaymentDetailsCard paymentDetails = new PayInPaymentDetailsCard(); paymentDetails.setIpAddress("658e:1b88:7f7a:a60b:32af:0b7f:56e1:2e9a"); paymentDetails.setBrowserInfo(browserInfo); payIn.setPaymentType(PayInPaymentType.CARD); payIn.setExecutionType(PayInExecutionType.DIRECT); payIn.setAuthorId(userId); payIn.setDebitedFunds(debitedFunds); payIn.setFees(fees); payIn.setCreditedWalletId(walletId); payIn.setExecutionDetails(executionDetails); payIn.setPaymentDetails(paymentDetails); PayIn createPayIn = mangopay.getPayInApi().create(payIn); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayIn); System.out.println(prettyJson); } } ``` ```python Python 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, LegalUser, Wallet, Card, DirectPayIn from mangopay.utils import Money, BrowserInfo legal_user = LegalUser.get('211918806') legal_user_wallet = Wallet.get('214564765') natural_user = NaturalUser.get('213753890') natural_user_card= Card.get('213944219') direct_payin = DirectPayIn( author = natural_user, debited_funds = Money(amount=1000, currency='EUR'), fees = Money(amount=1, currency='EUR'), credited_wallet_id = legal_user_wallet.id, card_id = natural_user_card, secure_mode = 'DEFAULT', secure_mode_return_url = "https://mangopay.com/docs/please-ignore", tag = 'Created with Mangopay Python SDK', 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', ) create_direct_payin = direct_payin.save() pprint(create_direct_payin) ``` ```csharp .NET using MangoPay.SDK; using MangoPay.SDK.Entities; using MangoPay.SDK.Core.Enumerations; 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 directCardPayin = new PayInCardDirectPostDTO(userId, userId, new Money { Amount = 1000, Currency = CurrencyIso.EUR }, new Money { Amount = 0, Currency = CurrencyIso.EUR }, walletId, "http://www.mangopay.com/docs/please-ignore", cardId) { CardType = CardType.CB_VISA_MASTERCARD, IpAddress = "2001:0620:0000:0000:0211:24FF:FE80:C12C", Requested3DSVersion = "V2_1", 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" }, Billing = new Billing { Address = new Address { City = "Paris", AddressLine1 = "17 Rue de la République", Country = CountryIso.FR, PostalCode = "65400" }, FirstName = "Joe", LastName = "Doe" }, Shipping = new Shipping { Address = new Address { City = "Paris", AddressLine1 = "17 Rue de la République", Country = CountryIso.FR, PostalCode = "65400" }, FirstName = "Joe", LastName = "Doe" } }; var createDirectCardPayIn = await api.PayIns.CreateCardDirectAsync(directCardPayin); string prettyPrint = JsonConvert.SerializeObject(createDirectCardPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # The Direct Card PayIn object Process a one-time payment with a `CardId`, obtained from the card registration process ### Description Mangopay relies on the Direct Card PayIn to process one-time payments with a registered card. A Direct Card PayIn requires a `CardId`, obtained from the Card Registration object, Checkout SDK, or Vault SDK. The Direct Card PayIn represents a one-time card payment. Different endpoints are required for [recurring](/api-reference/recurring-payin-registrations/create-recurring-payin-registration), [7-day preauthorized](/api-reference/preauthorizations/preauthorization-object), or [30-day preauthorized](/api-reference/deposit-preauthorizations/deposit-preauthorization-object) card payments, as well as to [validate a card without debiting it](/api-reference/card-validations/card-validation-object). **Best practice – Pay-in to the author’s wallet** Funds should be credited in two steps: 1. Pay-in to the author’s wallet. 2. Transfer to the credited user’s wallet. ### Attributes The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. **Default value:** DEFAULT 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. The unique identifier of the Card object, obtained during the card registration process. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it. Whether or not the `SecureMode` was used. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information regarding security and anti-fraud tools. The result of the Address Verification System check (only available for UK, US, and Canada). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* Required if `Country` is US, CA, or MX. The region of the address. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Allowed values:** Country code in the ISO 3166-1 alpha-2 format. The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The unique identifier of the recurring pay-in registration. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). Information about the card used for the transaction. \ If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The unique reference generated for the profiling session, used by the fraud prevention 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 via the Dashboard for more information. ### Related resources Learn how to process a card payment Simplify one-time card payments with Checkout SDK for web and mobile # View a PayIn (Direct Card) GET /v2.01/{ClientId}/payins/{PayInId} **Note – Pay-in data retained for 13 months** An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found. For more information, see the Data availability periods article. ### Path parameters The unique identifier of the pay-in. ### Responses The unique identifier of the object. *Max. length: 255 characters* Custom data that you can add to this object.\ For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform. The date and time at which the object was created. The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. Information about the debited funds. **Returned 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 debited funds. 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`). Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). **Returned 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 credited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Returned 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 fees. 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`). **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. The explanation of the result code. The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. **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. The unique identifier of the credited wallet. 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. **Returned values:** `CARD`, `DIRECT_DEBIT`, `PREAUTHORIZED`, `BANK_WIRE` The type of pay-in. **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION` The type of execution for the pay-in. **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. The unique identifier of the Card object, obtained during the card registration process. *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`). *Max. length: 255 characters* The URL to which to redirect the user to proceed to 3DS2 validation. Whether or not the `SecureMode` was used. **Returned values:** One of the supported languages in the ISO 639-1 format: DE, EN, ES, FR, IT, NL, PL, PT. The language in which the payment page is to be displayed. Information regarding security and anti-fraud tools. The result of the Address Verification System check (only available for UK, US, and Canada). *Max. length: 10 characters; only alphanumeric and spaces* Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the Customizing bank statement references article for details. Information about the browser used by the end user (author) to perform the payment. The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. Whether or not the end user’s browser has the ability to execute Java. *Max. length: 6 characters* The browser language, made up of the language code and the country (e.g., “en-US”). The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. *Max. length: 6 characters* The height of the screen in pixels. *Max. length: 6 characters* The width of the screen in pixels. The difference in minutes between the browser’s timezone and UTC. *Max. length: 255 characters* The exact content of the HTTP User-Agent header. Whether or not the end user’s browser has the ability to execute JavaScript. The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the billing address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **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. The first name of the user. *Max. length: 100 characters* The last name of the user. Information about the shipping address. *Max. length: 255 characters* The first line of the address. *Max. length: 255 characters* The second line of the address. *Max. length: 255 characters* The city of the address. *Max. length: 255 characters* The region of the address. This field is optional except if the `Country` is US, CA, or MX. *Max. length: 255 characters* The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces. **Returned values:** Two-letter country code (ISO 3166-1 alpha-2 format). The country of the address. **Returned values:** `V1`, `V2_1` The 3DS protocol version to be applied to the transaction. **Returned values:** `V1`, `V2_1` The 3DS protocol version applied to the transaction. The unique identifier of the recurring pay-in registration. **Returned values:** `VISA`, `MASTERCARD`, `CB`, `MAESTRO` The card network to use, as chosen by the cardholder, in case of co-branded cards. **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). Information about the card used for the transaction. If the information or data is not available, `null` is returned. The 6-digit bank identification number (BIN) of the card issuer. The name of the card issuer. *Format: ISO 3166-1 alpha-2 two-letter country code* The country where the card was issued. **Returned values:** `DEBIT`, `CREDIT`, `CHARGE CARD`. The type of card product. The card brand. Examples include: `AMERICAN EXPRESS`, `DISCOVER`, `JCB`, `MASTERCARD`, `VISA`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. The subtype of the card product. Examples include: `CLASSIC`, `GOLD`, `PLATINUM`, `PREPAID`, etc. **Note:** The possible returned values are numerous and liable to evolve over time. ```json 200 { "Id":"149625824", "Tag":"Custom description for this specific PayIn", "CreationDate":1661159886, "AuthorId":"146476890", "CreditedUserId":"146476890", "DebitedFunds":{ "Currency":"EUR", "Amount":4500 }, "CreditedFunds":{ "Currency":"EUR", "Amount":4455 }, "Fees":{ "Currency":"EUR", "Amount":45 }, "Status":"SUCCEEDED", "ResultCode":"000000", "ResultMessage":"Success", "ExecutionDate":1661159887, "Type":"PAYIN", "Nature":"REGULAR", "CreditedWalletId":"148968396", "DebitedWalletId":null, "PaymentType":"CARD", "ExecutionType":"DIRECT", "SecureMode":"DEFAULT", "CardId":"149334067", "SecureModeReturnURL":null, "SecureModeRedirectURL":null, "SecureModeNeeded":false, "Culture":"EN", "SecurityInfo":{ "AVSResult":"NO_CHECK" }, "StatementDescriptor":"Mar2016", "BrowserInfo":null, "IpAddress":"2001:0620:0000:0000:0211:24FF:FE80:C12C", "Billing":{ "FirstName":"Nat", "LastName":"Doe", "Address":{ "AddressLine1":"Rue des plantes", "AddressLine2":"The Oasis", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" } }, "Shipping":{ "FirstName":"Nat", "LastName":"Doe", "Address":{ "AddressLine1":"4 Oasis street", "AddressLine2":"The Oasis", "City":"Paris", "Region":"Ile de France", "PostalCode":"75001", "Country":"FR" } }, "Requested3DSVersion":null, "Applied3DSVersion":null, "RecurringPayinRegistrationId":null, "PreferredCardNetwork":null, "PaymentCategory":"ECommerce", "CardInfo": { "BIN": "497010", "IssuingBank": "LA BANQUE POSTALE", "IssuerCountryCode": "MA", "Type": "CREDIT", "Brand": "VISA", "SubType": null } } ``` ```php PHP Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payinId = 'payin_m_01HYG8DRT5FHT1FV44MV9KR1BS'; $response = $api->PayIns->Get($payinId); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```javascript NodeJS const mangopayInstance = require('mangopay2-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myPayIn = { Id: '156279887', } const viewPayIn = async (payinId) => { return await mangopay.PayIns.get(payinId) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } viewPayIn(myPayIn.Id) ``` ```ruby Ruby 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 viewPayIn(payinId) begin response = MangoPay::PayIn.fetch(payinId) puts response return response rescue MangoPay::ResponseError => error puts "Failed to fetch PayIn: #{error.message}" puts "Error details: #{error.details}" return false end end myPayIn = { Id: '156279887' } viewPayIn(myPayIn[:Id]) ``` ```java Java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.PayIn; public class ViewPayIn { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); PayIn payin = mangopay.getPayInApi().get("your-payin-id"); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(payin); System.out.println(prettyJson); } } ``` ```python Python 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 PayIn payin_id = 'wt_4fdf7754-6213-4016-be88-84587f093623' try: view_payin = PayIn.get(payin_id) pprint(view_payin._data) except PayIn.DoesNotExist: print('PayIn {} does not exist.'.format(payin_id)) ``` ```csharp .NET using MangoPay.SDK; 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 viewPayIn = await api.PayIns.GetAsync("payin_m_01J334XF2V6751GRG9M2M558HG"); string prettyPrint = JsonConvert.SerializeObject(viewPayIn, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` # Create a Direct Debit PayIn POST /v2.01/{ClientId}/payins/directdebit/direct ### Body parameters The unique identifier of the user at the source of the transaction. **Default value:** The unique identifier of the owner of the credited wallet. The unique identifier of the user whose wallet is credited. The unique identifier of the credited wallet. Information about the debited funds. **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 debited funds. 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`). Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **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 fees. 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`). *Max. length: 255 characters* Custom