Get payment methods
Returns the payment methods your customer can use for a given country and amount, grouped by payment type. Each method comes with its fees, the total your customer pays, the amount credited to you, and the exact customer fields you must send to create a deposit with it.
POST
/api/v1/pay-in/deposit-creation/available-payment-methods| Authentication | HTTP Basic (api_key:api_secret) |
| Moves money | No |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Deposit amount. Positive, at most two decimals, from 0.01 to 99999999.99. |
country | string | Yes | 3-letter ISO code from Get countries. |
currency | string | No | 3-letter currency code of amount (for example USD). |
fee_on_payer | boolean | No | true to quote with the fees added to what your customer pays. Use the same value you will send when creating the deposit. Default false. |
curl https://sandbox-api.cashela.com/api/v1/pay-in/deposit-creation/available-payment-methods \ -u "$CASHELA_API_KEY:$CASHELA_API_SECRET" \ -H "Content-Type: application/json" -H "Accept: application/json" \ -d '{ "amount": 25.50, "country": "CHL", "currency": "USD", "fee_on_payer": true }'Response 200
data is a list of payment types; each one lists its option_payments. The example is shortened and its values are illustrative.
{ "success": true, "data": [ { "payment_type": "BANK_TRANSFER", "payment_name": "Bank Transfer", "option_payments": [ { "payment_method": "BX", "name": "Bank transfer", "logo": "https://…/logo.png", "is_accredited": { "currency": "USD", "amount": 25.5, "fee": 1.02, "total": 24.48 }, "payment_info": { "country": "CHL", "currency": "CLP", "rate": 940.12, "amount": 23973.06, "fee": 0, "tax": 0, "total": 23973.06 }, "required_fields": ["first_name", "last_name", "email", "phone", "document_key", "document_number"], "document_types": [ { "id": "RUT", "label": "Tax Identification Number", "regex": "^(?:[A-Za-z0-9]{8,9}|\\d{1,2}(?:\\.?\\d{3}){2}-[0-9kK])$" } ], "mandatory_fields": [ { "fieldName": "first_name", "type": "string", "required": true, "fieldRegex": null, "fieldLabel": "First name" } ], "availability": { "executable": true, "reason": null } } ] } ], "message": "Available payment methods retrieved successfully"}Option fields
| Field | Description |
|---|---|
payment_method | The code to send as payment_method when you create the deposit. |
name, logo | Display name and logo of the method. |
is_accredited | What is credited to you, in your settlement currency: amount, fee, total. |
payment_info | What your customer pays, in the method’s currency: currency, rate, amount, fee, tax, total. |
required_fields | Names of every field the deposit requires for this method, including method-specific ones (for example cbu). |
mandatory_fields | The same fields with their detail: fieldName, type, required, fieldRegex (format), fieldLabel, and options when only some values are accepted (send one of the options[].key). |
document_types | The documents this method accepts: id is the value to send as document_key, label its name, regex the format of document_number for it (null when none is published). Empty when the method does not ask for a document. |
data_standard | Present only on some accounts: a canonical description of each field (fields[].v1_key is the request key, requirement, expected_format, error_code). |
charge_breakdown | Card options that charge in USD only: what the card is charged, always in USD: amount, processing_fee, fx_spread, tax, total. See Card payments. |
local_estimate | Card options that charge in USD only: an informative estimate in the customer’s local currency (currency, rate, total). |
availability | When present: executable: false (with reason: ALL_ROUTES_UNHEALTHY) means the method is temporarily unavailable. Show it as unavailable; creating a deposit with it is refused with 422. Absent means available. |
Example: what a catalog can look like
In production in Mexico, on one account, the catalog returned the payment types BANK_TRANSFER, CREDIT_CARD, MOBILE_MONEY and VOUCHER. This is an illustration, not a guaranteed list: your account may see more, fewer or different methods.
Errors
| HTTP | When |
|---|---|
401 | Credentials missing or invalid. |
404 | The country does not exist in Cashela’s catalog ("Country not found."). |
422 | Invalid request (amount with more than two decimals, country longer than 3 letters…), or the deposit is refused for compliance reasons (code: PARTNER_PAYIN_COMPLIANCE_BLOCKED). |
503 | A rate or catalog needed for the quote is temporarily unavailable. Retry later. |
If a country has no method for your account and amount, you get no options for it. See Errors.