### Get Available Currency Exchange Pairs (Bash) Source: https://context7.com/coinspaid/docs/llms.txt This example shows how to retrieve available currency exchange pairs and their current rates between cryptocurrencies and fiat currencies. The request specifies the 'from' and 'to' currencies and requires authentication. The response includes details on minimum amounts for exchange and the current exchange rate. ```bash curl -X POST "https://app.cryptoprocessing.com/api/v2/currencies/pairs" \ -H "Content-Type: application/json" \ -H "X-Processing-Key: your_public_key" \ -H "X-Processing-Signature: your_signature" \ -d '{"currency_from": "BTC", "currency_to": "EUR"}' # Response: { "data": [ { "currency_from": { "currency": "BTC", "type": "crypto", "min_amount": "0.00300000", "min_amount_deposit_with_exchange": "0.00010000" }, "currency_to": { "currency": "EUR", "type": "fiat" }, "rate_from": "1", "rate_to": "48715.61680000" } ] } ``` -------------------------------- ### Exchange Callback Examples (Buy BTC for EUR, Sell BTC for USD) Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md These examples demonstrate the structure of exchange callbacks. They show the details of currency sent and received, associated transactions, and fees for both buying and selling cryptocurrencies. ```json { "id": 2686900, "type": "exchange", "currency_sent": { "currency": "EUR", "amount": "26.75248865" }, "currency_received": { "currency": "BTC", "amount": "0.00300000" }, "transactions": [ { "id": 715072, "currency": "EUR", "currency_to": "BTC", "transaction_type": "exchange", "type": "exchange", "amount": "26.75248865", "amount_to": "0.00300000" } ], "fees": [ { "type": "exchange", "currency": "EUR", "amount": "0.26752489" } ], "error": "", "status": "confirmed" } ``` ```json { "id": 2686901, "type": "exchange", "currency_sent": { "currency": "BTC", "amount": "0.00300000" }, "currency_received": { "currency": "USD", "amount": "29.50408884" }, "transactions": [ { "id": 715072, "currency": "BTC", "currency_to": "USD", "transaction_type": "exchange", "type": "exchange", "amount": "0.00300000", "amount_to": "29.50408884" } ], "fees": [ { "type": "exchange", "currency": "USD", "amount": "0.29504089" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### Callback Examples for Non-Confirmed and Cancelled Statuses Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md These examples showcase callback structures for transactions that have not been confirmed or have been cancelled. They highlight the 'status' field and potential 'error' messages associated with these states. ```json { "id": 2686579, "type": "deposit", "crypto_address": { "id": 381711, "currency": "BTC", "address": "2N9zXNdiT8ucZp7zZSrucqYGCD6xYF8F3di", "tag": null }, "currency_sent": { "currency": "BTC", "amount": "0.01000000" }, "currency_received": { "currency": "BTC", "amount": "0.01000000", "amount_minus_fee": "0.01000000" }, "transactions": [ { "id": 714680, "currency": "BTC", "transaction_type": "blockchain", "type": "deposit", "address": "2N9zXNdiT8ucZp7zZSrucqYGCD6xYF8F3di", "tag": null, "amount": "0.01000000", "txid": "998c4d9bb7145aafd88658b292f41fe05973c217f7adcd6052bcafe2309e7e02", "confirmations": "0" } ], "fees": [], "error": "", "status": "not_confirmed" } ``` ```json { "id": 2686580, "foreign_id": "123", "type": "withdrawal", "crypto_address": { "id": 382362, "currency": "ETH", "address": "12345", "tag": null }, "transactions": [ { "id": 714681, "currency": "ETH", "transaction_type": "blockchain", "type": "withdrawal", "address": "12345", "tag": null, "amount": "1.00000000", "txid": null, "confirmations": "0" } ], "fees": [], "error": "Invalid params: expected a hex-encoded hash with 0x prefix.", "status": "cancelled" } ``` -------------------------------- ### BTC Deposit with Exchange to EUR Callback Example Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md Example JSON payload for a deposit callback where BTC is deposited and immediately exchanged to EUR. This highlights the `deposit_exchange` type and shows both the crypto sent and fiat received amounts. ```json { "id": 2686510, "type": "deposit_exchange", "crypto_address": { "id": 382270, "currency": "BTC", "convert_to": "EUR", "address": "31vnLqxVJ1iShJ5Ly586q8XKucECx12bZS", "tag": null, "foreign_id": "13a" }, "currency_sent": { "currency": "BTC", "amount": "0.01000000" }, "currency_received": { "currency": "EUR", "amount": "84.17070222", "amount_minus_fee": "79.96216711" }, "transactions": [ { "id": 714576, "currency": "BTC", "transaction_type": "blockchain", "type": "deposit", "address": "31vnLqxVJ1iShJ5Ly586q8XKucECx12bZS", "tag": null, "amount": "0.01000000", "txid": "3a491da90a1ce5a318d0aeff6867ab98a03219abae29ed68d702291703c3538b", "riskscore": "0.42", "confirmations": "1" }, { "id": 714577, "currency": "BTC", "currency_to": "EUR", "amount": "0.01000000" } ] } ``` -------------------------------- ### Test API Connection with Ping Endpoint (Bash) Source: https://context7.com/coinspaid/docs/llms.txt This command-line example shows how to test the API connection and authorization status using the 'ping' endpoint. It utilizes `curl` to send a GET request, including necessary headers for content type, processing key, and the HMAC-SHA512 signature. The expected response for a successful connection is 'OK'. ```bash curl -X GET "https://app.cryptoprocessing.com/api/v2/ping" \ -H "Content-Type: application/json" \ -H "X-Processing-Key: your_public_key" \ -H "X-Processing-Signature: $(echo -n '{}' | openssl dgst -sha512 -hmac 'your_secret_key' | awk '{print $2}')" # Response: OK ``` -------------------------------- ### Futures Callback Example (Buy BTC for ETH) Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md This example illustrates the structure of a futures callback, detailing a transaction where BTC is bought using ETH. It includes information about the crypto address, currencies sent and received, multiple transaction types (blockchain and exchange), and associated fees. ```json { "id":2688873, "type":"deposit_exchange", "crypto_address":{ "id":384708, "currency":"ETH", "convert_to":"BTC", "address":"0x4b41a526d3d12de36bdf969e7b70fd0bd2e0d263", "tag":null, "foreign_id":"hfjs781" }, "currency_sent":{ "currency":"ETH", "amount":"0.11129846" }, "currency_received":{ "currency":"BTC", "amount":"0.00300000", "amount_minus_fee":"0.00299944" }, "transactions":[ { "id":717555, "currency":"ETH", "transaction_type":"blockchain", "type":"deposit", "address":"0x4b41a526d3d12de36bdf969e7b70fd0bd2e0d263", "tag":null, "amount":"0.11129846", "txid":"0x19f8094e12dfc6cb14910d6057269d10f39dfdc7c8b0d0e22b789c3e5d03b9e5", "confirmations":"13" }, { "id":717556, "currency":"ETH", "currency_to":"BTC", "transaction_type":"exchange", "type":"exchange", "amount":"0.11129846", "amount_to":"0.00300000" } ], "fees":[ { "type":"transfer", "currency":"BTC", "amount":"0.00000056" }, { "type":"exchange", "currency":"ETH", "amount":"0.00667791" } ], "error":"", "status":"confirmed", "futures_id":95, "transaction_id":2688873 } ``` -------------------------------- ### EUR Withdrawal with Exchange to BTC Callback Example Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md This example details a withdrawal of EUR that is subsequently exchanged to BTC. The callback includes separate transaction entries for the exchange operation and the final BTC withdrawal to the blockchain address. ```json { "id": 1, "foreign_id": "20", "type": "withdrawal_exchange", "crypto_address": { "id": 1, "currency": "EUR", "convert_to": "BTC", "address": "1K2btnZ8cqNFBPhaq729Mdj8W6G3w2nBbL", "tag": null }, "currency_sent": { "currency": "EUR", "amount": "381" }, "currency_received": { "currency": "BTC", "amount": "0.10882300" }, "transactions": [ { "id": 1, "currency": "EUR", "currency_to": "BTC", "transaction_type": "exchange", "type": "exchange", "amount": 381, "amount_to": 0.10882300 }, { "id": 1, "currency": "BTC", "transaction_type": "blockchain", "type": "withdrawal", "address": "1K2btnZ8cqNFBPhaq729Mdj8W6G3w2nBbL", "tag": null, "amount": 0.10882300, "txid": "aa3345b96389e126f1ce88a670d1b1e38f2c3f73fb3ecfff8d9da1b1ce6964a6", "confirmations": 3 } ], "fees": [ { "type": "exchange", "currency": "EUR", "amount": "3.04800000" }, { "type": "mining", "currency": "EUR", "amount": "0.00007402" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### API Reference Source: https://github.com/coinspaid/docs/blob/master/SUMMARY.md This section provides a detailed reference for all available API endpoints, including their methods, parameters, request examples, and response structures. ```APIDOC ## API Reference This section provides a detailed reference for all available API endpoints, including their methods, parameters, request examples, and response structures. ### GET /api/v1/some-endpoint #### Description Retrieves information about a specific resource. #### Method GET #### Endpoint /api/v1/some-endpoint #### Query Parameters - **id** (integer) - Required - The unique identifier of the resource. #### Request Example (No request body for GET requests) #### Response #### Success Response (200) - **data** (object) - Contains the requested resource information. - **name** (string) - The name of the resource. - **value** (integer) - The value associated with the resource. #### Response Example ```json { "data": { "name": "Example Resource", "value": 123 } } ``` ### POST /api/v1/another-endpoint #### Description Creates a new resource. #### Method POST #### Endpoint /api/v1/another-endpoint #### Request Body - **name** (string) - Required - The name for the new resource. - **description** (string) - Optional - A description for the new resource. ### Request Example ```json { "name": "New Resource", "description": "This is a newly created resource." } ``` #### Response #### Success Response (201) - **id** (integer) - The unique identifier of the newly created resource. - **message** (string) - A confirmation message. #### Response Example ```json { "id": 456, "message": "Resource created successfully." } ``` ``` -------------------------------- ### ETH Deposit Callback Example Source: https://github.com/coinspaid/docs/blob/master/api-documentation/callbacks.md Example JSON payload for an ETH deposit callback. This payload includes details about the deposit, transaction, and fees. ```json { "id": 2686563, "type": "deposit", "crypto_address": { "id": 381738, "currency": "ETH", "address": "0xd61180ff0cf74dc3ee8e264751f18c47060729b9", "tag": null, "foreign_id": "991904" }, "currency_sent": { "currency": "ETH", "amount": "0.01000000" }, "currency_received": { "currency": "ETH", "amount": "0.01000000", "amount_minus_fee": "0.00939500" }, "transactions": [ { "id": 714657, "currency": "ETH", "transaction_type": "blockchain", "type": "deposit", "address": "0xd61180ff0cf74dc3ee8e264751f18c47060729b9", "tag": null, "amount": "0.01000000", "txid": "0x6b353da88a8ba2df4926c1ccc58991f484a683ba57ec3dde70e812b5c8c7fa1d", "confirmations": "9" } ], "fees": [ { "type": "transfer", "currency": "ETH", "amount": "0.00010500" }, { "type": "deposit", "currency": "ETH", "amount": "0.00050000" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### BTC Deposit Callback Example Source: https://github.com/coinspaid/docs/blob/master/api-documentation/callbacks.md Example JSON payload for a BTC deposit callback. This payload includes details about the deposit, transaction, and fees. ```json { "id": 1, "type": "deposit", "crypto_address": { "id": 1, "currency": "BTC", "address": "39mFf3X46YzUtfdwVQpYXPCMydc74ccbAZ", "foreign_id": "user-id:2048", "tag": null }, "currency_sent": { "currency": "BTC", "amount": "6.53157512" }, "currency_received": { "currency": "BTC", "amount": "6.53157512", "amount_minus_fee": "6.5119800" }, "transactions": [ { "id": 1, "currency": "BTC", "transaction_type": "blockchain", "type": "deposit", "address": "39mFf3X46YzUtfdwVQpYXPCMydc74ccbAZ", "tag": null, "amount": "6.53157512", "txid": "3950ad8149421a850d01dff88f024810e363ac18c9e8dd9bc0b9116e7937ad93", "riskscore": "0.5", "confirmations": 3 } ], "fees": [ { "type": "deposit", "currency": "BTC", "amount": "0.01959472" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### Exchange Callbacks Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md Callbacks related to currency exchange operations, showing buy and sell examples. ```APIDOC ## Exchange Callbacks ### Buy BTC for EUR #### Description This callback details the result of buying Bitcoin (BTC) for Euros (EUR). #### Method POST (Callback) #### Endpoint `/webhooks/exchange` #### Request Body ```json { "id": 2686900, "type": "exchange", "currency_sent": { "currency": "EUR", "amount": "26.75248865" }, "currency_received": { "currency": "BTC", "amount": "0.00300000" }, "transactions": [ { "id": 715072, "currency": "EUR", "currency_to": "BTC", "transaction_type": "exchange", "type": "exchange", "amount": "26.75248865", "amount_to": "0.00300000" } ], "fees": [ { "type": "exchange", "currency": "EUR", "amount": "0.26752489" } ], "error": "", "status": "confirmed" } ``` #### Response (Callbacks are typically not responded to by the receiving server in a structured way, but acknowledge receipt) #### Response Example HTTP 200 OK ``` ```APIDOC ### Sell BTC for USD #### Description This callback details the result of selling Bitcoin (BTC) for US Dollars (USD). #### Method POST (Callback) #### Endpoint `/webhooks/exchange` #### Request Body ```json { "id": 2686901, "type": "exchange", "currency_sent": { "currency": "BTC", "amount": "0.00300000" }, "currency_received": { "currency": "USD", "amount": "29.50408884" }, "transactions": [ { "id": 715072, "currency": "BTC", "currency_to": "USD", "transaction_type": "exchange", "type": "exchange", "amount": "0.00300000", "amount_to": "29.50408884" } ], "fees": [ { "type": "exchange", "currency": "USD", "amount": "0.29504089" } ], "error": "", "status": "confirmed" } ``` #### Response (Callbacks are typically not responded to by the receiving server in a structured way, but acknowledge receipt) #### Response Example HTTP 200 OK ``` -------------------------------- ### Get List of Balances Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Retrieves a list of all account balances, including those with zero balance. The response includes currency, type, and balance amount for each entry. ```HTTP POST /v2/accounts/list ``` ```JSON { "data": [ { "currency": "DOGE", "type": "crypto", "balance": "13234.91276375" }, { "currency": "ADA", "type": "crypto" } ] } ``` -------------------------------- ### Get Account Balances Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md Retrieves a list of all available balances across your accounts, including those with zero balances. The response details the currency and its corresponding balance. ```HTTP POST https://app.coinspaid.com/api/v2/accounts/list ``` ```JSON { "data": [ { "currency": "DOGE", "type": "crypto", "balance": "13234.91276375" } ] } ``` -------------------------------- ### Successful Currency Exchange Response Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md An example of a successful response after initiating a currency exchange. It includes details like transaction ID, amounts, currencies, and address information. ```json { "data": { "futures_id": 92, "sender_currency": "BTC", "receiver_currency": "USD", "fee_currency": "USD", "price": "10299.94946000", "address": { "id": 384620, "currency": "BTC", "convert_to": "USD", "address": "3GQwSBQErsQ863RcuvCkub6SZBPHKuwSV7", "tag": null, "foreign_id": "ds23fgk" }, "sender_amount": "0.00292", "receiver_amount": "30.00000000", "fee_amount": "1.50000000", "ts_fixed": 1581506566, "ts_release": 1581512566 } } ``` -------------------------------- ### ERC20 Deposit Callback Example Source: https://github.com/coinspaid/docs/blob/master/api-documentation/callbacks.md Example JSON payload for an ERC20 token deposit callback. This payload includes details specific to ERC20 tokens like NNM. ```json { "id": 2686567, "type": "deposit", "crypto_address": { "id": 382357, "currency": "NNM", "address": "0x19722627885da3fff134dd36de0a14898c8e053b", "tag": null, "foreign_id": "31" }, "currency_sent": { "currency": "NNM", "amount": "0.06000000" }, "currency_received": { "currency": "NNM", "amount": "0.06000000", "amount_minus_fee": "0.05910000" }, "transactions": [ { "id": 714662, "currency": "NNM", "transaction_type": "blockchain", "type": "deposit", "address": "0x19722627885da3fff134dd36de0a14898c8e053b", "tag": null, "amount": "0.06000000", "txid": "0x835c9f286a311bc9df8c94c2771cadf1d91e6967039358a44e24c56115dc59a1", "confirmations": "7" } ], "fees": [ { "type": "transfer", "currency": "ETH", "amount": "0.00037336" }, { "type": "deposit", "currency": "NNM", "amount": "0.00090000" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### POST /v2/exchange/now Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Executes an exchange immediately at the current market rate, without requiring a pre-calculated price. ```APIDOC ## POST /v2/exchange/now ### Description Make an exchange without mentioning the price. The exchange will be executed at the current market rate. ### Method POST ### Endpoint https://app.cryptoprocessing.com/api/v2/exchange/now ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sender_currency** (string) - Required - Currency ISO you want to exchange (e.g., "EUR"). - **receiver_currency** (string) - Required - Currency ISO to be exchanged (e.g., "BTC"). - **sender_amount** (numeric) - Optional - Amount you want to exchange (e.g., "2"). Required when `receiver_amount` is absent. - **receiver_amount** (numeric) - Optional - Amount you want to exchange (e.g., "2"). Required when `sender_amount` is absent. - **foreign_id** (string) - Optional - Unique foreign ID in your system. ### Request Example ```json { "sender_currency": "EUR", "receiver_currency": "BTC", "sender_amount": "2" } ``` ### Response #### Success Response (201) - **data** (object) - Contains details of the executed exchange. - **id** (integer) - The unique ID of the exchange. - **foreign_id** (string) - The foreign ID provided in the request. - **type** (string) - The type of transaction (e.g., "exchange"). - **sender_amount** (string) - The amount sent. - **sender_currency** (string) - The currency sent. - **receiver_amount** (string) - The amount received. - **receiver_currency** (string) - The currency received. - **fee_amount** (string) - The fee amount. - **fee_currency** (string) - The currency of the fee. - **price** (string) - The exchange rate used. - **status** (string) - The status of the exchange (e.g., "processing"). #### Response Example (Success) ```json { "data": { "id": 2687668, "foreign_id": "knwi24op10", "type": "exchange", "sender_amount": "0.01", "sender_currency": "EUR", "receiver_amount": "0.0000015", "receiver_currency": "BTC", "fee_amount": "0.0000001", "fee_currency": "EUR", "price": "6666.66666666", "status": "processing" } } ``` ``` -------------------------------- ### POST /v2/invoices/create Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/invoices.md Creates a new invoice for a client with a specified amount and currency. Includes options for setting a timer for payment, descriptions, and redirect URLs for success and failure scenarios. ```APIDOC ## POST /v2/invoices/create ### Description Create invoice for the client for a specified amount. ### Method POST ### Endpoint https://app.coinspaid.com/api/v2/invoices/create ### Parameters #### Request Body - **timer** (boolean) - Required - Time on the rate is fixed for invoice payment (15 minutes). During this time the user has to pay an invoice. - **title** (string) - Required - Invoice title that will be displayed to the user - **description** (string) - Optional - Invoice description that will be displayed to the user - **currency** (string) - Required - ISO invoice currency that you want to receive from the user, for example: "EUR" - **sender_currency** (string) - Optional - Currency of user invoice payment (3rd type invoice will be externalized at the time of sending this parameter with timer= true), example: "BTC" - **amount** (integer) - Required - Invoice amount that you want to receive from the user, example: "106.75" - **foreign_id** (string) - Required - Unique foreign ID in your system, example: "164" - **url_success** (string) - Required - URL on which we redirect the user in case of a successful invoice payment, example: "https://merchant.name.com/url_success" - **url_failed** (string) - Required - URL on which we redirect the user in case of an unsuccessful invoice payment, example: "https://merchant.name.com/url_failed" - **email_user** (string) - Required - In case the payment amount does not match the amount stated above, we will send an email to the stated address with instructions on funds recovery. In case of underpayment, the whole amount will be refunded. In case of overpayment, user will be able to recover the difference by following the instructions. ### Request Example ```json { "timer": true, "title": "Invoice Title", "description": "Optional invoice description", "currency": "EUR", "sender_currency": "BTC", "amount": 106.75, "foreign_id": "164", "url_success": "https://merchant.name.com/url_success", "url_failed": "https://merchant.name.com/url_failed", "email_user": "user@example.com" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the details of the created invoice. - **id** (integer) - The unique identifier for the invoice. - **url** (string) - The URL to the invoice payment page. - **foreign_id** (integer) - The foreign ID associated with the invoice. - **name** (string) - The title of the invoice. - **status** (string) - The current status of the invoice (e.g., "created"). - **currency** (string) - The currency of the invoice. - **amount** (string) - The amount of the invoice. - **sender_currency** (string) - The currency the sender will pay in. - **sender_amount** (null) - The amount the sender will pay (null if not applicable). - **fixed_at** (integer) - Timestamp when the rate was fixed. - **release_at** (integer) - Timestamp when the payment is due. #### Response Example ```json { "data":{ "id":79, "url":"https://app.coinspaid.com/invoice/RB9NZv", "foreign_id":164, "name":"TEST NAME", "status":"created", "currency":"EUR", "amount":"106.75", "sender_currency":"BTC", "sender_amount":null, "fixed_at":1581929889, "release_at":1581930789 } } ``` #### Error Response (400) - **errors** (object) - Contains error messages related to the request. - **[field_name]** (string) - Description of the error for a specific field. #### Response Example ```json { "errors":{ "foreign_id":"The foreign id has already been taken." } } ``` ``` -------------------------------- ### Deposit with Exchange Flow Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Describes how to accept cryptocurrency deposits and have them instantly converted to fiat currency. ```APIDOC ## Deposit with Exchange Flow ### Description Describes how to accept cryptocurrency deposits and have them instantly converted to fiat currency. 1. Obtain a new address from the CoinsPaid API, similar to the regular deposit flow. Additionally, specify the `convert_to` parameter with the desired resulting currency. 2. When a deposit arrives, CoinsPaid automatically converts the funds to the specified destination currency. Notifications are sent as in the regular deposit flow. ``` -------------------------------- ### BTC Deposit with Exchange to EUR Callback Example Source: https://github.com/coinspaid/docs/blob/master/api-documentation/callbacks.md Example JSON payload for a BTC deposit that is exchanged to EUR. This callback includes details about both the cryptocurrency sent and the fiat currency received. ```json { "id": 2686510, "type": "deposit_exchange", "crypto_address": { "id": 382270, "currency": "BTC", "convert_to": "EUR", "address": "31vnLqxVJ1iShJ5Ly586q8XKucECx12bZS", "tag": null, "foreign_id": "13a" }, "currency_sent": { "currency": "BTC", "amount": "0.01000000" }, "currency_received": { "currency": "EUR", "amount": "84.17070222", "amount_minus_fee": "79.96216711" }, "transactions": [ { "id": 714576, "currency": "BTC", "transaction_type": "blockchain", "type": "deposit", "address": "31vnLqxVJ1iShJ5Ly586q8XKucECx12bZS", "tag": null, "amount": "0.01000000", "txid": "3a491da90a1ce5a318d0aeff6867ab98a03219abae29ed68d702291703c3538b", "riskscore": "0.42", "confirmations": "1" }, { "id": 714577, "currency": "BTC", "currency_to": "EUR", "transaction_type": "exchange", "type": "deposit", "amount": "0.01000000" } ], "fees": [ { "type": "exchange", "currency": "EUR", "amount": "4.20853511" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### General Information Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Provides the base API endpoints for both production and sandbox environments. ```APIDOC ## General Information ### Description Provides the base API endpoints for both production and sandbox environments. ### Production Environment `https://app.cryptoprocessing.com/api/v2` ### Sandbox Environment `https://app.sandbox.cryptoprocessing.com/api/v2` ``` -------------------------------- ### Deposit Flow Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Explains the process of receiving cryptocurrency deposits, including obtaining an address and handling callbacks. ```APIDOC ## Deposit Flow ### Description Explains the process of receiving cryptocurrency deposits, including obtaining an address and handling callbacks. 1. Obtain a new address from the CoinsPaid API (may include an address and tag for some currencies). Store this address on your side and present it to your customer for deposit. 2. The customer sends funds to the provided address. 3. Upon receiving the transaction, CoinsPaid sends a callback to your specified callback URL with transaction details (status, address, currency, amount, fees). If the status is successful, credit the customer's balance on your side. ``` -------------------------------- ### GET /v2/ping Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Checks if the API is operational and if your authorization is correctly configured. ```APIDOC ## GET /v2/ping ### Description Test if API is up and running and your authorization is working ### Method GET ### Endpoint /v2/ping ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **OK** (string) - Indicates a successful response. #### Response Example ``` OK ``` ``` -------------------------------- ### GET /v2/currencies/pairs Source: https://github.com/coinspaid/docs/blob/master/integration-guide/deposits.md Retrieves information about current exchange rates for different currency pairs. ```APIDOC ## GET /v2/currencies/pairs ### Description This endpoint provides real-time exchange rate information for various currency pairs supported by the platform. It's useful for displaying current market values to users or for internal reference. ### Method GET ### Endpoint /v2/currencies/pairs ### Parameters #### Query Parameters - **currency_pair** (string) - Optional - Filter results by a specific currency pair (e.g., BTCUSD). If not provided, all available pairs are returned. ### Request Example ```json { "currency_pair": "ETHUSD" } ``` ### Response #### Success Response (200) - **pairs** (array) - An array of objects, where each object represents a currency pair and its current exchange rate. - **from_currency** (string) - The base currency of the pair. - **to_currency** (string) - The quote currency of the pair. - **rate** (number) - The current exchange rate. #### Response Example ```json { "pairs": [ { "from_currency": "BTC", "to_currency": "USD", "rate": 50000.50 }, { "from_currency": "ETH", "to_currency": "USD", "rate": 3000.75 } ] } ``` ``` -------------------------------- ### Retrieve Supported Currencies List (Bash) Source: https://context7.com/coinspaid/docs/llms.txt Demonstrates how to fetch a list of all supported cryptocurrencies and fiat currencies from the CoinsPaid API. This includes details like minimum transaction amounts, deposit and withdrawal fee percentages, and precision. The request is made using `curl` with POST method and requires authentication headers. ```bash curl -X POST "https://app.cryptoprocessing.com/api/v2/currencies/list" \ -H "Content-Type: application/json" \ -H "X-Processing-Key: your_public_key" \ -H "X-Processing-Signature: your_signature" \ -d '{}' # Response: { "data": [ { "id": 1, "type": "crypto", "currency": "BTC", "minimum_amount": "0.001", "deposit_fee_percent": "0.99", "withdrawal_fee_percent": "0", "precision": 8 }, { "id": 2, "type": "crypto", "currency": "ETH", "minimum_amount": "0.01", "deposit_fee_percent": "0.99", "withdrawal_fee_percent": "0", "precision": 8 } ] } ``` -------------------------------- ### POST /exchange Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/README.md This endpoint allows you to initiate a currency exchange. You provide the desired exchange details, and the API will return information about the transaction, including amounts, fees, and addresses. ```APIDOC ## POST /exchange ### Description Initiates a currency exchange operation. This endpoint is used to specify the details of the exchange, such as the sender and receiver currencies, the amount, and the destination address. ### Method POST ### Endpoint /exchange ### Parameters #### Request Body - **address** (string) - Required - The exchange address for which you want to confirm futures. - **sender_currency** (string) - Required - The currency ISO you want to exchange (e.g., "BTC"). - **receiver_currency** (string) - Required - The currency ISO you want to receive (e.g., "EUR"). - **receiver_amount** (string) - Required - The amount you want to receive. ### Request Example ```json { "address": "3GQwSBQErsQ863RcuvCkub6SZBPHKuwSV7", "sender_currency": "BTC", "receiver_currency": "USD", "receiver_amount": "30.00000000" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the details of the exchange transaction. - **futures_id** (integer) - The unique identifier for the futures contract. - **sender_currency** (string) - The ISO code of the currency being sent. - **receiver_currency** (string) - The ISO code of the currency being received. - **fee_currency** (string) - The ISO code of the currency used for fees. - **price** (string) - The exchange rate. - **address** (object) - Details of the destination address. - **id** (integer) - The unique identifier for the address. - **currency** (string) - The currency of the address. - **convert_to** (string) - The currency to which the funds will be converted. - **address** (string) - The destination wallet address. - **tag** (string) - Optional tag for the address. - **foreign_id** (string) - An external identifier for the address. - **sender_amount** (string) - The amount of the sender currency to be sent. - **receiver_amount** (string) - The amount of the receiver currency to be received. - **fee_amount** (string) - The amount of the fee. - **ts_fixed** (integer) - Timestamp when the transaction was fixed. - **ts_release** (integer) - Timestamp when the transaction is to be released. #### Response Example ```json { "data": { "futures_id": 92, "sender_currency": "BTC", "receiver_currency": "USD", "fee_currency": "USD", "price": "10299.94946000", "address": { "id": 384620, "currency": "BTC", "convert_to": "USD", "address": "3GQwSBQErsQ863RcuvCkub6SZBPHKuwSV7", "tag": null, "foreign_id": "ds23fgk" }, "sender_amount": "0.00292", "receiver_amount": "30.00000000", "fee_amount": "1.50000000", "ts_fixed": 1581506566, "ts_release": 1581512566 } } ``` #### Error Response (400) - **errors** (object) - Contains details about the error. - **address** (string) - Description of the error related to the address or currencies. #### Response Example ```json { "errors": { "address": "Address is not found, incorrect or without exchange. Error can be related to incorrect sender or receiver currencies." } } ``` ``` -------------------------------- ### Exchange Transaction Error Response Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Example of an error response for an exchange transaction, indicating an issue with the sender amount. ```json { "errors": { "sender_amount": "The amount must be at least 0.00300000 " } } ``` -------------------------------- ### Create Invoice API Request (POST /v2/invoices/create) Source: https://github.com/coinspaid/docs/blob/master/api-documentation/v2/invoices.md This snippet demonstrates how to create an invoice using the Coinspaid API. It requires parameters such as amount, currency, foreign_id, and redirect URLs. The 'timer' parameter controls the payment window. ```typescript { "timer": true, "title": "Invoice Title", "description": "Invoice Description", "currency": "EUR", "sender_currency": "BTC", "amount": 106.75, "foreign_id": "164", "url_success": "https://merchant.name.com/url_success", "url_failed": "https://merchant.name.com/url_failed", "email_user": "user@example.com" } ``` -------------------------------- ### Get Account Balances Source: https://context7.com/coinspaid/docs/llms.txt Retrieve all currency balances for your merchant account including zero balances. ```APIDOC ## POST /api/v2/accounts/list ### Description Retrieve all currency balances for your merchant account, including those with zero balances. ### Method POST ### Endpoint `/api/v2/accounts/list` ### Parameters #### Query Parameters None #### Request Body - **None**: This endpoint does not require a request body. ### Request Example ```bash curl -X POST "https://app.cryptoprocessing.com/api/v2/accounts/list" \ -H "Content-Type: application/json" \ -H "X-Processing-Key: your_public_key" \ -H "X-Processing-Signature: your_signature" \ -d '{}' ``` ### Response #### Success Response (200) - **data** (array) - An array of balance objects. - **currency** (string) - The currency code (e.g., BTC, EUR). - **type** (string) - The type of currency ('crypto' or 'fiat'). - **balance** (string) - The available balance for the currency. #### Response Example ```json { "data": [ {"currency": "BTC", "type": "crypto", "balance": "1.25000000"}, {"currency": "ETH", "type": "crypto", "balance": "15.50000000"}, {"currency": "EUR", "type": "fiat", "balance": "5973.97568920"}, {"currency": "USDT", "type": "crypto", "balance": "0.00000000"} ] } ``` ``` -------------------------------- ### Invoice Creation Error Responses Source: https://github.com/coinspaid/docs/blob/master/api-documentation/api-reference.md Examples of error responses when creating an invoice. These can occur due to duplicate foreign IDs or insufficient amounts. ```json { "errors":{ "foreign_id":"The foreign id has already been taken." } }; { "errors": { "amount": "The amount is too small. The minimum amount is 10.00 EUR." } } ```