Finrax API
HomeChangelogIntegration GuideResources
HomeChangelogIntegration GuideResources
  1. Crypto Payments
  • Getting Started
    • Introduction
    • Environments
    • Errors
    • Authorization
      • API Key Management
      • Signature
      • Code Snippets
  • Payments and Withdrawals
    • Crypto Payments
      • Fetch payment by ID
        GET
      • 🔒Fetch payments
        GET
      • Submit crypto payment
        PATCH
      • Request crypto payment
        POST
    • Fetch withdrawals
      GET
    • Fetch withdrawal metadata
      GET
    • Request crypto withdrawal
      POST
    • Fetch whitelisted addresses
      GET
    • Whitelist an address
      POST
    • Fetch crypto withdrawal approval by ID
      GET
    • Fetch business by ID
      GET
    • Fetch business balance
      GET
    • Unwhitelist an address
      DELETE
  • Callbacks
    • Deposit received notification
    • Withdrawal broadcast notification
    • Withdrawal approved/rejected notification
  • Address validation
    • Validate address
      GET
    • Validate address and destination tag
      GET
  • Rates and metadata
    • Fetch market rates
      GET
    • Fetch fiat rates
      GET
    • Fetch deposit rates
      GET
    • Fetch all currencies
      GET
  1. Crypto Payments

Request crypto payment

POST
/api/v1/payments
An endpoint for initiating a crypto payment request. Upon success, a unique paymentUrl is provided in the response which can be served within an iframe.
Alternatively, you can redirect to the payment URL and if you have supplied a redirectUrl in the request, we will navigate the end-user back to your website upon payment completion (when we have received a deposit against this payment request). There is also a button which the end-user can use if they wish to get redirected back sooner.

Request

Authorization
Add parameter in header
FRX-API
Example:
FRX-API: ********************
Body Params application/json
clientPaymentId
string 
required
Payment identifier provided in the request.
businessId
string <uuid>
required
type
enum<string> 
optional
Allowed values:
ONE_TIMEREUSABLE
displayCurrency
enum<string> 
optional
Fiat currency. You should provide this or depositCurrency.
Allowed values:
AEDARSAUDBDTBGNBRLCADCHFCLPCNYCZKDKKEURGBPHKDHRKHUFIDRILSINRISKJPYKESKRWMXNMYRNGNNOKNZDPENPHPPLNQARRONRUBSEKSGDTHBTRYUSDVNDZAR
displayAmount
string 
optional
Amount in displayCurrency that the user wants to deposit. Required if displayCurrency is provided.
depositCurrency
enum<string> 
optional
Cryptocurrency. You should provide this or displayCurrency.
Allowed values:
BCHBNBBTCETHLINKLTCSOLTRXUSDCUSDTXLMXRP
depositAmount
string 
optional
Amount in depositCurrency that the user wants to deposit. Required if depositCurrency is provided.
network
enum<string> 
optional
Cryptocurrency network. Required if depositCurrency is provided.
Allowed values:
BCHBTCLTCXLMXRPETHBSCSOLTRX
rateType
enum<string> 
optional
ONE_TIME payments: FIXED or FLOATING.
REUSABLE payments: You can omit this parameter. Reusable payments are set to FLOATING.
Allowed values:
FIXEDFLOATING
expirationMinutes
integer <int64>
optional
ONE_TIME payments: Indicates the timeframe in which the deposit should happen. A value of 0 will set the payment expiry to 7 days. Defaults to 30 min.
REUSABLE payments: You can omit this parameter. Reusable payments are set to non-expiry.
>= 0
locale
string 
required
Language localisation abbreviation (ISO 639-1), e.g. 'en-US', 'fr-FR'. Alternatively, the locale string can be submitted with an '_' instead of '-', e.g. 'en_US' or 'fr_FR'.
redirectUrl
string 
optional
Custom URL where the user will be redirected after payment completion.
Example
{
    "clientPaymentId": "test-payment-15-09-23-1",
    "locale": "en-US",
    "type": "ONE_TIME",
    "displayCurrency": "EUR",
    "displayAmount": 50,
    "rateType": "FIXED",
    "expirationMinutes": 10080,
    "businessId": "407710f4-de33-454b-a47f-dda792e272c8",
    "redirectUrl": "https://my-business.com/account?id=3423"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://payments.finrax.com/api/v1/payments' \
--header 'Content-Type: application/json' \
--header 'FRX-API;' \
--data-raw '{
    "clientPaymentId": "test-payment-15-09-23-1",
    "locale": "en-US",
    "type": "ONE_TIME",
    "displayCurrency": "EUR",
    "displayAmount": 50,
    "rateType": "FIXED",
    "expirationMinutes": 10080,
    "businessId": "407710f4-de33-454b-a47f-dda792e272c8",
    "redirectUrl": "https://my-business.com/account?id=3423"
}'

Responses

