Selling Cryptocurrency
This procedure describes how a merchant sells cryptocurrency to a customer. Rapyd transfers fiat currency from the customer's card to the merchant's Rapyd Wallet, and the merchant credits the customer's cryptocurrency account on the merchant's own books. This procedure is relevant to merchants that are specifically licensed to sell cryptocurrencies.
Because cryptocurrency is a high-risk industry, you must set specific parameters correctly for compliance with anti-money laundering (AML) regulations. The transaction is a form of account funding transaction (AFT), which has additional requirements.
Note
The cryptocurrency feature is in beta testing. To enable this feature, contact Rapyd Client Support.
Relevant to payment method types that support this feature.
You can transfer fiat currency from a card for this transaction in the following ways:
Indirectly through the company wallet of a licensed business entity that manages the customer’s cryptocurrency account. The business credits the customer’s cryptocurrency account.
Directly to the cardholder’s own wallet. In the payment request, you include the person
ewallet.
Transferring Cryptocurrency Indirectly
In your Create Payment request, set the following parameters:
Set
payment_method_options.special_condition_indicatorto cryptocurrency.Set
payment_method_options.aftto true.Set
payment_method_options.purpose_codeto crypto_currency.Set
payment_method_options.is_direct_purchaseto true.Set the ID of the
customerobject or create a customer. See Create Customer.In the
customerobject:date_of_birthis required.The following fields are recommended:
birth_countryemailnationalityoccupation
The following
addressfields are required in the customer object:citycountryline_1of the addresszip
Selling Cryptocurrency: Request
curl -X post 'https://sandboxapi.rapyd.net/v1/payments' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'idempotency: your-idempotency-parameter-here' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here' \ --data-raw '{ "amount": 5, "currency": "USD", "customer": { "name": "John", "email": "johndoe@rapyd.net" }, "payment_method": { "type": "at_crypto_ewallet" }, "complete_payment_url": "https://complete.rapyd.net", "error_payment_url": "https://error.rapyd.net" }'
Cryptocurrency for customer: Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "0fa635bb-4eeb-46c1-b3d6-8b0a1e3d5854" }, "data": { "id": "payment_246742c89225e03e9b6d4a159c6ba7cf", "amount": 0, "original_amount": 5, "is_partial": false, "currency_code": "USD", "country_code": "AT", "status": "ACT", "description": "", "merchant_reference_id": "", "customer_token": "cus_1d27d402c0f4ee6b4f07c62f1ad16281", "payment_method": "other_e585fb3430e859499951d513e648eb14", "payment_method_data": { "id": "other_e585fb3430e859499951d513e648eb14", "type": "at_crypto_ewallet", "category": "ewallet", "metadata": {}, "image": "", "webhook_url": "", "supporting_documentation": "", "next_action": "not_applicable", "bic_swift": "", "account_last4": "" }, "auth_code": null, "expiration": 1765103155, "captured": true, "refunded": false, "refunded_amount": 0, "receipt_email": "", "redirect_url": "https://admindev.palpayments.com/pay/72dafcb2-7f9c-457e-9325-8cefecc382ef", "complete_payment_url": "https://complete.rapyd.net", "error_payment_url": "https://error.rapyd.net", "receipt_number": "", "flow_type": "", "address": null, "statement_descriptor": "valitor_merchant_1", "transaction_id": "", "created_at": 1764843955, "metadata": {}, "failure_code": "", "failure_message": "", "paid": false, "paid_at": 0, "dispute": null, "refunds": null, "order": null, "outcome": null, "visual_codes": {}, "textual_codes": {}, "instructions": [ { "name": "instructions", "steps": [ { "step1": "Redirect to PalWallet payment page.", "step2": "Scan the QR code or pay via your crypto wallet." } ] } ], "ewallet_id": "ewallet_6f288d7c178f545ebb56be8990ff0ff2", "ewallets": [ { "ewallet_id": "ewallet_6f288d7c178f545ebb56be8990ff0ff2", "amount": 5, "percent": 100, "refunded_amount": 0 } ], "payment_method_options": {}, "payment_method_type": "at_crypto_ewallet", "payment_method_type_category": "ewallet", "fx_rate": 1, "merchant_requested_currency": null, "merchant_requested_amount": null, "fixed_side": "", "payment_fees": null, "invoice": "", "escrow": null, "group_payment": "", "cancel_reason": null, "initiation_type": "customer_present", "mid": "mid_d94849f4962a767f00db5396feacff65", "next_action": "pending_confirmation", "error_code": "", "remitter_information": {}, "save_payment_method": false, "merchant_advice_code": null, "merchant_advice_message": null, "payment_request_id": null, "transaction_link_id": null } }
Transferring Cryptocurrency Directly
Use the following Create Payment request parameters:
Set
payment_method_options.special_condition_indicatorto cryptocurrency.Set
payment_method_options.aftto true.Set
payment_method_options.purpose_codeto crypto_currency.Set
payment_method_options.is_direct_purchaseto true.Set the ID of the cardholder’s person
ewallet. See Create Wallet.The cardholder’s first name, last name, and country must match the values of the wallet contact.
The following wallet contact fields are required. See Add Contact to Wallet.
first_namelast_namecountryThe following wallet contact
addressfields are required. See Create Address.cityline_1of the addresszip
Cryptocurrency for person wallet: Request
curl -X post https://sandboxapi.rapyd.net/v1/payments/ -H 'access_key: your-access-key-here' -H 'Content-Type: application/json' -H 'idempotency: your-idempotency-parameter-here' -H 'salt: your-random-string-here' -H 'signature: your-calculated-signature-here' -H 'timestamp: your-unix-timestamp-here' -d '{ "amount": 1.07, "currency": "EUR", "description": "Cryptocurrency payment - person wallet", "capture": true, "ewallet": "ewallet_4d4b74f67ddf7cd8fd9ea33bf72aa3bd", "complete_payment_url": "https://complete.example.net", "error_payment_url": "https://error.example.net", "payment_method": { "type": "nl_visa_card", "fields": { "number": "4111111111111111", "expiration_month": "11", "expiration_year": "31", "cvv": "123", "name": "John Doe" } }, "payment_method_options": { "special_condition_indicator": "cryptocurrency", "aft": true, "purpose_code": "crypto_currency", "is_direct_purchase": true } }'
Cryptocurrency for person wallet: Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "851d1197-b7b0-43b2-a3c1-1353e227cf75" }, "data": { "id": "payment_bafcc78a0542ef64f3bbd145c130690c", "amount": 1.07, "original_amount": 1.07, "is_partial": false, "currency_code": "EUR", "country_code": "NL", "status": "CLO", "description": "Cryptocurrency payment - person wallet", "merchant_reference_id": "", "customer_token": "cus_77dbcd9f07c1d78a7702a46a3d8c1d4e", "payment_method": "card_38f74ed0a42211b2c9a08aa945074875", "payment_method_data": { "id": "card_38f74ed0a42211b2c9a08aa945074875", "type": "nl_visa_card", "category": "card", "metadata": null, "image": "", "webhook_url": "", "supporting_documentation": "", "next_action": "not_applicable", "name": "John Doe", "last4": "1111", "acs_check": "unchecked", "cvv_check": "unchecked", "bin_details": { "type": "CREDIT", "brand": "VISA", "level": "CLASSIC", "country": "NL", "bin_number": "411111" }, "expiration_year": "31", "expiration_month": "11", "fingerprint_token": "ocfp_c6abbccb3440fcb0fc34ae14126607fa", "network_reference_id": "000000111222999", "payment_account_reference": "V0010013018036782991622965076" }, "auth_code": "003603", "expiration": 1748504528, "captured": true, "refunded": false, "refunded_amount": 0, "receipt_email": "", "redirect_url": "", "complete_payment_url": "https://complete.example.net", "error_payment_url": "https://error.example.net", "receipt_number": "", "flow_type": "", "address": null, "statement_descriptor": "Doc Team", "transaction_id": "", "created_at": 1747899728, "metadata": {}, "failure_code": "", "failure_message": "", "paid": true, "paid_at": 1747899729, "dispute": null, "refunds": null, "order": null, "outcome": null, "visual_codes": {}, "textual_codes": {}, "instructions": [ { "name": "instructions", "steps": [ { "step1": "" } ] } ], "ewallet_id": "ewallet_4d4b74f67ddf7cd8fd9ea33bf72aa3bd", "ewallets": [ { "ewallet_id": "ewallet_4d4b74f67ddf7cd8fd9ea33bf72aa3bd", "amount": 1.07, "percent": 100, "refunded_amount": 0 } ], "payment_method_options": { "aft": true, "purpose_code": "crypto_currency", "special_condition_indicator": "cryptocurrency", "is_direct_purchase": true }, "payment_method_type": "nl_visa_card", "payment_method_type_category": "card", "fx_rate": 1, "merchant_requested_currency": null, "merchant_requested_amount": null, "fixed_side": "", "payment_fees": null, "invoice": "", "escrow": null, "group_payment": "", "cancel_reason": null, "initiation_type": "customer_present", "mid": "mid_7b624b32f161313347d554138d81858", "next_action": "not_applicable", "error_code": "", "remitter_information": {}, "save_payment_method": false, "merchant_advice_code": null, "merchant_advice_message": null, "transaction_link_id": null } }