### GET /api/1.0/configuration/pairs Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves the trading configuration for all supported currency pairs, including precision and limits. ```APIDOC ## GET /api/1.0/configuration/pairs ### Description Retrieve configuration for all traded currency pairs including trading limits and precision. ### Method GET ### Endpoint /api/1.0/configuration/pairs ### Response #### Success Response (200) - **pairs** (array) - List of currency pair configurations #### Response Example { "pairs": [ { "symbol": "BTC-USD", "min_order_size": "0.0001", "status": "active" } ] } ``` -------------------------------- ### Get Crypto Purchase Quote Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Calculates the estimated costs, including service, network, and partner fees, for a specific crypto purchase request. ```bash curl -X GET 'https://ramp-partners.revolut.com/partners/api/2.0/quote?fiat=USD&amount=100&crypto=ETH&payment=card®ion=US' \ -H 'X-API-KEY: your_api_key_here' ``` -------------------------------- ### Business API - Retrieve Accounts Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Get a list of all business accounts with their balances and details. ```APIDOC ## GET /api/1.0/accounts ### Description Get a list of all business accounts with their balances and details. ### Method GET ### Endpoint https://b2b.revolut.com/api/1.0/accounts ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET 'https://b2b.revolut.com/api/1.0/accounts' \ -H 'Authorization: Bearer oa_prod_xxxxxxxxxxxxx' ``` ### Response #### Success Response (200) - **id** (string) - Unique identifier for the account. - **name** (string) - Name of the account. - **balance** (integer) - Current balance of the account. - **currency** (string) - Currency of the account (e.g., GBP, EUR). - **state** (string) - State of the account (e.g., active). - **public** (boolean) - Indicates if the account is public. - **created_at** (string) - Timestamp when the account was created. - **updated_at** (string) - Timestamp when the account was last updated. #### Response Example ```json [ { "id": "d56dd396-523b-4613-8cc7-54974c17bcac", "name": "Main GBP", "balance": 100000, "currency": "GBP", "state": "active", "public": false, "created_at": "2023-01-15T10:30:00Z", "updated_at": "2024-06-01T14:22:00Z" } ] ``` ``` -------------------------------- ### GET /api/1.0/orders/active Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves a list of currently active orders with support for filtering by symbol, state, and pagination. ```APIDOC ## GET /api/1.0/orders/active ### Description Retrieve active orders with optional filtering by symbol, state, type, and side. ### Method GET ### Endpoint /api/1.0/orders/active ### Query Parameters - **symbols** (string) - Optional - Comma-separated list of symbols - **order_states** (string) - Optional - Comma-separated list of states - **limit** (integer) - Optional - Max number of results ### Response #### Success Response (200) - **orders** (array) - List of active order objects - **metadata** (object) - Pagination metadata #### Response Example { "orders": [ { "order_id": "550e8400-e29b-41d4-a716-446655440000", "symbol": "BTC-USD", "status": "new" } ] } ``` -------------------------------- ### Crypto Ramp API - Get Order Quote Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves a quote for a crypto purchase, including exchange rates, fees, and the estimated amount of cryptocurrency. ```APIDOC ## GET /partners/api/2.0/quote ### Description Retrieve an order quote showing current exchange rate, fees, and estimated crypto amount. ### Method GET ### Endpoint https://ramp-partners.revolut.com/partners/api/2.0/quote ### Parameters #### Query Parameters - **fiat** (string) - Required - The fiat currency for the transaction (e.g., USD). - **amount** (number) - Required - The amount of fiat currency to convert. - **crypto** (string) - Required - The crypto currency to purchase (e.g., ETH). - **payment** (string) - Required - The payment method to use (e.g., card). - **region** (string) - Required - The user's region or country code. #### Headers - **X-API-KEY** (string) - Required - Your API key for authentication. ### Response #### Success Response (200 OK) - **service_fee** (object) - The service fee details. - **amount** (number) - The fee amount. - **currency** (string) - The currency of the fee. - **network_fee** (object) - The network fee details. - **amount** (number) - The fee amount. - **currency** (string) - The currency of the fee. - **crypto** (object) - The estimated crypto amount. - **amount** (number) - The amount of cryptocurrency. - **currencyId** (string) - The ID of the cryptocurrency. - **partner_fee** (object) - The partner fee details. - **amount** (number) - The fee amount. - **currency** (string) - The currency of the fee. ### Response Example ```json { "service_fee": { "amount": 3.76, "currency": "USD" }, "network_fee": { "amount": 0.91, "currency": "USD" }, "crypto": { "amount": 0.10604352, "currencyId": "ETH" }, "partner_fee": { "amount": 0.77, "currency": "USD" } } ``` ``` -------------------------------- ### Open Banking API - Get Access Token Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Obtain an OAuth 2.0 access token using mutual TLS authentication with transport certificates. ```APIDOC ## POST /token ### Description Obtain an OAuth 2.0 access token using mutual TLS authentication with transport certificates. ### Method POST ### Endpoint - Sandbox: `https://sandbox-oba-auth.revolut.com/token` - Production: `https://oba-auth.revolut.com/token` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **grant_type** (string) - Required - Must be 'client_credentials'. - **scope** (string) - Required - The scope of the access requested (e.g., 'accounts'). ### Request Example **Sandbox:** ```bash curl -k --cert transport.pem --key private.key \ -X POST 'https://sandbox-oba-auth.revolut.com/token' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'grant_type=client_credentials' \ -d 'scope=accounts' ``` **Production:** ```bash curl -k --cert transport.pem --key private.key \ -X POST 'https://oba-auth.revolut.com/token' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'grant_type=client_credentials' \ -d 'scope=accounts' ``` ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token (usually 'Bearer'). - **expires_in** (integer) - The token's lifetime in seconds. #### Response Example ```json { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 2399 } ``` ``` -------------------------------- ### Revolut X API - Get Account Balances Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves the balances of your crypto exchange account for both crypto and fiat currencies using Ed25519 signed authentication. ```APIDOC ## GET /api/1.0/balances ### Description Retrieve crypto exchange account balances for both crypto and fiat currencies using Ed25519 signed authentication. ### Method GET ### Endpoint https://revx.revolut.com/api/1.0/balances ### Parameters #### Headers - **X-Revx-API-Key** (string) - Required - Your 64-character API key. - **X-Revx-Timestamp** (string) - Required - The Unix timestamp in milliseconds when the request was generated. - **X-Revx-Signature** (string) - Required - The Base64 encoded Ed25519 signature of the request. ### Response #### Success Response (200 OK) - **balances** (array) - A list of account balances. - **currency** (string) - The currency code (e.g., BTC, USD). - **available** (string) - The available amount of the currency. - **held** (string) - The held amount of the currency. ### Response Example ```json { "balances": [ { "currency": "BTC", "available": "1.5", "held": "0.1" }, { "currency": "USD", "available": "10000.00", "held": "500.00" }, { "currency": "ETH", "available": "25.75", "held": "0" } ] } ``` ``` -------------------------------- ### Retrieve Currency Pairs Configuration Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Fetches the trading configuration for all supported currency pairs, including precision settings and order size limits. ```bash curl -X GET 'https://revx.revolut.com/api/1.0/configuration/pairs' \ -H 'X-Revx-API-Key: your_64_char_api_key' \ -H 'X-Revx-Timestamp: 1746007718237' \ -H 'X-Revx-Signature: base64_encoded_ed25519_signature' ``` -------------------------------- ### Retrieve Crypto Ramp Configuration Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Fetches the available fiat currencies, crypto assets, payment methods, and operational limits for the Revolut Ramp service. ```bash curl -X GET 'https://ramp-partners.revolut.com/partners/api/2.0/config' \ -H 'X-API-KEY: your_api_key_here' ``` -------------------------------- ### Create Crypto Purchase Redirect URL Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Generates a secure URL that redirects the user to the Revolut Ramp widget to finalize their crypto purchase. ```bash curl -X GET 'https://ramp-partners.revolut.com/partners/api/2.0/buy?fiat=GBP&amount=100&crypto=ETH&payment=card®ion=GB&wallet=0x96e2B7Bf479f84e7A0a94f0620290B7D3E08f5EF&orderId=2d1769bc-7aab-92ed-a10b-0232ac12090d' \ -H 'X-API-KEY: your_api_key_here' ``` -------------------------------- ### Place Market Order via Revolut X API Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Executes a market order by providing a quote size. Requires API key, timestamp, and a valid Ed25519 signature in the headers. ```bash curl -X POST 'https://revx.revolut.com/api/1.0/orders' \ -H 'X-Revx-API-Key: your_64_char_api_key' \ -H 'X-Revx-Timestamp: 1746007718237' \ -H 'X-Revx-Signature: base64_encoded_ed25519_signature' \ -H 'Content-Type: application/json' \ -d '{ "client_order_id": "4c475538-2g5g-5g77-aa46-97c7gc226e37", "symbol": "ETH-USD", "side": "BUY", "order_configuration": { "market": { "quote_size": "500.00" } } }' ``` -------------------------------- ### Merchant API: Create Payment Order (Bash) Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Creates a payment order for e-commerce transactions using various payment methods. Supports automatic or manual capture modes. Requires an API key for authorization and specifies order details like amount, currency, and customer information. ```bash curl -X POST 'https://merchant.revolut.com/api/orders' \ -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxx' \ -H 'Revolut-Api-Version: 2024-09-01' \ -H 'Content-Type: application/json' \ -d '{ "amount": 1000, "currency": "GBP", "description": "Product purchase", "capture_mode": "automatic", "merchant_order_data": { "url": "https://example.com/orders/12345", "reference": "order-12345" }, "customer": { "email": "customer@example.com" } }' ``` -------------------------------- ### Manage Crypto Ramp Webhooks Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Provides endpoints to create, list, and delete webhooks for monitoring order and payment lifecycle events. ```bash # Create a webhook curl -X POST 'https://ramp-partners.revolut.com/partners/api/1.0/webhooks' \ -H 'X-API-KEY: your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://your-server.com/webhooks/revolut", "events": ["ORDER_CREATED", "ORDER_PROCESSING", "ORDER_COMPLETED", "ORDER_FAILED"] }' # List all webhooks curl -X GET 'https://ramp-partners.revolut.com/partners/api/1.0/webhooks' \ -H 'X-API-KEY: your_api_key_here' # Delete a webhook curl -X DELETE 'https://ramp-partners.revolut.com/partners/api/1.0/webhooks/c518d8cc-114b-d2ed-a10b-0a32ac1c0e4f' \ -H 'X-API-KEY: your_api_key_here' ``` -------------------------------- ### Crypto Ramp API - Retrieve Configuration Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Fetches the current configuration for the Revolut Crypto Ramp, including supported currencies, payment methods, and limits. ```APIDOC ## GET /partners/api/2.0/config ### Description Get Revolut Ramp configuration including supported fiat currencies, crypto tokens, payment methods, and limits. ### Method GET ### Endpoint https://ramp-partners.revolut.com/partners/api/2.0/config ### Parameters #### Headers - **X-API-KEY** (string) - Required - Your API key for authentication. ### Response #### Success Response (200 OK) - **version** (string) - The API version. - **countries** (array) - List of supported country codes. - **fiat** (array) - List of supported fiat currencies with their min/max limits. - **currency** (string) - The fiat currency code. - **min_limit** (number) - The minimum transaction limit. - **max_limit** (number) - The maximum transaction limit. - **crypto** (array) - List of supported crypto tokens. - **id** (string) - The crypto token ID. - **currency** (string) - The crypto currency code. - **blockchain** (string) - The blockchain network. - **smartContractAddress** (string, optional) - The smart contract address for specific tokens. - **feePercentages** (array) - List of applicable fee percentages. - **payment_methods** (array) - List of supported payment methods. ### Response Example ```json { "version": "1.0.0", "countries": ["GB", "US", "PT", "FR", "DE", "ES"], "fiat": [ { "currency": "GBP", "min_limit": 50, "max_limit": 500 }, { "currency": "USD", "min_limit": 60, "max_limit": 600 }, { "currency": "EUR", "min_limit": 60, "max_limit": 600 } ], "crypto": [ { "id": "BTC", "currency": "BTC", "blockchain": "BITCOIN" }, { "id": "ETH", "currency": "ETH", "blockchain": "ETHEREUM" }, { "id": "USDT-ETH", "currency": "USDT", "blockchain": "ETHEREUM", "smartContractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7" } ], "feePercentages": [0.8, 1], "payment_methods": ["card", "revolut", "apple-pay", "google-pay"] } ``` ``` -------------------------------- ### Merchant API: Retrieve Orders (Bash) Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves a list of orders with support for filtering and pagination. Filters can be applied based on order state, date range, customer email, or merchant reference. Requires an API key for authorization. ```bash curl -X GET 'https://merchant.revolut.com/api/1.0/orders?state=COMPLETED&state=AUTHORISED&limit=100&from_created_date=2024-01-01T00:00:00Z' \ -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxx' ``` -------------------------------- ### Crypto Ramp API - Create Redirect URL for Purchase Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Generates a URL to redirect users to the Revolut Ramp widget to complete a crypto purchase. ```APIDOC ## GET /partners/api/2.0/buy ### Description Generate a redirect URL to the Revolut Ramp widget for customers to complete their crypto purchase. ### Method GET ### Endpoint https://ramp-partners.revolut.com/partners/api/2.0/buy ### Parameters #### Query Parameters - **fiat** (string) - Required - The fiat currency for the transaction (e.g., GBP). - **amount** (number) - Required - The amount of fiat currency to convert. - **crypto** (string) - Required - The crypto currency to purchase (e.g., ETH). - **payment** (string) - Required - The payment method to use (e.g., card). - **region** (string) - Required - The user's region or country code. - **wallet** (string) - Required - The user's cryptocurrency wallet address. - **orderId** (string) - Required - A unique identifier for the order. #### Headers - **X-API-KEY** (string) - Required - Your API key for authentication. ### Response #### Success Response (200 OK) - **ramp_redirect_url** (string) - The URL to redirect the user to complete the purchase. ### Response Example ```json { "ramp_redirect_url": "https://ramp.revolut.com?fiatCurrency=GBP&amount=10000&cryptoCurrency=ETH&walletAddress=0x96e2B7Bf479f84e7A0a94f0620290B7D3E08f5EF&countryCode=GB&partnerId=a01798bc-7f0b-14ed-a12b-0e3fac1209ad&externalOrderId=2d1769bc-7aab-92ed-a10b-0232ac12090d" } ``` ``` -------------------------------- ### Sign and Encode Message for Revolut X API (Python) Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt This Python snippet demonstrates how to sign a message using a private key and encode the resulting signature in base64 for use with the Revolut X API. It requires the 'cryptography' library for signing and 'base64' for encoding. ```python from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import ed25519 from cryptography.hazmat.backends import default_backend import base64 import time # Assuming raw_private is your Ed25519 private key in bytes # For demonstration, let's generate a key pair (in a real scenario, load your existing key) private_key_obj = ed25519.Ed25519PrivateKey.generate() raw_private = private_key_obj.private_bytes_raw() message = b"your_message_to_sign" signing_key = ed25519.Ed25519PrivateKey.from_private_bytes(raw_private) signed = signing_key.sign(message) signature = base64.b64encode(signed).decode() timestamp = str(int(time.time() * 1000)) # Example timestamp print(f"X-Revx-Timestamp: {timestamp}") print(f"X-Revx-Signature: {signature}") ``` -------------------------------- ### Sign Requests with Ed25519 in Python Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Demonstrates how to generate a cryptographic signature for API requests using the PyNaCl library. It involves loading a private key, constructing the message string, and signing the payload. ```python import base64 import time from pathlib import Path from nacl.signing import SigningKey from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend # Load private key pem_data = Path("private.pem").read_bytes() private_key_obj = serialization.load_pem_private_key( pem_data, password=None, backend=default_backend() ) # Extract raw bytes for PyNaCl raw_private = private_key_obj.private_bytes( encoding=serialization.Encoding.Raw, format=serialization.PrivateFormat.Raw, encryption_algorithm=serialization.NoEncryption() ) # Prepare the message to sign timestamp = str(int(time.time() * 1000)) method = "POST" path = "/api/1.0/orders" query = "" body = '{"client_order_id":"3b364427-1f4f-4f66-9935-86b6fb115d26","symbol":"BTC-USD","side":"BUY","order_configuration":{"limit":{"base_size":"0.1","price":"90000.1"}}}' # Concatenate without separators message = f"{timestamp}{method}{path}{query}{body}".encode('utf-8') ``` -------------------------------- ### POST /api/1.0/orders Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Places a new market order on the Revolut X platform using a specified quote size. ```APIDOC ## POST /api/1.0/orders ### Description Places a market order by quote size for a specific currency pair. ### Method POST ### Endpoint /api/1.0/orders ### Request Body - **client_order_id** (string) - Required - Unique identifier for the order - **symbol** (string) - Required - Trading pair (e.g., ETH-USD) - **side** (string) - Required - BUY or SELL - **order_configuration** (object) - Required - Configuration containing market details ### Request Example { "client_order_id": "4c475538-2g5g-5g77-aa46-97c7gc226e37", "symbol": "ETH-USD", "side": "BUY", "order_configuration": { "market": { "quote_size": "500.00" } } } ### Response #### Success Response (200) - **order_id** (string) - Unique system order ID - **status** (string) - Current status of the order #### Response Example { "order_id": "550e8400-e29b-41d4-a716-446655440000", "status": "new" } ``` -------------------------------- ### Crypto Ramp API - Manage Webhooks Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Allows for the creation, retrieval, updating, and deletion of webhooks to monitor order and payment lifecycle events. ```APIDOC ## Webhooks API (Crypto Ramp) ### Description Create, retrieve, update, and delete webhooks to track order and payment lifecycle events. ### Method POST, GET, DELETE ### Endpoints - **Create Webhook**: `https://ramp-partners.revolut.com/partners/api/1.0/webhooks` - **List Webhooks**: `https://ramp-partners.revolut.com/partners/api/1.0/webhooks` - **Delete Webhook**: `https://ramp-partners.revolut.com/partners/api/1.0/webhooks/{webhook_id}` ### Parameters #### Headers - **X-API-KEY** (string) - Required - Your API key for authentication. #### Request Body (POST) - **url** (string) - Required - The URL to receive webhook notifications. - **events** (array of strings) - Required - A list of events to subscribe to (e.g., `ORDER_CREATED`, `ORDER_COMPLETED`). ### Response #### Success Response (200 OK) - POST - **id** (string) - The unique ID of the created webhook. - **url** (string) - The configured webhook URL. - **events** (array of strings) - The list of subscribed events. - **signing_secret** (string) - The secret used for signing webhook requests. #### Success Response (200 OK) - GET - Returns a list of webhook objects. #### Success Response (200 OK) - DELETE - Confirmation of deletion. ### Request Example (POST) ```json { "url": "https://your-server.com/webhooks/revolut", "events": ["ORDER_CREATED", "ORDER_PROCESSING", "ORDER_COMPLETED", "ORDER_FAILED"] } ``` ### Response Example (POST) ```json { "id": "c518d8cc-114b-d2ed-a10b-0a32ac1c0e4f", "url": "https://your-server.com/webhooks/revolut", "events": ["ORDER_CREATED", "ORDER_PROCESSING", "ORDER_COMPLETED", "ORDER_FAILED"], "signing_secret": "wsk_h1ETWMz2g1bB7gCONjNp84t2KSSIt7rs" } ``` ``` -------------------------------- ### Place Revolut X Order Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Submits a new limit or market order to the Revolut X exchange, requiring signed authentication headers. ```bash curl -X POST 'https://revx.revolut.com/api/1.0/orders' \ -H 'X-Revx-API-Key: your_64_char_api_key' \ -H 'X-Revx-Timestamp: 1746007718237' \ -H 'X-Revx-Signature: base64_encoded_ed25519_signature' \ -H 'Content-Type: application/json' \ -d '{ "client_order_id": "3b364427-1f4f-4f66-9935-86b6fb115d26", "symbol": "BTC-USD", "side": "BUY", "order_configuration": { "limit": { "base_size": "0.1", "price": "90000.10" } } }' ``` -------------------------------- ### Merchant API: Capture Order (Bash) Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Captures funds from an authorized order when manual capture mode is used. Supports full or partial captures, and can update line items for partial captures. Requires the order ID and an API key for authorization. ```bash # Capture full amount from an authorized order curl -X POST 'https://merchant.revolut.com/api/orders/651a941a-02ef-af6f-9b6c-458c652e2c6a/capture' \ -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxx' \ -H 'Revolut-Api-Version: 2024-09-01' \ -H 'Content-Type: application/json' \ -d '{ "amount": 1000 }' # Partial capture with line items update curl -X POST 'https://merchant.revolut.com/api/orders/651a941a-02ef-af6f-9b6c-458c652e2c6a/capture' \ -H 'Authorization: Bearer sk_live_xxxxxxxxxxxxx' \ -H 'Revolut-Api-Version: 2024-09-01' \ -H 'Content-Type: application/json' \ -d '{ "amount": 750, "line_items": [ { "name": "Product A", "quantity": 1, "unit_price_amount": 750 } ] }' ``` -------------------------------- ### Sign and Encode Message for Revolut X API (Node.js) Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt This Node.js snippet shows how to sign a message using a private key and encode the signature in base64 for the Revolut X API. It utilizes the built-in 'crypto' module and requires a PEM-formatted private key file. ```javascript // Node.js example for signing Revolut X API requests const crypto = require('crypto'); const fs = require('fs'); // Load private key (ensure it's in PEM format) // In a real scenario, replace 'private.pem' with your actual key file path // const privateKey = fs.readFileSync('private.pem', 'utf8'); // For demonstration, let's generate a key pair and use its private key // This is NOT how you'd typically handle keys in production. const { privateKey, publicKey } = crypto.generateKeyPairSync('ed25519', { privateKeyEncoding: { type: 'pkcs8', format: 'pem', }, publicKeyEncoding: { type: 'spki', format: 'pem', } }); // Prepare the message components const timestamp = Date.now().toString(); const method = 'GET'; const path = '/api/1.0/orders/active'; const query = 'symbols=BTC-USD&limit=100'; const body = ''; // Empty body for GET request // Concatenate without separators as per API specification const message = timestamp + method + path + query + body; // Sign the message using the private key. The 'null' algorithm is used for Ed25519 with no digest. // The privateKey variable here is the PEM string obtained from generateKeyPairSync. const signatureBuffer = crypto.sign(null, Buffer.from(message), { key: privateKey, padding: crypto.constants.RSA_NO_PADDING // Not strictly needed for Ed25519 but good practice to specify }); const signature = signatureBuffer.toString('base64'); console.log(`X-Revx-Timestamp: ${timestamp}`); console.log(`X-Revx-Signature: ${signature}`); ``` -------------------------------- ### Retrieve Revolut X Account Balances Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Fetches current crypto and fiat balances for a Revolut X account, requiring Ed25519 signature headers for authentication. ```bash curl -X GET 'https://revx.revolut.com/api/1.0/balances' \ -H 'X-Revx-API-Key: your_64_char_api_key' \ -H 'X-Revx-Timestamp: 1746007718237' \ -H 'X-Revx-Signature: base64_encoded_ed25519_signature' ``` -------------------------------- ### Merchant API - Create an Order Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Creates payment orders for e-commerce transactions, supporting various payment methods and capture modes. ```APIDOC ## POST /api/orders ### Description Creates payment orders for e-commerce transactions. Supports various payment methods including cards, Revolut Pay, Apple Pay, Google Pay, and bank transfers. Orders can be configured with automatic or manual capture modes. ### Method POST ### Endpoint `/api/orders` ### Parameters #### Query Parameters None #### Request Body - **amount** (integer) - Required - The total amount of the order. - **currency** (string) - Required - The currency of the order (e.g., GBP, EUR). - **description** (string) - Optional - A description of the order. - **capture_mode** (string) - Optional - Specifies whether the order should be captured automatically or manually. Defaults to 'automatic'. - **merchant_order_data** (object) - Optional - Additional data related to the merchant's order. - **url** (string) - Optional - The URL of the order on the merchant's platform. - **reference** (string) - Optional - A unique reference for the order on the merchant's platform. - **customer** (object) - Optional - Information about the customer. - **email** (string) - Optional - The email address of the customer. ### Request Example ```json { "amount": 1000, "currency": "GBP", "description": "Product purchase", "capture_mode": "automatic", "merchant_order_data": { "url": "https://example.com/orders/12345", "reference": "order-12345" }, "customer": { "email": "customer@example.com" } } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier for the order. - **token** (string) - A token associated with the order. - **type** (string) - The type of the order (e.g., 'payment'). - **state** (string) - The current state of the order (e.g., 'pending'). - **created_at** (string) - The timestamp when the order was created. - **updated_at** (string) - The timestamp when the order was last updated. - **amount** (integer) - The total amount of the order. - **currency** (string) - The currency of the order. - **outstanding_amount** (integer) - The remaining amount to be captured. - **capture_mode** (string) - The capture mode of the order. - **checkout_url** (string) - The URL for the customer to complete the payment. #### Response Example ```json { "id": "651a941a-02ef-af6f-9b6c-458c652e2c6a", "token": "0aa685ee-8d86-441d-bedd-3f7fbf41731b", "type": "payment", "state": "pending", "created_at": "2023-10-02T09:57:46.498026Z", "updated_at": "2023-10-02T09:57:46.498026Z", "amount": 1000, "currency": "GBP", "outstanding_amount": 1000, "capture_mode": "automatic", "checkout_url": "https://checkout.revolut.com/payment-link/0aa685ee-8d86-441d-bedd-3f7fbf41731b" } ``` ``` -------------------------------- ### Revolut X API - Place Order Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Places a new limit or market order on the crypto exchange. Supports various execution instructions and requires Ed25519 signed authentication. ```APIDOC ## POST /api/1.0/orders ### Description Place a new limit or market order on the crypto exchange. Supports various execution instructions. ### Method POST ### Endpoint https://revx.revolut.com/api/1.0/orders ### Parameters #### Headers - **X-Revx-API-Key** (string) - Required - Your 64-character API key. - **X-Revx-Timestamp** (string) - Required - The Unix timestamp in milliseconds when the request was generated. - **X-Revx-Signature** (string) - Required - The Base64 encoded Ed25519 signature of the request. - **Content-Type** (string) - Required - Set to `application/json`. #### Request Body - **client_order_id** (string) - Required - A unique identifier for the client's order. - **symbol** (string) - Required - The trading pair (e.g., BTC-USD). - **side** (string) - Required - The order side (`BUY` or `SELL`). - **order_configuration** (object) - Required - Configuration for the order type. - **limit** (object, optional) - Configuration for a limit order. - **base_size** (string) - Required for limit orders - The amount of the base currency to trade. - **price** (string) - Required for limit orders - The limit price. - **market** (object, optional) - Configuration for a market order. - **amount** (string) - Required for market orders - The amount to trade. - **quote_amount** (string) - Required for market orders - The quote amount to trade. ### Request Example (Limit Buy Order) ```json { "client_order_id": "3b364427-1f4f-4f66-9935-86b6fb115d26", "symbol": "BTC-USD", "side": "BUY", "order_configuration": { "limit": { "base_size": "0.1", "price": "90000.10" } } } ``` ``` -------------------------------- ### Manage Active Orders via Revolut X API Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves a list of active orders with optional filtering parameters and provides a method to cancel all currently active orders. ```bash # Get all active orders curl -X GET 'https://revx.revolut.com/api/1.0/orders/active?symbols=BTC-USD,ETH-USD&order_states=new,partially_filled&limit=100' \ -H 'X-Revx-API-Key: your_64_char_api_key' \ -H 'X-Revx-Timestamp: 1746007718237' \ -H 'X-Revx-Signature: base64_encoded_ed25519_signature' # Cancel all active orders curl -X DELETE 'https://revx.revolut.com/api/1.0/orders' \ -H 'X-Revx-API-Key: your_64_char_api_key' \ -H 'X-Revx-Timestamp: 1746007718237' \ -H 'X-Revx-Signature: base64_encoded_ed25519_signature' ``` -------------------------------- ### Create Account Access Consent for Open Banking Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Registers a consent object to define the scope of data access permitted by a Revolut user. Specifies permissions for accounts, balances, and transaction history. ```bash curl -X POST 'https://oba-auth.revolut.com/account-access-consents' \ -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...' \ -H 'x-fapi-financial-id: 001580000103UAvAAM' \ -H 'Content-Type: application/json' \ -d '{ "Data": { "Permissions": [ "ReadAccountsBasic", "ReadAccountsDetail", "ReadBalances", "ReadTransactionsBasic", "ReadTransactionsDetail", "ReadTransactionsCredits", "ReadTransactionsDebits" ], "ExpirationDateTime": "2025-12-02T00:00:00+00:00", "TransactionFromDateTime": "2024-01-01T00:00:00+00:00", "TransactionToDateTime": "2025-12-31T00:00:00+00:00" }, "Risk": {} }' ``` -------------------------------- ### Open Banking API - Create Account Access Consent Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Create a consent to access account data from a Revolut user. Specify permissions for accounts, balances, and transactions. ```APIDOC ## POST /account-access-consents ### Description Create a consent to access account data from a Revolut user. Specify permissions for accounts, balances, and transactions. ### Method POST ### Endpoint https://oba-auth.revolut.com/account-access-consents ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **Data** (object) - Required - Contains the consent details. - **Permissions** (array of strings) - Required - List of permissions requested (e.g., 'ReadAccountsBasic', 'ReadBalances'). - **ExpirationDateTime** (string) - Required - The date and time when the consent expires (ISO 8601 format). - **TransactionFromDateTime** (string) - Optional - The start date for transaction data (ISO 8601 format). - **TransactionToDateTime** (string) - Optional - The end date for transaction data (ISO 8601 format). - **Risk** (object) - Required - Contains risk-related information (can be an empty object `{}`). ### Request Example ```json { "Data": { "Permissions": [ "ReadAccountsBasic", "ReadAccountsDetail", "ReadBalances", "ReadTransactionsBasic", "ReadTransactionsDetail", "ReadTransactionsCredits", "ReadTransactionsDebits" ], "ExpirationDateTime": "2025-12-02T00:00:00+00:00", "TransactionFromDateTime": "2024-01-01T00:00:00+00:00", "TransactionToDateTime": "2025-12-31T00:00:00+00:00" }, "Risk": {} } ``` ### Response #### Success Response (201 Created) - **Data** (object) - Contains the consent details. - **Status** (string) - The current status of the consent (e.g., 'AwaitingAuthorisation'). - **StatusUpdateDateTime** (string) - Timestamp of the last status update. - **CreationDateTime** (string) - Timestamp when the consent was created. - **TransactionToDateTime** (string) - End date for transaction data. - **ExpirationDateTime** (string) - Expiration date of the consent. - **Permissions** (array of strings) - List of granted permissions. - **ConsentId** (string) - Unique identifier for the consent. - **TransactionFromDateTime** (string) - Start date for transaction data. - **Risk** (object) - Risk-related information. - **Links** (object) - Links related to the consent. - **Self** (string) - URL for the consent resource. - **Meta** (object) - Metadata about the response. - **TotalPages** (integer) - Total number of pages for the response. #### Response Example ```json { "Data": { "Status": "AwaitingAuthorisation", "StatusUpdateDateTime": "2024-09-22T11:47:10.366163Z", "CreationDateTime": "2024-09-22T11:47:10.366163Z", "TransactionToDateTime": "2025-12-31T00:00:00+00:00", "ExpirationDateTime": "2025-12-02T00:00:00+00:00", "Permissions": [ "ReadAccountsBasic", "ReadAccountsDetail", "ReadBalances", "ReadTransactionsBasic", "ReadTransactionsDetail" ], "ConsentId": "e0bdfd78-2388-xxxx-xxxx-acc0b84c9210", "TransactionFromDateTime": "2024-01-01T00:00:00+00:00" }, "Risk": {}, "Links": { "Self": "https://oba-auth.revolut.com/account-access-consents" }, "Meta": { "TotalPages": 1 } } ``` ``` -------------------------------- ### Merchant API - Retrieve Orders Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Retrieves a list of orders with support for filtering and pagination. ```APIDOC ## GET /api/1.0/orders ### Description Get a list of orders with filtering and pagination support. Filter by state, date range, customer email, or merchant reference. ### Method GET ### Endpoint `/api/1.0/orders` ### Parameters #### Path Parameters None #### Query Parameters - **state** (string) - Optional - Filter orders by their state (e.g., 'COMPLETED', 'AUTHORISED'). Can be specified multiple times. - **limit** (integer) - Optional - The maximum number of orders to return per page. Defaults to 100. - **from_created_date** (string) - Optional - Filter orders created on or after this date (ISO 8601 format). - **to_created_date** (string) - Optional - Filter orders created on or before this date (ISO 8601 format). - **customer_email** (string) - Optional - Filter orders by customer email. - **merchant_reference** (string) - Optional - Filter orders by merchant reference. ### Request Example ```bash curl -X GET 'https://merchant.revolut.com/api/1.0/orders?state=COMPLETED&state=AUTHORISED&limit=100&from_created_date=2024-01-01T00:00:00Z' ``` ### Response #### Success Response (200 OK) (Response structure for list of orders is not detailed in the provided text, but typically includes an array of order objects.) #### Response Example (Response example for list of orders is not detailed in the provided text.) ``` -------------------------------- ### Retrieve Business Accounts via Revolut Business API Source: https://context7.com/revolut-engineering/revolut-openapi/llms.txt Fetches a list of all business accounts associated with the authenticated entity. Requires a valid Bearer token for authorization. ```bash curl -X GET 'https://b2b.revolut.com/api/1.0/accounts' \ -H 'Authorization: Bearer oa_prod_xxxxxxxxxxxxx' ```