🟢200Returns the created payment.
application/json
Body
paymentInfo
object (DetailedPaymentResponse) 
optional
paymentId
string <uuid>
required
clientPaymentId
string 
required
Payment identifier provided by the merchant on payment creation.
businessId
string <uuid>
required
locale
string 
required
Locale code.
status
enum<string> 
required
Allowed values:
NEWPENDINGAWAITINGDEPOSITEDEXPIREDBLOCKEDOVERPAID
rateType
enum<string> 
required
Allowed values:
FIXEDFLOATING
type
enum<string> 
required
Allowed values:
ONE_TIMEREUSABLE
url
string <url>
required
Checkout link.
overpaymentPolicy
enum<string> 
optional
Allowed values:
PROCESSEXCESS_REFUND
refundFollowUpDepositsForOneTimePayments
boolean 
optional
processorType
enum<string> 
required
Allowed value:
BLOCKCHAIN
walletAddress
string 
optional
Wallet address where the cryptocurrency amount should be deposited.
destinationTag
string 
optional
XLM/XRP destination tag.
displayCurrency
enum<string> 
optional
Fiat currency.
Allowed values:
AEDARSAUDBDTBGNBRLCADCHFCLPCNYCZKDKKEURGBPHKDHRKHUFIDRILSINRISKJPYKESKRWMXNMYRNGNNOKNZDPENPHPPLNQARRONRUBSEKSGDTHBTRYUSDVNDZAR
expectedDisplayAmount
string 
optional
Amount in displayCurrency requested for this payment.
expectedDisplayDistributedUserServiceFee
string 
optional
Distributed service fee amount in displayCurrency requested for this payment.
actualDisplayAmount
string 
required
Actual amount deposited in displayCurrency.
actualDisplayDistributedUserServiceFee
string 
required
Actual distributed service fee amount in displayCurrency.
depositCurrency
enum<string> 
optional
The selected cryptocurrency.
Allowed values:
BCHBNBBTCETHLINKLTCSOLTRXUSDCUSDTXLMXRP
expectedNetwork
enum<string> 
optional
The selected network.
Allowed values:
BCHBTCLTCXLMXRPETHBSCSOLTRX
expectedDepositAmount
string 
optional
Amount in depositCurrency to be deposited to fulfill the required amount in displayCurrency.
expectedDepositDistributedUserServiceFee
string 
optional
Distributed service fee amount in depositCurrency requested for this payment.
actualDepositAmount
string 
required
Actual amount deposited in depositCurrency by the end user.
actualDepositDistributedUserServiceFee
string 
required
Actual distributed service fee amount in depositCurrency.
expectedUniformAmount
string 
optional
Expected deposit amount in EUR.
actualUniformAmount
string 
required
Actual amount deposited in EUR.
userServiceFeeDistributionPercentage
string 
required
Percentage of the service fee covered by the user.
redirectUrl
string <url>
optional
Custom URL where the user will be redirected after payment completion.
expirationMinutes
integer <int64>
required
Timeframe in which the deposit should succeed.
>= 0
paymentInitiatedAt
integer <int64>
required
UNIX seconds at which the payment was initiated.
paymentRequestedAt
integer <int64>
optional
UNIX seconds at which the payment was requested.
deposits
array[object (DetailedDepositResponse) {28}] 
required
paymentUrl
string <url>
optional
Example
{
    "paymentInfo": {
        "paymentId": "2fcd3399-49d4-45e0-b995-7c489f43fe08",
        "clientPaymentId": "test-payment-15-09-23-1",
        "businessId": "407710f4-de33-454b-a47f-dda792e272c8",
        "locale": "en-US",
        "status": "NEW",
        "rateType": "FIXED",
        "type": "ONE_TIME",
        "url": "https://example.com/deposit/2fcd3399-49d4-45e0-b995-7c489f43fe08?theme=skilling&locale=en-US&sessionToken=eyJhbGciOiJIUzUxMiJ9.eyJidXNpbmVzc0lkIjoiNDA3NzEwZjQtZGUzMy00NTRiLWE0N2YtZGRhNzkyZTI3MmM4Iiwib3JnYW5pc2F0aW9uSWQiOiJjZjFlNjdkMC00NmY2LTRhMDAtODM3MC0wOTBhNTA4N2M4MGYiLCJpYXQiOjE3MDI5MDY4OTksInBheW1lbnRJZCI6IjJmY2QzMzk5LTQ5ZDQtNDVlMC1iOTk1LTdjNDg5ZjQzZmUwOCJ9.LUnvFdCySVS03SX2ym4eJdUDlQfTe2un_DZ3tbYAoc7c9ABj71Po43tVxLTGP7VknrSftjB5ItvEuxF9EGn84Q",
        "overpaymentPolicy": "PROCESS",
        "refundFollowUpDepositsForOneTimePayments": false,
        "processorType": "BLOCKCHAIN",
        "displayCurrency": "EUR",
        "expectedDisplayAmount": "50.00",
        "actualDisplayAmount": "0.00",
        "actualDisplayDistributedUserServiceFee": "0.00",
        "actualDepositAmount": "0",
        "actualDepositDistributedUserServiceFee": "0",
        "actualUniformAmount": "0.00",
        "userServiceFeeDistributionPercentage": "0.00",
        "redirectUrl": "https://my-business.com/account?id=3423",
        "expirationMinutes": 10080,
        "paymentInitiatedAt": 1702906899,
        "deposits": []
    },
    "paymentUrl": "https://example.com/deposit/2fcd3399-49d4-45e0-b995-7c489f43fe08?theme=skilling&locale=en-US&sessionToken=eyJhbGciOiJIUzUxMiJ9.eyJidXNpbmVzc0lkIjoiNDA3NzEwZjQtZGUzMy00NTRiLWE0N2YtZGRhNzkyZTI3MmM4Iiwib3JnYW5pc2F0aW9uSWQiOiJjZjFlNjdkMC00NmY2LTRhMDAtODM3MC0wOTBhNTA4N2M4MGYiLCJpYXQiOjE3MDI5MDY4OTksInBheW1lbnRJZCI6IjJmY2QzMzk5LTQ5ZDQtNDVlMC1iOTk1LTdjNDg5ZjQzZmUwOCJ9.LUnvFdCySVS03SX2ym4eJdUDlQfTe2un_DZ3tbYAoc7c9ABj71Po43tVxLTGP7VknrSftjB5ItvEuxF9EGn84Q"
}
Modified at 2024-07-24 14:04:47
Previous
Submit crypto payment
Next
Fetch withdrawals
Built with