Checking payment methods availability
The Monetix payment platform provides you with a variety of payment methods your customer can make a payment with. Although, sometimes some payment methods can be unavailable for payment processing because, for example, the payment amount your customer wants to pay or receive doesn't fit the payment amount limits allowed for the payment method or if the payment method itself is currently out of service.
You can check what payment methods are currently available to perform a payment with before you display them to your customer. It can help you avoid a potential payment decline if the payment amount is larger or smaller than the amount limit allowed for the payment method or if the payment method is temporarily not working.
To check payment methods availability, send a request to the Monetix payment platform by using the Gate API. See the information below to learn some details about how to send such a request and what data you will receive in the response.
Request
Here is some information that you need to create a request for checking payment methods availability.
HTTP request method | POST |
Request body format | JSON |
API endpoint | /v2/info/available_methods_for_merchant/list |
Object/Parameter | Description | |
---|---|---|
project_id |
Project ID you obtained from Monetix when integrating. Example: |
|
directions |
Pass in this array:
Example: |
|
currency |
Code of the payment currency in the ISO-4217 alpha-3 format. Add this parameter to the request to get the list of payment methods available for this currency. Example: |
|
amount |
Payment amount in minor currency units without any decimal point or comma except for the cases when the currency doesn't have any minor currency units. If the currency doesn't have any minor units (i.e. the number of digits for minor currency units is zero), set this parameter to the amount in the major currency units. To check whether the currency has any minor units, see Currency codes. Pass this parameter in the request together with the currency parameter to get the list of payment methods available for the amount and currency you specify in the request. Example: 10.00 |
|
show_unavailable_methods_by_rules |
Parameter that you can add to the request to also get a list of unavailable payment methods. If you add this parameter with the
Example: |
|
is_enable_check_by_trusted_pm_user_rules |
Parameter that you can add to the request to get a response containing a list of payment methods to be shown to a trusted customer. If you add this parameter with the Pass this parameter in the request together with the customer_id parameter to get the list of payment methods available for a particular customer. Example: |
|
customer |
id |
Unique ID of the customer within your project. Pass this parameter in the request together with the is_enable_check_by_trusted_pm_user_rules parameter to get the list of payment methods available for a particular customer. Example: |
payment_method |
Code of the payment method which availability you want to check. Use this parameter in the request if you want to check availability of a particular payment method. Parameter code is listed in the method parameter in the callback. Example: |
|
signature |
Signature created after you've specified all the request parameters. For more information about signature generation, see Signature generation and verification. |
Here is an example of a basic minimum of parameters that you need to add to the request for checking payment methods availability. The response to such a request will contain information about the available payment methods relevant to the project specified in the request.
{ "project_id": 1234, "directions": [ "payin", "payout" ], "signature": "kUi2x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y19vySO/RLUkDJrOcZzUCwX6R/ekpZhkIQg==" }
The following is an example of request parameters to check the availability of one particular payment method. The response to such a request will contain information about the payment method specified in the request.
{ "project_id": 1234, "directions": [ "payin", "payout" ], "payment_method": "example_method", "signature": "kUi2x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y19vySO/RLUkDJrOcZzUCwX6R/ekpZhkIQg==" }
The example below has additional parameters in the request. The response to such a request will contain information about available payment methods, as well as the methods that are currently unavailable because of their operation schedule or the request amount not corresponding to the payment methods' amount limit. Moreover, the list of payment methods sent in the response will vary depending on whether the customer making a payment is a trusted one or not.
{ "project_id": 1234, "directions": [ "payin", "payout" ], "currency": "RUB", "amount": 100000, "show_unavailable_methods_by_rules": true, "is_enable_check_by_trusted_pm_user_rules": true, "customer": { "id": "123" }, "signature": "kUi2x9dKHAVNU0FYldJrxh4yo+52Kt8KU+Y19vySO/RLUkDJrOcZzUCwX6R/ekpZhkIQg==" }
Response
The Monetix payment platform sends a response to the request for checking payment methods availability synchronously, i.e. within the same HTTP session. If your request is built correctly, the payment platform will respond with the HTTP 200 OK
status code to it and the response will contain information about the payment methods available to perform a payment with.
Here is an example of the data that you can get in the response to your request for checking payment methods availability.
{ "available_payment_methods_by_trusted_user_rules": { "RUB": [ { "title": "method_1", "direction": "payin" }, { "title": "method_2", "direction": "payin" } ] }, "available_payment_methods": { "RUB": [ { "title": "method_3", "direction": "payin", "limits": { "min_amount": 10000, "max_amount": 1000000 } }, { "title": "method_4", "direction": "payin", "limits": { "min_amount": 90000, "max_amount": 1000000 } } ], "USD": [ { "title": "method_5", "direction": "payin", "limits": { "min_amount": 10000, "max_amount": 1000000 } } ] }, "unavailable_payment_methods_by_limits": { "PHP": [ { "title": "method_6", "direction": "payin", "min_amount": 10000, "max_amount": 560000, "currency": "PHP" } ] }, "unavailable_payment_methods_by_schedule": { "PHP": [ { "title": "method_7", "direction": "payin", "will_be_available": "13/10/2022 18:30 GMT+03:00" } ], "USD": [ { "title": "method_8", "direction": "payin", "will_be_available": "11/11/2022 12:00 GMT +03:00" } ] } }
If your request is incorrect or the payment platform can't process it, the response will contain:
- the HTTP status code different from
200 OK
error
request processing status- the description of the error
Listed below are the HTTP status codes that you can get in the response to the request for checking payment methods availability.
Code | Description |
---|---|
200 |
Success. The response contains information about available payment methods and their amount limits |
400 |
Used in several cases:
|
403 |
The request is prohibited due to the lack of permits, e.g. because it was sent from the IP address which is not included in the allowed IPs list. Contact the technical support team |
422 |
Invalid JSON data. Correct the request |
500 |
Internal server error. Resend the request |