### Error Example: No Signature Header Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Forbidden' response when the required X-Processing-Signature header is missing. ```json { "error": "No signature header", "code": "required_header_signature" } ``` -------------------------------- ### Payment Request Response Example Source: https://docs.alphapo.net/integration-guide/payment-requests/create-a-payment-request This is an example of the response received after successfully creating a payment request. It includes the payment link and other details. ```json { "data": { "id": "0196f6a1-cab2-76fb-84c7-7e9ee9ddf6b4", "amount": "100", "currency": { "iso": "EUR" }, "status": "created", "life_time": 1731427200, "end_user_email": "customer@example.com", "description": "Order #123", "payment_link": "https://payments.alphapo.net/request/0196f6a1-cab2-76fb-84c7-7e9ee9ddf6b4", "foreign_id": "order123_customer", "url_store": "https://example.com/store" } } ``` -------------------------------- ### 404 Not Found Example Source: https://docs.alphapo.net/api-reference/endpoints/transactions-info Example of a 404 Not Found response when a requested transaction cannot be located. ```json { "errors": [ "No transaction found." ] } ``` -------------------------------- ### Payment Request Callback Payload Examples Source: https://docs.alphapo.net/api-reference/callbacks/payment-request These examples illustrate the structure of callback payloads for different payment request statuses. ```json { "type":"transfer_fee", "currency":{ "iso":"ETH", "network_name":"ethereum" }, "amount":"0.00007808" }, { "type":"fee_payment_request_crypto", "currency":{ "iso":"ETH", "network_name":"ethereum" }, "amount":"0.00854354" } ], "fixed_at":1769780669, "expires_at":1769780868, "valid_until":1769780868 } ``` ```json { "payment_request_id":"019c0de8-4576-7e4f-85c7-43a5cb5e9f2d", "foreign_id":"order_82652.32794293783", "type":"payment_request", "status":"failed", "end_user_email":"test@test.net", "payment_request_address":{ "id":"019c0de8-49df-762a-9705-4c304627dfd0", "currency":{ "iso":"BTC", "network_name":"bitcoin" }, "convert_to":{ "iso":"ETH", "network_name":"ethereum" }, "address":"tb1qj0d4rsczat6dx3yy065g98rrz5hewkrdcrz7je" }, "payment_request_amount":{ "currency":{ "iso":"ETH", "network_name":"ethereum" }, "amount":"0.3" }, "currency_sent":{ "currency":{ "iso":"BTC", "network_name":"bitcoin" }, "expected_amount":"0.0094", "received_amount":"0.009", "remaining_amount":"0.0004" }, "transactions":[ { "id":"019c0de8-54a3-7163-b59c-95f38d982a31", "currency":{ "iso":"BTC", "network_name":"bitcoin" }, "address":"tb1qj0d4rsczat6dx3yy065g98rrz5hewkrdcrz7je", "txid":"cf3c308839d67ab6bce3b2f275fcc197c5c19dc208efc35dbc0a68ff355d78e3", "amount":"0.009", "status":"confirmed", "late_payment":false } ], "fixed_at":1769759853, "expires_at":1769760051, "valid_until":1769760051 } ``` ```json { "payment_request_id":"019bea8c-7d69-7632-8472-77443ac78a17", "foreign_id":"order_85566.25193543735", "type":"payment_request", "status":"expired", "end_user_email":"ckane@example.com", "payment_request_amount":{ "currency": { "iso": "ETH", "network_name": "ethereum" }, "amount":"0.3" }, "expires_at":1769166664 } ``` ```json { "payment_request_id":"019c0ebf-81e5-751d-aa57-fb9e2cba23c2", "foreign_id":"order_12345", "type":"payment_request", "status":"expired", "end_user_email":"test@test.com", "payment_request_address":{ "id":"019c0ebf-84a1-7bdc-a09c-8b62294cc75d", "currency":{ "iso":"BTC", "network_name":"bitcoin" }, "convert_to":{ "iso":"ETH", "network_name":"ethereum" }, "address":"tb1qj0d4rsczat6dx3yy065g98rrz5hewkrdcrz7je" }, "payment_request_amount":{ "currency":{ "iso":"ETH", "network_name":"ethereum" }, "amount":"0.3" }, "currency_sent":{ "currency":{ "iso":"BTC", "network_name":"bitcoin" }, "expected_amount":"0.0094", "received_amount":"0", "remaining_amount":"0.0094" }, "fixed_at":1769773958, "expires_at":1769774157, "valid_until":1769774157 } ``` ```json { "payment_request_id":"019c0de8-4576-7e4f-85c7-43a5cb5e9f2d", "foreign_id":"order_82652.32794293783", "type":"payment_request", "status":"failed", "end_user_email":"test@test.net", "payment_request_address":{ "id":"019c0de8-49df-762a-9705-4c304627dfd0", "currency":{ "iso":"BTC", "network_name":"bitcoin" }, "convert_to":{ "iso":"ETH", "network_name":"ethereum" }, "address":"tb1qj0d4rsczat6dx3yy065g98rrz5hewkrdcrz7je" }, "payment_request_amount":{ "currency":{ "iso":"ETH", "network_name":"ethereum" }, "amount":"0.3" }, "currency_sent":{ "currency":{ "iso":"BTC", ``` -------------------------------- ### Deposit Callback - Below Minimum Amount Example Source: https://docs.alphapo.net/api-reference/callbacks/deposit-callbacks This example shows a deposit callback payload when the deposited amount is lower than the minimum allowed. The transaction is cancelled and no fees are charged. ```json { "id": 2686563, "end_user_reference": "12345", "type": "deposit", "crypto_address": { "id": 381738, "currency": "ETH", "address": "0xd61180ff0cf74dc3ee8e264751f18c47060729b9", "tag": null, "foreign_id": "12345" }, "transactions": [ { "id": 714657, "currency": "ETH", "transaction_type": "blockchain", "type": "deposit", "address": "0xd61180ff0cf74dc3ee8e264751f18c47060729b9", "tag": null, "amount": "0.00000001", "txid": "0x6b353da88a8ba2df4926c1ccc58991f484a683ba57ec3dde70e812b5c8c7fa1d", "confirmations": "9" } ], "fees": [], "error": "Transaction amount less than minimum deposit", "status": "cancelled" } ``` -------------------------------- ### Lightning Deeplink Example Source: https://docs.alphapo.net/integration-guide/deposits/design-lightning-payment-form This is an example of a Lightning Network deeplink that can be used to initiate a payment from a mobile wallet. ```plaintext lightning:lnbcrt1m1p5u93tfpp53wwjfugpyypf68mgwjfzq99x8cghlurxwpp680r9uyvd8qxkjulqdqqcqzysxqzuysp5fdzuturj4cttdaafw09j739adh4slxxqynnjpl6n208wqfc8ny6q9qxpqysgqgdgwm5hdt736pm3jkn0spp85zwx0023vlxj8s0fjkha55wtyg5hjxvmkjl6ee4ztxrc75j3q7qzxua7r28qujlvc3ykmaklczwccmkspazvfhu ``` -------------------------------- ### Deposit Callback - Confirmed Transaction Example Source: https://docs.alphapo.net/api-reference/callbacks/deposit-callbacks This example shows a deposit callback payload when a transaction is confirmed. It includes transaction details, fees, and a confirmed status. ```json { "id": 132506113, "end_user_reference": "12345", "type": "deposit", "crypto_address": { "id": 3776973, "currency": "ETH", "address": "0x071B2E45e2CD08011555755b93d5C76D2E62C4Cd", "tag": null, "foreign_id": "11" }, "currency_sent": { "currency": "ETH", "amount": "0.01000000" }, "currency_received": { "currency": "ETH", "amount": "0.01000000", "amount_minus_fee": "0.01000000" }, "transactions": [ { "id": 3745588, "currency": "ETH", "transaction_type": "blockchain", "type": "deposit", "address": "0x071B2E45e2CD08011555755b93d5C76D2E62C4Cd", "tag": null, "amount": "0.01000000", "txid": "0x4c72ffcb2dfcd0b21c4f19c094558865af465abdfa04a2b8c33ee569afa4ef8d", "riskscore": null, "confirmations": "1" } ], "fees": [], "error": "", "status": "confirmed" } ``` -------------------------------- ### Error Example: Same Currency Pair Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Bad Request' response when attempting to exchange a currency with itself. ```json { "errors": { "receiver_currency": "Cannot exchange currency to itself" } } ``` -------------------------------- ### Error Example: Missing Required Fields Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Bad Request' response when required fields like receiver currency or amount are missing. ```json { "errors": { "receiver_currency": "The receiver currency field is required.", "receiver_amount": "The receiver amount field is required when the sender amount field is not presented." } } ``` -------------------------------- ### OpenAPI Response Examples for Authorization Headers Source: https://docs.alphapo.net/api-reference/endpoints/invoices-create Examples of JSON responses for various authorization header errors, including missing or invalid signature and key headers. ```json { "error": "Bad signature header", "code": "bad_header_signature" } ``` ```json { "error": "No signature header", "code": "required_header_signature" } ``` ```json { "error": "Bad key header", "code": "bad_header_key" } ``` ```json { "error": "No key header", "code": "required_header_key" } ``` -------------------------------- ### Transaction Info Response Example Source: https://docs.alphapo.net/api-reference/openapi.yaml Example structure of a successful response when fetching transaction details. Includes fields like ID, foreign ID, type, and currency information. ```json { "id": 717535, "foreign_id": "test_foreign_id_0344", "end_user_reference": "12345", "type": "deposit", "crypto_address": { "id": 176, "currency": "BTC", "convert_to": "EUR", "address": "tb1qqepjlefdvrtyu6teqndww7v86hkz269z0ewj5q", "tag": null }, "currency_sent": { "currency": "BTC", "amount": "0.0001" }, "currency_received": { "currency": "EUR", "amount": "5.00" }, "amount_minus_fee": "4.95", "transactions": [ { "transaction_type": "blockchain", "txid": "YOUR_TXID", "riskscore": 0, "confirmations": 3, "address": "tb1qqepjlefdvrtyu6teqndww7v86hkz269z0ewj5q", "tag": null } ] } ``` -------------------------------- ### Deposit Callback - Processing Transaction Example Source: https://docs.alphapo.net/api-reference/callbacks/deposit-callbacks This example shows a deposit callback payload when a transaction is detected but still being processed. The status is 'not_confirmed'. ```json { "id": 132506113, "end_user_reference": "12345", "type": "deposit", "crypto_address": { "id": 3776973, "currency": "ETH", "address": "0x071B2E45e2CD08011555755b93d5C76D2E62C4Cd", "tag": null, "foreign_id": "11" }, "currency_sent": { "currency": "ETH", "amount": "0.01000000" }, "currency_received": { "currency": "ETH", "amount": "0.01000000", "amount_minus_fee": "0.01000000" }, "transactions": [ { "id": 3745588, "currency": "ETH", "transaction_type": "blockchain", "type": "deposit", "address": "0x071B2E45e2CD08011555755b93d5C76D2E62C4Cd", "tag": null, "amount": "0.01000000", "txid": "0x4c72ffcb2dfcd0b21c4f19c094558865af465abdfa04a2b8c33ee569afa4ef8d", "riskscore": null, "confirmations": "1" } ], "fees": [], "error": "", "status": "not_confirmed" } ``` -------------------------------- ### Error Example: Bad Key Header Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Forbidden' response due to an invalid or incorrect API key header. ```json { "error": "Bad key header" } ``` -------------------------------- ### Successful Quote Example (Sender Amount) Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a successful quote request where the sender amount is specified. This includes currency details, amounts, fees, price, and validity timestamps. ```json { "data": { "sender_currency": "BTC", "sender_amount": "0.02000000", "receiver_currency": "EUR", "receiver_amount": "1546.28528889", "fee_currency": "BTC", "fee_amount": "0.00100000", "price": "77314.26444450", "ts_fixed": 1775172819, "ts_release": 1775172879, "fix_period": 60 } } ``` -------------------------------- ### Successful Quote Example (Receiver Amount) Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a successful quote request where the receiver amount is specified. This includes currency details, amounts, fees, price, and validity timestamps. ```json { "data": { "sender_currency": "BTC", "sender_amount": "0.00129342", "receiver_currency": "EUR", "receiver_amount": "100.00000000", "fee_currency": "BTC", "fee_amount": "0.00006467", "price": "77314.40676655", "ts_fixed": 1775172897, "ts_release": 1775172957, "fix_period": 60 } } ``` -------------------------------- ### Successful Exchange - Sender Amount Example Source: https://docs.alphapo.net/api-reference/endpoints/exchange-now Example of a successful exchange request focusing on the sender's amount and currency, showing the expected response structure with transaction details. ```json { "data": { "sender_currency": "BTC", "sender_amount": "0.00300000", "receiver_currency": "EUR", "receiver_amount": "231.94279333", "fee_currency": "BTC", "fee_amount": "0.00015000", "price": "77314.26444333", "id": 134704200, "foreign_id": "test_foreign_id_0319", "type": "exchange", "status": "processing" } } ``` -------------------------------- ### Transaction Data Example Source: https://docs.alphapo.net/api-reference/endpoints/transactions-info Illustrates the structure of a confirmed transaction, including amounts, fees, and status. ```json { "amount": "0.00326418", "transactions": [ { "id": 9628634, "currency": "BTC", "currency_to": "ETH", "transaction_type": "exchange", "type": "exchange", "amount": "0.00010000", "amount_to": "0.00326418" } ], "fees": [ { "type": "fee_crypto_exchange_to_crypto", "currency": "BTC", "amount": "0.00000200" } ], "error": "", "status": "confirmed" } ``` -------------------------------- ### Error Example: Invalid Amount Format Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Bad Request' response when the sender amount has an invalid format (e.g., below minimum). ```json { "errors": { "sender_amount": "Invalid amount format" } } ``` -------------------------------- ### Successful Exchange - Receiver Amount Example Source: https://docs.alphapo.net/api-reference/endpoints/exchange-now Example of a successful exchange request focusing on the receiver's amount and currency, illustrating the response format with transaction details. ```json { "data": { "sender_currency": "BTC", "sender_amount": "0.00129342", "receiver_currency": "EUR", "receiver_amount": "100.00000000", "fee_currency": "BTC", "fee_amount": "0.00006467", "price": "77314.40676655", "id": 134704201, "foreign_id": "test_foreign_id_0320", "type": "exchange", "status": "processing" } } ``` -------------------------------- ### Deposit Callback - Cancelled (Double Spend) Example Source: https://docs.alphapo.net/api-reference/callbacks/deposit-callbacks This example shows a deposit callback payload when a detected deposit is cancelled due to a double-spend event. The transaction is invalid and should not be credited. ```json { "id": 100, "end_user_reference": "12345", "type": "deposit", "crypto_address": { "id": 123, "currency": "BTC", "address": "tb1qhaj2ruldumppj49ystync0um6239qsjj44s67e", "tag": null, "foreign_id": "12345" }, "transactions": [ { "id": 999, "currency": "BTC", "transaction_type": "blockchain", "type": "deposit", "address": "tb1qhaj2ruldumppj49ystync0um6239qsjj44s67e", "tag": null, "amount": "0.002", "txid": "5d52f01510df872b3115e6f88e9f58a1d15603498a58924d2ea2c1a8e34751c7", "riskscore": "0.01", "confirmations": "0" } ], "fees": [], "error": "Double spend", "status": "cancelled" } ``` -------------------------------- ### Withdraw BTC with conversion from EUR (Request) Source: https://docs.alphapo.net/api-reference/endpoints/crypto-withdrawal-instant-exchange Example of a request to withdraw EUR and convert it to BTC. ```yaml POST /crypto/withdrawal_instant_exchange openapi: 3.0.0 info: title: Merchant Backend V2 version: '1.0' description: Documentation for merchant backend processing endpoints servers: - url: https://app.alphapo.net/api/v2 security: - xProcessingKey: [] tags: - name: Status - name: Balance - name: Currencies - name: Deposit addresses - name: Withdrawal - name: Exchange - name: Invoices - name: Transactions paths: /crypto/withdrawal_instant_exchange: post: tags: - Withdrawal summary: Withdraw BTC with conversion from EUR description: >- Make an [instant withdrawal](/integration-guide/withdrawals/instant-withdrawals) from a cryptocurrency or fiat balance with conversion to cryptocurrency. operationId: post-crypto-withdrawal-instant-exchange parameters: - $ref: '#/components/parameters/XProcessingSignatureHeader' requestBody: content: application/json: schema: type: object properties: sender_currency: type: string description: >- Currency to withdraw. For a list of all available currencies, see [API currency codes](/api-reference/currency-codes). received_currency: type: string description: Target currency to convert funds into before sending. sender_amount: type: number description: Amount to withdraw in `sender_currency`. address: type: string description: Cryptocurrency address where you want to send funds. foreign_id: description: Unique ID of the withdrawal request. end_user_reference: $ref: '#/components/schemas/end_user_reference.withdrawals' required: - sender_currency - received_currency - sender_amount - address - foreign_id examples: Withdraw BTC with conversion from EUR: value: sender_currency: EUR received_currency: BTC sender_amount: '100' address: tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc foreign_id: withdrawal_123 end_user_reference: user_12345 responses: '201': description: Created content: application/json: schema: type: object properties: data: type: object properties: id: type: integer description: Transaction ID. foreign_id: type: string description: Unique ID of the withdrawal request. end_user_reference: $ref: '#/components/schemas/end_user_reference.withdrawals' type: type: string description: >- Transaction type (always `withdrawal_instant_exchange`). status: type: string description: Transaction status. sender_currency: type: string description: Source currency ISO code. sender_amount: type: string description: Withdrawal amount in `sender_currency`. received_currency: type: string description: Destination currency ISO code. received_amount: type: string description: Amount sent in `received_currency`. '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/ValidationOrMalformedJson' examples: Instant_withdrawals_disabled: ``` -------------------------------- ### List Balances Source: https://docs.alphapo.net/api-reference/endpoints/accounts-list Get a list of your balances for each cryptocurrency, including zero balances. ```APIDOC ## GET /balances ### Description Get a list of your balances for each cryptocurrency, including zero balances. ### Method GET ### Endpoint /balances ### Parameters #### Query Parameters - **currency** (string) - Optional - Filter balances by a specific currency. ### Response #### Success Response (200) - **currency** (string) - The cryptocurrency currency code (e.g., "BTC", "ETH"). - **balance** (number) - The available balance for the specified currency. - **frozen_balance** (number) - The frozen balance for the specified currency. - **total_balance** (number) - The total balance (available + frozen) for the specified currency. ### Response Example ```json { "balances": [ { "currency": "BTC", "balance": "0.00000000", "frozen_balance": "0.00000000", "total_balance": "0.00000000" }, { "currency": "ETH", "balance": "0.00000000", "frozen_balance": "0.00000000", "total_balance": "0.00000000" } ] } ``` ``` -------------------------------- ### Generate BTC Address with EUR Conversion Source: https://docs.alphapo.net/api-reference/endpoints/addresses-take This example shows how to generate a Bitcoin deposit address and automatically convert any incoming funds to EUR. Provide the target currency in `convert_to`. ```json { "currency": "BTC", "convert_to": "EUR", "foreign_id": "test_foreign_id", "end_user_reference": "test_end_user_reference" } ``` -------------------------------- ### Exchange with Sender Amount Source: https://docs.alphapo.net/api-reference/endpoints/exchange-now Use this example when you know the exact amount you want to send and want to receive the equivalent based on the current market rate. Ensure `sender_currency`, `receiver_currency`, `sender_amount`, and `foreign_id` are provided. ```yaml POST /exchange/now openapi: 3.0.0 info: title: Merchant Backend V2 version: '1.0' description: Documentation for merchant backend processing endpoints servers: - url: https://app.alphapo.net/api/v2 security: - xProcessingKey: [] tags: - name: Status - name: Balance - name: Currencies - name: Deposit addresses - name: Withdrawal - name: Exchange - name: Invoices - name: Transactions paths: /exchange/now: post: tags: - Exchange summary: Exchange at market rate description: >- Execute an exchange immediately at the currently available market rate, without requesting a fixed quote. operationId: post-exchange-now parameters: - $ref: '#/components/parameters/XProcessingSignatureHeader' requestBody: content: application/json: schema: type: object properties: sender_currency: type: string description: >- Currency to exchange from. For a list of all available currencies, see [API currency codes](/api-reference/currency-codes). receiver_currency: type: string description: >- Currency to exchange to. For a list of all available currencies, see [API currency codes](/api-reference/currency-codes). sender_amount: description: >- Amount to send. You must include either this parameter or `receiver_amount`. type: number receiver_amount: description: >- Amount to receive. You must include either this parameter or `sender_amount`. type: number foreign_id: type: string description: Unique exchange identifier in your system. required: - sender_currency - receiver_currency - foreign_id examples: sender_amount: value: sender_currency: BTC receiver_currency: EUR sender_amount: '0.003' foreign_id: test_foreign_id_0319 receiver_amount: value: sender_currency: BTC receiver_currency: EUR receiver_amount: '100' foreign_id: test_foreign_id_0320 responses: '201': description: Created content: application/json: schema: type: object properties: data: type: object required: - sender_currency - sender_amount - receiver_currency - receiver_amount - fee_currency - fee_amount - price - id - foreign_id - type - status properties: sender_currency: type: string description: The currency being exchanged from. sender_amount: type: string description: >- If `sender_amount` was provided in the request, this is the requested send amount. If `receiver_amount` was provided, this is the calculated amount to send. receiver_currency: type: string description: The currency being exchanged to. receiver_amount: type: string description: >- If `receiver_amount` was provided in the request, this is the requested receive amount. If `sender_amount` was provided, this is the calculated amount to receive. fee_currency: type: string description: The currency in which the exchange fee is charged. fee_amount: type: string description: >- The exchange fee amount. If the fee is charged in the sender currency, the total debited amount is `sender_amount + fee_amount`. price: type: string description: >- ``` -------------------------------- ### Create Invoice (With Timer) Source: https://docs.alphapo.net/api-reference/endpoints/invoices-create Example of creating an invoice that expires in 15 minutes. The 'timer' field must be set to true. ```json { "timer": true, "title": "Invoice Title", "currency": "EUR", "amount": 100, "foreign_id": "test_foreign_id_0350", "end_user_reference": "12345", "url_success": "https://example.com/success", "url_failed": "https://example.com/failed", "email_user": "email@example.com" } ``` -------------------------------- ### Cancel Invoice - Feature Not Enabled Example Source: https://docs.alphapo.net/api-reference/openapi.yaml Example response when the invoice cancellation feature is not enabled for the account. ```json { "message": "Required features [invoices_enabled] not enabled." } ``` -------------------------------- ### Cancel Invoice - Invalid State Example Source: https://docs.alphapo.net/api-reference/openapi.yaml Example response when attempting to cancel an invoice that is not in a cancellable state. ```json { "error": "Invoice cannot be failed in its current state.", "code": "invalid_invoice_state" } ``` -------------------------------- ### Generate Lightning Invoice (BTCLN) Source: https://docs.alphapo.net/api-reference/endpoints/addresses-take This example demonstrates generating a Lightning Network invoice for Bitcoin. The `amount` parameter is required and must be specified with up to 8 decimal places. ```json { "currency": "BTCLN", "foreign_id": "123", "end_user_reference": "test_end_user_reference", "amount": "0.00131239" } ``` -------------------------------- ### Instant BTC Withdrawal Request Source: https://docs.alphapo.net/api-reference/endpoints/crypto-withdrawal-instant Use this example to initiate an instant withdrawal of Bitcoin. Ensure the `sender_currency`, `sender_amount`, `address`, and `foreign_id` are correctly provided. ```json { "sender_currency": "BTC", "sender_amount": "0.00020000", "address": "tb1qfdxh6gkfr0qgyatnlkd8khcnxph9tw06n6qwjc", "foreign_id": "withdrawal_123", "end_user_reference": "user_12345" } ``` -------------------------------- ### Error Example: Bad Signature Header Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Forbidden' response due to an invalid or incorrect X-Processing-Signature header. ```json { "error": "Bad signature header", "code": "bad_header_signature" } ``` -------------------------------- ### Error Example: Invalid Receiver Currency Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Bad Request' response when the provided receiver currency is not supported. ```json { "errors": { "receiver_currency": "Currency not supported" } } ``` -------------------------------- ### Error Example: Invalid Sender Currency Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Bad Request' response when the provided sender currency is not supported. ```json { "errors": { "sender_currency": "Currency not supported" } } ``` -------------------------------- ### Cancel Invoice - Invoice Not Found Example Source: https://docs.alphapo.net/api-reference/openapi.yaml Example response for a cancellation request where the invoice with the specified foreign ID does not exist. ```json { "errors": { "foreign_id": "Invoice not found." } } ``` -------------------------------- ### Error Example: Malformed JSON Source: https://docs.alphapo.net/api-reference/endpoints/exchange-calculate Example of a 'Bad Request' response when the request body is not valid JSON or the Content-Type header is incorrect. ```json { "error": "Bad content format", "code": "bad_content_format" } ``` -------------------------------- ### Example JSON Body for Signature Generation Source: https://docs.alphapo.net/api-reference/authentication This is the JSON body used as an example for generating the HMAC-SHA512 signature. Ensure your request body is identical to this before signing. ```json {"currency":"BTC","foreign_id":"123456"} ``` -------------------------------- ### List Supported Currencies Source: https://docs.alphapo.net/api-reference/endpoints/currencies-list Fetches a list of all supported currencies, their minimum deposit amounts, and deposit/withdrawal fees. Note that the sandbox and production environments have different currency lists. ```APIDOC ## GET /currencies ### Description Returns a list of available currencies, minimum deposit amounts, and deposit and withdrawal fees. ### Method GET ### Endpoint /currencies ### Response #### Success Response (200) - **currencies** (array) - A list of supported currencies with their details. - **currency** (string) - The currency code (e.g., "EUR"). - **min_deposit_amount** (string) - The minimum amount for a deposit in the specified currency. - **deposit_fee** (string) - The fee for depositing the specified currency. - **withdrawal_fee** (string) - The fee for withdrawing the specified currency. ### Response Example { "currencies": [ { "currency": "EUR", "min_deposit_amount": "10.00", "deposit_fee": "0.00", "withdrawal_fee": "0.50" }, { "currency": "USD", "min_deposit_amount": "10.00", "deposit_fee": "0.00", "withdrawal_fee": "0.50" } ] } ``` -------------------------------- ### 400 Bad Request - Invalid ID Example Source: https://docs.alphapo.net/api-reference/endpoints/transactions-info Example of a 400 Bad Request response when the 'id' parameter is invalid (not an integer) and other identification parameters are also missing. ```json { "errors": { "id": "The id must be an integer.", "txid": "The txid field is required when none of id / foreign id are present." } } ``` -------------------------------- ### 400 Bad Request - Missing All Params Example Source: https://docs.alphapo.net/api-reference/endpoints/transactions-info Example of a 400 Bad Request response when all required transaction identification parameters (id, foreign_id, txid) are missing. ```json { "errors": { "id": "The id field is required when none of foreign id / txid are present.", "foreign_id": "The foreign id field is required when none of id / txid are present.", "txid": "The txid field is required when none of foreign id / txid are present." } } ``` -------------------------------- ### POST /exchange/now Source: https://docs.alphapo.net/api-reference/openapi.yaml Executes a currency exchange immediately at the current market rate. This method does not require a prior quote. ```APIDOC ## POST /exchange/now ### Description Execute an exchange immediately at the currently available market rate, without requesting a fixed quote. ### Method POST ### Endpoint /exchange/now ### Parameters #### Request Body - **sender_currency** (string) - Required - Currency to exchange from. For a list of all available currencies, see [API currency codes](/api-reference/currency-codes). - **receiver_currency** (string) - Required - Currency to exchange to. For a list of all available currencies, see [API currency codes](/api-reference/currency-codes). - **sender_amount** (number) - Optional - Amount to send. You must include either this parameter or `receiver_amount`. - **receiver_amount** (number) - Optional - Amount to receive. You must include either this parameter or `sender_amount`. ### Response #### Success Response (201) - **sender_currency** (string) - The currency being exchanged from. - **sender_amount** (string) - If `sender_amount` was provided in the request, this is the requested send amount. If `receiver_amount` was provided, this is the calculated amount to send. - **receiver_currency** (string) - The currency being exchanged to. - **receiver_amount** (string) - If `receiver_amount` was provided in the request, this is the requested receive amount. If `sender_amount` was provided, this is the calculated amount to receive. - **fee_currency** (string) - The currency in which the exchange fee is charged. - **fee_amount** (string) - The exchange fee amount. If the fee is charged in the sender currency, the total debited amount is `sender_amount + fee_amount`. - **price** (string) - The quoted exchange rate from `/exchange/calculate`, expressed as units of `receiver_currency` for 1 unit of `sender_currency`. - **id** (string) - Unique ID of the exchange transaction. - **foreign_id** (string) - Unique ID of the exchange transaction. - **type** (string) - Type of transaction, e.g., 'exchange'. - **status** (string) - Exchange status. ```