### API Response Example (200 OK) Source: https://docs.confirmo.net/reference/merchant-balance This is an example of a successful response (HTTP 200 OK) when retrieving merchant balances. It returns an array of objects, each representing a currency balance with details like blocked amount, last update time, and outstanding balance. ```json [ { "blocked": 10.5, "currency": "EUR", "lastUpdateAt": 1484055304, "outstandingBalance": 10.5, "settlementMethodExists": true } ] ``` -------------------------------- ### Invoice API Endpoint Example Source: https://docs.confirmo.net/reference/confirmtakeunderpaymentrequest-1 This is an example of how to interact with the Confirmo API to retrieve invoices. Remember to include your API key in the Authorization header. ```APIDOC ## GET /api/v3/invoices ### Description Retrieves a list of invoices from the Confirmo service. ### Method GET ### Endpoint /api/v3/invoices ### Parameters #### Query Parameters - **api_key** (string) - Required - Your Confirmo API key for authentication. ### Request Example ```bash curl https://confirmo.net/api/v3/invoices \ -H 'Authorization: Bearer YOUR_API_KEY' ``` ### Response #### Success Response (200) - **invoices** (array) - A list of invoice objects. - **id** (string) - The unique identifier for the invoice. - **status** (string) - The current status of the invoice. - **amount** (number) - The total amount of the invoice. - **currency** (string) - The currency of the invoice amount. #### Response Example ```json { "invoices": [ { "id": "inv_12345", "status": "paid", "amount": 100.50, "currency": "USD" }, { "id": "inv_67890", "status": "pending", "amount": 75.00, "currency": "EUR" } ] } ``` ``` -------------------------------- ### Example of SHA256 Signature Generation (Node.js) Source: https://docs.confirmo.net/reference/placetakerequest-1 Example demonstrating how to generate the SHA256 signature for webhook validation using Node.js. It uses the 'crypto' module to create the hash. ```javascript const crypto = require('crypto'); // Example data (replace with actual response body and callback password) const responseBody = '{"address":"P3n6Ul5FsSd59xfbzdD2VN3HHycIddjpc","cryptoUri":"bitcoin:P3n6Ul5FsSd59xfbzdD2VN3HHycIddjpc?amount=0.00779057","createAtTime":1509525927,"serverTime":1509525927,"timeoutTime":1509526226,"id":"inv57dkwrrdw","url":"https://confirmo.net/public/invoice/inv57dkwrrdw","reference":"{\"customerEmail\":\"customer@example.com\", \"orderNumber\": 123, \"customerName\": \"Customer Name\"}","returnUrl":"http://yourEShop.com/thankYourForYourOrder","notifyUrl":"https://yourEShop.com/orderReceived","notifyEmail":"notify@email.com","product":{"name":"pName","description":"pDesc"},"status":"active","rate":{"currency":"EUR","currencyX":"BTC","rate":"6418.02"},"txids":[],"invoice":{"amount":"50.00","currency":"EUR"},"crypto":{"amount":"0.00779057","currency":"BTC"},"invoiceSettlements":[],"refunds":[],"paid":{"amount":"0.00000000","currency":"BTC","diff":"-0.00779057"},"flags":{"split":false,"autoUnderpayment":false,"refundable":false},"paidAtTime":0,"completedAtTime":0,"settlementMethodCurrency":"CZK","confirmations":0,"requiredConfirmations":2,"exception":[]}'; const callbackPassword = 'azLlmIpWHM9NJbMe'; // Concatenate response body and callback password const hashInput = responseBody + callbackPassword; // Create SHA256 hash and get hexadecimal representation const signature = crypto.createHash('sha256').update(hashInput).digest('hex'); console.log(`Generated Signature: ${signature}`); // Expected output: 08468c5b3af81ca14fe5a3b40703773175cba2cc3ef8700e62e943edd4cba3ee ``` -------------------------------- ### API Key Usage Example Source: https://docs.confirmo.net/reference/createemailinvoice-1 This example demonstrates how to use your API key for authentication when making requests to the Confirmo API. Ensure you replace `{YOUR_API_KEY}` with your actual API key. ```APIDOC ## API Key Usage ### Description Each request made from outside the application must include an `Authorization` header containing a valid API key token. This example shows how to include the header using `curl`. ### Method GET (example for fetching invoices) ### Endpoint `https://confirmo.net/api/v3/invoices` ### Headers - **Authorization** (string) - Required - The API key in the format `Bearer {YOUR_API_KEY}`. ### Request Example ```bash curl https://confirmo.net/api/v3/invoices -H 'Authorization: Bearer {YOUR_API_KEY}' ``` ``` -------------------------------- ### API Key Usage Example Source: https://docs.confirmo.net/reference/getsettlementsformerchant-1 This example demonstrates how to use an API key for authentication when making requests to the Confirmo API. It shows a `curl` command to fetch invoices. ```APIDOC ## API Key Usage ### Description Each request made from the outside of the application must include an `Authorization` header containing a valid API key token. ### Method GET ### Endpoint `/api/v3/invoices` ### Parameters #### Header Parameters - **Authorization** (string) - Required - Bearer token with your API key. ### Request Example ```bash curl https://confirmo.net/api/v3/invoices -H 'Authorization: Bearer {YOUR_API_KEY}' ``` ``` -------------------------------- ### Example JSON Response for Invoices Source: https://docs.confirmo.net/reference/invoice This is an example of a successful JSON response (HTTP 200) when fetching invoices from the Confirmo.net API. It includes details for a single invoice, such as 'activeSince', 'address', 'customerAmount', and 'cryptoTransactions'. ```json { "data": [ { "activeSince": 1506080071, "address": "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy", "buttonInvoiceId": "paby8ngx1eox", "closedAt": 1506080071, "confirmations": 0, "confirmingSince": 1506080071, "createdAt": 1506080071, "cryptoTransactions": [ { "amount": 1.21, "confirmations": 6, "createdAt": 1594376981, "sourceAddresses": [ "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy" ], "txid": "4f13bc54e8df1620f98934078caaa59c7b480f3ed64e9838f5af519f311bb0b1", "updatedAt": 1594376981 } ], "cryptoUri": "litecoin:mnLU9vBK7L1WY6JNnGYY...Jdjwfnti4Cu9xz?amount=1.00000000", "customerAmount": { "amount": 1000, "currency": "EUR" }, "customerEmail": "customerEmail@email.com", "emailInvoiceId": "emi4og3r6g3w", "errorSince": 1506080071, "expiredSince": 1506080071, "fee": 1.1e-7, "flags": { "notRefundableCause": "REFUND_AMOUNT_ZERO", "overpaymentResolvable": true, "refundable": false, "resolvableStatus": "YES", "resolvableSubStatus": "OVERPAID_NOT_ENOUGH_TO_COVER_NETWORK_FEE" } } ] } ``` -------------------------------- ### cURL GET Request to Fetch Invoices Source: https://docs.confirmo.net/reference/invoice This snippet demonstrates how to make a GET request to the Confirmo.net API to retrieve a list of invoices, sorted by creation date in ascending order. It includes the necessary URL and accept header. ```shell curl --request GET \ --url 'https://confirmo.net/api/v3/invoices?order=createdAt%2Casc' \ --header 'accept: application/json' ``` -------------------------------- ### Example of SHA256 Signature Generation (PHP) Source: https://docs.confirmo.net/reference/placetakerequest-1 Example demonstrating how to generate the SHA256 signature for webhook validation using PHP. It concatenates the response body with the callback password and then applies the SHA256 hash function. ```php ``` -------------------------------- ### GET /websites/confirmo_net/payment_methods Source: https://docs.confirmo.net/reference/listcryptopaymentmethods-1 Retrieves a list of all crypto payment methods configured for the merchant's website. ```APIDOC ## GET /websites/confirmo_net/payment_methods ### Description Returns a list of merchant's Crypto Payment Methods. ### Method GET ### Endpoint /websites/confirmo_net/payment_methods ### Parameters #### Query Parameters (No query parameters defined) #### Path Parameters (No path parameters defined) ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **payment_methods** (array) - A list of available crypto payment methods. - **id** (string) - The unique identifier for the payment method. - **name** (string) - The name of the payment method (e.g., 'Bitcoin', 'Ethereum'). - **symbol** (string) - The currency symbol for the payment method (e.g., 'BTC', 'ETH'). #### Response Example ```json { "payment_methods": [ { "id": "btc", "name": "Bitcoin", "symbol": "BTC" }, { "id": "eth", "name": "Ethereum", "symbol": "ETH" } ] } ``` ``` -------------------------------- ### List Payouts - Success Response Example Source: https://docs.confirmo.net/reference/payout Example of a successful 200 OK response when listing merchant payouts. It includes details like limit, offset, order, query, and total count of payouts. ```json { "data": [ {} ], "limit": 20, "offset": 0, "order": "createdAt, desc", "query": "string", "totalCount": 150 } ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/placetakerequest-1 Provides essential tips for integrating Confirmo's services, including webhook verification, payment URL security, and using the overlay library. ```APIDOC ## Integration Tips ### Webhook Notifications - Ensure `notifyUrl` is correctly specified and starts with `https://`. - Verify that your notification handler script is receiving POST requests and has a valid SSL certificate. - After receiving a `paid` status notification, it's recommended to call the [Get invoice detail](#/Invoice/getInvoiceByMerchant) endpoint to verify the data. - Do not solely rely on webhook notification data; consider it as a supplementary source. ### Payment URL Security - The payment URL should not be public or easily discoverable by search engines. - Be cautious with the payment URL as it can be used to request refunds. Ensure only authorized personnel have access. ### Confirmo Overlay - For seamless integration, utilize the `@confirmo/overlay` library to display payment interfaces without redirecting users. - Refer to the [npm package documentation](https://www.npmjs.com/package/@confirmo/overlay) for detailed instructions. ``` -------------------------------- ### Get Settlement Methods API Response Example (JSON) Source: https://docs.confirmo.net/reference/settlement-method This JSON object represents a successful response (200 OK) from the 'Get Settlement Methods' API endpoint. It includes an array of settlement method objects, detailing bank and crypto accounts with their respective properties. ```json { "data": [ { "active": true, "createdAt": 1519391219, "id": "smtq5ejjne0p", "keepMinBalance": 0, "notificationMail": "string", "paymentMethodId": "string", "settlement": { "interval": { "day": 1, "type": "weekly" }, "minValue": 100 }, "settlementAccount": "{'accountNumber': 'CZ123456789', 'swift': 'AAAACZBB'}" or "{'address': 'bc1...456', 'currency': 'BTC'}", "type": "bank_payment_accounts", "updatedAt": 1519391219, "currency": "EUR" }, { "active": true, "createdAt": 1519391219, "id": "smtq5ejjne0p", "keepMinBalance": 0, "notificationMail": "string", "paymentMethodId": "string", "settlement": { "interval": { "day": 1, "type": "weekly" }, "minValue": 100 }, "settlementAccount": "{'accountNumber': 'CZ123456789', 'swift': 'AAAACZBB'}" or "{'address': 'bc1...456', 'currency': 'BTC'}", "type": "bank_payment_accounts", "updatedAt": 1519391219, "currency": "BTC" } ] } ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/changestatusbyapikey Provides essential advice for integrating Confirmo's services, including webhook verification and security best practices. ```APIDOC ## Integration Tips ### Webhook Notifications - Ensure `notifyUrl` is correctly specified and starts with `https://`. - Verify that your notification handler script correctly receives POST requests. - It is recommended to call the [Get invoice detail](#/Invoice/getInvoiceByMerchant) endpoint after receiving a 'paid' status notification to verify the data. - Do not rely solely on webhook POST data for critical logic. ### Payment URL Security - Ensure the payment URL is not publicly accessible or discoverable by search engines. - Be cautious, as the payment URL can be used to request refunds. Implement appropriate security measures and train support staff. ### Asset Information - Refer to the [Get assets endpoint](#/Assets/getAssets) to retrieve a list of supported assets, particularly those with `merchantAsset=true`. ### Invoice Original Amount (`invoice.currencyFrom`) - This parameter accepts codes for most world fiat currencies (e.g., `USD`, `EUR`, `CHF`) and `BTC`. ### Invoice Payment Asset (`invoice.currencyTo`) - Setting `invoice.currencyTo` to `null` allows the customer to select their preferred payment method from available options. - Pre-selecting payment assets is possible by setting `invoice.currencyTo` to `BTC` (or `BTC` with `LIGHTNING` for Bitcoin Lightning) or `LTC`. - For other predefined payment methods, contact `tech@confirmo.net`. ### Invoice Settlement Asset (`settlement.currency`) - **Without conversion (Keep in kind):** If `settlement.currency` is `null`, payments are credited to the merchant's balance in the same asset used for payment (e.g., TRX payments credited as TRX). - **With conversion:** Set `settlement.currency` to a supported asset code (e.g., `BTC`, `EUR`, `CZK`, `GBP`, `HUF`, `PLN`) to receive payments converted into that asset. #### Supported Settlement Assets: | `settlement.currency` | Asset name | Asset type | |-----------------------|------------------------|---------------------| | BTC | Bitcoin | Crypto | | CZK | Czech koruna | Fiat | | EUR | Euro | Fiat | | GBP | British pound sterling | Fiat | | HUF | Hungarian forint | Fiat | | PLN | Polish zloty | Fiat | ``` -------------------------------- ### List Merchant Payouts - PHP Request Source: https://docs.confirmo.net/reference/payout Demonstrates how to list merchant payouts using PHP with cURL. This example sends a GET request to the Confirmo API endpoint. ```php ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/getsettlementmethods-1 Provides essential tips for integrating with the Confirmo API, including webhook notification handling, security recommendations, and currency management. ```APIDOC ## Integration Tips ### Webhook Notifications - Ensure `notifyUrl` is correctly specified and uses `https://`. - Verify your notification handler script is receiving POST requests. - It is recommended to call [Get invoice detail](#/Invoice/getInvoiceByMerchant) to verify notification data, especially for 'paid' status. - Do not solely rely on webhook notification data. ### Security - Ensure the payment URL is not public and not indexed by search engines. - Be cautious as refunds can be requested via the payment URL. ### Invoice Parameters - **invoice.currencyFrom**: Can be set to fiat currencies (USD, EUR, CHF) or 'BTC'. Refer to [Get assets endpoint](#/Assets/getAssets) for supported assets. - **invoice.currencyTo**: Recommended to be `null` to allow customer payment method selection. Can be set to 'BTC' or 'BTC' with 'LIGHTNING' for specific pre-selections. - **settlement.currency**: Can be `null` to receive payments in the original asset, or set to a supported asset code (BTC, CZK, EUR, GBP, HUF, PLN) to receive payments in a converted asset. ``` -------------------------------- ### List Merchant Payouts - Node.js Request Source: https://docs.confirmo.net/reference/payout Example of listing merchant payouts using Node.js with the 'axios' library. This code makes a GET request to the API and logs the response data. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://confirmo.net/api/v3/payouts', headers: { 'accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/getostransaction-1 Provides guidance on common integration scenarios and best practices when working with Confirmo's API and services. ```APIDOC ## Integration Tips ### Notification Handling - Ensure `notifyUrl` is correctly specified and starts with `https://`. - Verify that your server has a valid SSL certificate. - Confirm that your notification handler script is capable of receiving POST requests. ### Invoice Verification - After receiving a `paid` status notification, it is recommended to call the [Get invoice detail](#/Invoice/getInvoiceByMerchant) endpoint to verify the notification data. - Do not rely solely on webhook notification POST data for critical business logic. ### Security - Ensure the payment URL is not publicly accessible or indexed by search engines. - Be cautious with payment URLs as they can be used to request refunds. Implement appropriate security measures for your support staff. ### Asset Support - For a list of supported assets for `invoice.currencyFrom`, refer to the [Get assets endpoint](#/Assets/getAssets). - Supported settlement assets include BTC, CZK, EUR, GBP, HUF, PLN. ``` -------------------------------- ### Get Settlement Methods API Request (cURL) Source: https://docs.confirmo.net/reference/settlement-method This cURL command demonstrates how to make a GET request to the Confirmo API to retrieve settlement methods. It includes the necessary URL and the 'accept' header for JSON responses. ```shell curl --request GET \ --url https://confirmo.net/api/v3/settlement-methods \ --header 'accept: application/json' ``` -------------------------------- ### API Key Usage Example Source: https://docs.confirmo.net/reference/getexchangerates-1 Demonstrates how to include your API key in the Authorization header for requests to the Confirmo API. ```APIDOC ## API Key Usage Example ### Description This example shows how to authenticate your requests using an API key by including it in the `Authorization` header. ### Method GET (example for fetching invoices) ### Endpoint `https://confirmo.net/api/v3/invoices` ### Parameters #### Header Parameters - **Authorization** (string) - Required - Bearer token in the format `Bearer {YOUR_API_KEY}`. ### Request Example ```bash curl https://confirmo.net/api/v3/invoices -H 'Authorization: Bearer {YOUR_API_KEY}' ``` ### Response #### Success Response (200) - **(response structure will vary based on the endpoint)** #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Merchant Balances API Request (PHP) Source: https://docs.confirmo.net/reference/merchant-balance This PHP snippet demonstrates fetching merchant balances from the Confirmo API using cURL. It sets the request method to GET and includes the 'accept' header. ```php ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/patchinvoice-1 Provides essential tips for integrating with the Confirmo API, including notification handling and security best practices. ```APIDOC ## Integration Tips ### Notification Handling - Ensure `notifyUrl` is correctly specified and uses `https://`. - Verify that your notification handler script can receive POST requests. - After receiving a 'paid' status notification, it is recommended to call the [Get invoice detail](#/Invoice/getInvoiceByMerchant) endpoint to confirm notification data. - Avoid relying solely on webhook notification POST data. ### Security - Protect your payment URLs; they should not be public or easily searchable. - Be cautious with payment URLs as they can be used to request refunds, even by support staff. ``` -------------------------------- ### Get Merchant Balances API Request (Ruby) Source: https://docs.confirmo.net/reference/merchant-balance This Ruby snippet illustrates how to retrieve merchant balances by making a GET request to the Confirmo API. It uses the 'httparty' gem for simplified HTTP requests. ```ruby require 'httparty' response = HTTParty.get('https://confirmo.net/api/v3/balances', headers: { 'accept' => 'application/json' }) puts response.body ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/createbyapi Provides essential tips for successful integration with the Confirmo API, including notification handling, payment URL security, and webhook verification. ```APIDOC ## Integration Tips ### Notification Handling - Ensure `notifyUrl` is correctly specified and starts with `https://`. - Verify that your notification handler script receives POST requests and has a valid SSL certificate. - It is recommended to call the [Get invoice detail](#/Invoice/getInvoiceByMerchant) endpoint after receiving a notification, especially for `paid` status, to verify data. - Avoid relying solely on webhook notification POST data. ### Security - Protect your payment URLs to prevent them from being public or indexed by search engines. - Be cautious with payment URLs as they can be used to request refunds. Ensure only authorized personnel have access. ### Overlay Integration - For seamless user experience, consider using the `@confirmo/overlay` library to display payments in an overlay instead of redirecting users. ``` -------------------------------- ### Get Merchant Balances API Request (Python) Source: https://docs.confirmo.net/reference/merchant-balance This Python snippet shows how to retrieve merchant balances using the 'requests' library. It performs a GET request to the specified API endpoint with the appropriate 'accept' header. ```python import requests url = "https://confirmo.net/api/v3/balances" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Integration Tips Source: https://docs.confirmo.net/reference/getexchangerates-1 Provides essential tips for integrating the Confirmo payment solution, focusing on notification handling, security, and payment URL usage. ```APIDOC ## Integration Tips ### Notification Handling - Ensure `notifyUrl` is correctly specified with a valid SSL certificate (https://). - Verify that your notification handler script is set up to receive POST requests. - It is recommended to call the [Get invoice detail](#/Invoice/getInvoiceByMerchant) endpoint after receiving a 'paid' status notification to confirm transaction data. - Avoid relying solely on webhook notification POST data for critical logic. ### Payment URL Security - The payment URL should not be publicly accessible or discoverable by search engines. - Be cautious with payment URLs as they can be used to request refunds. Ensure only authorized personnel can access them. ### Invoice Payment Asset (`invoice.currencyTo`) - Setting `invoice.currencyTo` to `null` allows the customer to choose their preferred payment method from supported options. - Pre-selecting payment assets like `BTC` or `BTC` with `LIGHTNING` is possible. - For other predefined payment methods, contact `tech@confirmo.net`. ### Invoice Settlement Asset (`settlement.currency`) - **Without conversion (Keep in kind):** If `settlement.currency` is `null`, payments are credited in the same crypto asset used by the customer. - **With conversion:** Set `settlement.currency` to a supported asset code (e.g., `BTC`, `EUR`, `CZK`) to receive payments converted into that asset. ``` -------------------------------- ### Example API Request with Authorization Header Source: https://docs.confirmo.net/reference/getsettlementasmerchant-1 Demonstrates how to make an API request to the Confirmo API using cURL, including the necessary Authorization header with a Bearer token. This is crucial for authenticating requests to access invoice data. ```bash curl https://confirmo.net/api/v3/invoices -H 'Authorization: Bearer {YOUR_API_KEY}' ``` -------------------------------- ### Get Merchant Balances API Request (cURL) Source: https://docs.confirmo.net/reference/merchant-balance This snippet demonstrates how to fetch merchant balances using a cURL request. It specifies the GET method, the API endpoint, and the required 'accept' header for JSON response. ```shell curl --request GET \ --url https://confirmo.net/api/v3/balances \ --header 'accept: application/json' ```