Skip payment method selection
Preamble
This technical document is intended for partners and their developers who are interested in using Guardarian for cryptocurrency exchanges. It outlines a flow that allows partners to handle payment method selection for customers during transactions. Partners can create transactions via an API call and redirect customers to the URL from the response without requiring them to select a payment method.
Regular flow
The current Guardarian flow allows partners to create transactions and redirect customers to the transaction URL. However, customers are required to select the payment method themselves. When creating a transaction, partners pass the necessary data to the API:
{
"from_amount": 1200.24,
"from_currency": "EUR",
"to_currency": "BTC",
"from_network": "EUR",
"to_network": "BTC"
}
Once the API call is made, the customer is redirected to the transaction URL (response field redirect_url) to complete the exchange. At this point, the customer is required to select their preferred payment method from the available options. The customer must also provide their payment details and complete the exchange.
Guardarian has introduced a new flow to improve the payment process for partners and customers. By integrating the flow, partners can create transactions through an API call and direct customers to the URL provided in the response without requiring them to select a payment method.
Skip payment method selection
Guardarian enables partners to preselect a payment category for customers during transactions. Partners can achieve this by passing a payment category value in deposit.payment_category and setting deposit.skip_choose_payment_category to true.
Example request with the new deposit block:
{
"from_amount": 1200.24,
"from_currency": "EUR",
"to_currency": "BTC",
"from_network": "EUR",
"to_network": "BTC",
"deposit": {
"payment_category": "VISA_MC",
"skip_choose_payment_category": true
}
}
| field | type | available values |
|---|---|---|
payment_category | string enum | Fetch the current values from GET /v1/payment-categories. |
skip_choose_payment_category | boolean | true / false |
Guardarian may have multiple payment methods in the selected payment category. In that case, Guardarian selects a payment method based on the fees of each available method. This ensures that customers receive a payment method based on the crypto amount estimate for the selected payment category.
While the new flow automatically preselects the payment category, customers can still select another available payment method on the payment step.
The new flow simplifies the transaction process by preselecting a payment category while allowing the customer to choose another payment method when needed.
Getting available currencies for a payment category
Guardarian has different currencies available for different payment categories, and trying to use a non-supported currency in the from_currency field while creating a transaction for a selected category will result in an error. Here is how to get the list of available currencies for a selected category:
// GET "/v1/currencies/fiat?payment_category=<category>"
// Example response:
[
{
"ticker": "EUR", // <-- please use the ticker field for the field "from_currency"
// <...>
},
{
"ticker": "USD",
// <...>
}
]
Requirements
To implement the payment preselection flow, partners must contact Guardarian to have this flow enabled for their account. The new flow is not enabled by default for all partners, so it’s essential to contact Guardarian to have it activated.