### Successful Refund Callback Example Source: https://docs.unityfinance.com/ This example illustrates a successful refund callback. It contains parameters specific to refunds, such as refund amounts and the transaction status. ```bash curl --location -g --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'ik_co_id=2f056000a00c00780000' \ --data-urlencode 'ik_inv_id=112233445' \ --data-urlencode 'ik_pm_no=ID_4233' \ --data-urlencode 'ik_ps_price=107.39' \ --data-urlencode 'ik_cur=EUR' \ --data-urlencode 'ik_inv_st=refunded' \ --data-urlencode 'ik_refund_amount=107.3900' \ --data-urlencode 'ik_total_refunded=107.39' \ --data-urlencode 'ik_sign=6ENy92FMl8rSkA9Fdwl/A6hhl3px000010000iBsFlN=' ``` -------------------------------- ### Successful Withdrawal Callback Example Source: https://docs.unityfinance.com/ This example shows a successful withdrawal callback. It includes parameters such as withdrawal ID, wallet ID, amounts, and timestamps. ```bash curl --location -g --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'id=12345' \ --data-urlencode 'purseId=307447812425' \ --data-urlencode 'paymentNo=4233' \ --data-urlencode 'state=success' \ --data-urlencode 'created=2023-11-01' \ --data-urlencode 'processed=2023-11-01' \ --data-urlencode 'payerWriteoffAmount=1000.00' \ --data-urlencode 'payeeReceiveAmount=1000.00' \ --data-urlencode 'details_birth_date=1990-09-09' \ --data-urlencode 'comment=Withdrawal comment' \ --data-urlencode 'ik_sign=6ENy92FMl8rSkA9Fdwl/A6hhl3px000010000iBsFlN=' ``` -------------------------------- ### Canceled Payment Callback Example Source: https://docs.unityfinance.com/ This example demonstrates a canceled payment callback. It includes parameters for rejection codes and descriptions, in addition to standard payment details. ```bash curl --location -g --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'ik_payment_method=card' \ --data-urlencode 'ik_payment_currency=EUR' \ --data-urlencode 'ik_cur=EUR' \ --data-urlencode 'ik_co_id=63c1058f418de0000002d0f0' \ --data-urlencode 'ik_co_prs_id=370000096' \ --data-urlencode 'ik_inv_id=568704592' \ --data-urlencode 'ik_inv_st=canceled' \ --data-urlencode 'ik_inv_cancel_code=22203' \ --data-urlencode 'ik_error_desc=Unknown error' \ --data-urlencode 'ik_inv_crt=2023-11-01 17:42:47' \ --data-urlencode 'ik_inv_prc=2023-11-01 16:42:58' \ --data-urlencode 'ik_trn_id=92000025' \ --data-urlencode 'ik_pm_no=1' \ --data-urlencode 'ik_am=50' \ --data-urlencode 'ik_co_rfn=48.0000' \ --data-urlencode 'ik_ps_price=50' \ --data-urlencode 'ik_desc=payment3' \ --data-urlencode 'ik_customer_last_name=Dou' \ --data-urlencode 'ik_customer_first_name=John' \ --data-urlencode 'ik_sign=6ENy92FMl8rSkA9Fdwl/A6hhl2px000000000iBsFlM=' ``` -------------------------------- ### Payment Success Callback Example Source: https://docs.unityfinance.com/ This example demonstrates a POST request to the Unity Finance endpoint to receive payment success callback data. The data is sent in URL-encoded format. ```APIDOC ## POST / ### Description Receives payment success callback notifications from Unity Finance. ### Method POST ### Endpoint `https://old-pay.unityfinance.com` ### Parameters #### Request Body - **ik_payment_method** (String) - Required - Payment method (e.g., card) - **ik_payment_currency** (String) - Required - Payment currency (e.g., USD) - **ik_cur** (String) - Required - Payment currency in which the payment will be made (e.g., USD) - **ik_co_id** (String) - Required - Checkout ID - **ik_pm_no** (String) - Required - Unique payment number in your system - **ik_desc** (String) - Optional - Payment description - **ik_am** (Float) - Required - Payment amount - **ik_customer_[name]** (String) - Optional - Additional parameters required by the payment system - **ik_sign** (String) - Required - Digital signature - **ik_inv_id** (String) - Required - Invoice ID - **ik_co_prs_id** (String) - Required - Wallet ID - **ik_trn_id** (String) - Required - Transaction ID - **ik_inv_crt** (String) - Required - Payment creation time - **ik_inv_prc** (String) - Optional - Processing time - **ik_inv_st** (String) - Required - Invoice state (e.g., success) - **ik_ps_price** (Float) - Optional - Total amount in payment system - **ik_co_rfn** (Float) - Required - Payment amount in the payment system after fee ### Request Example ```curl curl --location -g --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'ik_payment_method=card' \ --data-urlencode 'ik_payment_currency=EUR' \ --data-urlencode 'ik_cur=EUR' \ --data-urlencode 'ik_co_id=63c1058f418de0000002d0f0' \ --data-urlencode 'ik_co_prs_id=370000096' \ --data-urlencode 'ik_inv_id=568704592' \ --data-urlencode 'ik_inv_st=success' \ --data-urlencode 'ik_inv_crt=2023-11-01 17:42:47' \ --data-urlencode 'ik_inv_prc=2023-11-01 16:42:58' \ --data-urlencode 'ik_trn_id=92000025' \ --data-urlencode 'ik_pm_no=1' \ --data-urlencode 'ik_am=50' \ --data-urlencode 'ik_co_rfn=48.0000' \ --data-urlencode 'ik_ps_price=50' \ --data-urlencode 'ik_desc=payment3' \ --data-urlencode 'ik_customer_last_name=Dou' \ --data-urlencode 'ik_customer_first_name=John' \ --data-urlencode 'ik_sign=6ENy92FMl8rSkA9Fdwl/A6hhl2px000000000iBsFlM=' ``` ### Response #### Success Response (200 OK) Unity Finance expects a `200 OK` HTTP status code to confirm receipt of the callback. Any other code may result in persistent retries. ``` -------------------------------- ### List of Transfers and System Operations Response Sample Source: https://docs.unityfinance.com/ Example response for retrieving a list of transfers. Includes details for multiple transfer types. ```json [ { "id": 832, "senderCurrencyCode": "EUR", "receiverCurrencyCode": "EUR", "amount": 1, "amountSent": 1, "amountReceived": 1, "totalFee": 0, "type": "MM", "createdAt": "2023-05-17 16:24:36", "processedAt": "2023-05-17 16:24:36", "orderId": "tr_6464d51f15000", "senderCheckoutId": "63d164812£906c53c0000000", "senderPurseId": "305660000000", "receiverCheckoutId": "63da7b8634£7401300000000", "receiverPurseId": "308790000000", "description": "transfer to my second wallet" }, { "id": 833, "senderCurrencyCode": "USD", "receiverCurrencyCode": "USD", "amount": 1, "amountSent": 1, "amountReceived": 1, "totalFee": 0, "type": "SM", "createdAt": "2023-05-18 16:00:31", "processedAt": "2023-05-18 16:00:31", "orderId": "tr_6464d51f15111", "receiverCheckoutId": "63d164812£906c53c0000000", "description": "system top up" } ] ``` -------------------------------- ### Successful Transfer Creation Response Sample Source: https://docs.unityfinance.com/ Example of a successful response when a transfer is created. Includes details of the created transfer. ```json [ { "id": 832, "senderCurrencyCode": "EUR", "receiverCurrencyCode": "EUR", "amount": 1, "amountSent": 1, "amountReceived": 1, "totalFee": 0, "type": "MM", "createdAt": "2023-05-17 16:24:36", "processedAt": "2023-05-17 16:24:36", "orderId": "tr_6464d51f15000", "senderCheckoutId": "63d164812£906c53c0000000", "senderPurseId": "305660000000", "receiverCheckoutId": "63da7b8634£7401300000000", "receiverPurseId": "308790000000", "description": "transfer to my second wallet" } ] ``` -------------------------------- ### Create Transfer Request Example Source: https://docs.unityfinance.com/ This cURL command demonstrates how to initiate a new transfer between two merchants using the Unity Finance API. Ensure the Authorization and Ik-Api-Account-Id headers are correctly set. ```curl curl --location --request POST 'https://old-api.unityfinance.com/v1/transfer' \ --header 'Authorization: Basic *****' \ --header 'Ik-Api-Account-Id: *****' \ --data-urlencode 'senderCheckoutId=62ab98c77ac1b04200000000' \ --data-urlencode 'senderPurseId=301883707932' \ --data-urlencode 'senderCurrencyCode=USD' \ --data-urlencode 'receiverCheckoutId=62ab98c7d1265b4000000000' \ --data-urlencode 'orderId=1123' \ --data-urlencode 'transferAmount=1' ``` -------------------------------- ### Response Sample for Wallet Data (Alternative) Source: https://docs.unityfinance.com/ This JSON structure is another example of a successful response (200 OK) for wallet data retrieval. It is similar to the previous sample but shows a slightly different formatting for the 'settings' object. ```json { "status": "ok", "code": 0, "data": { "id": "103313815000", "accountId": "63eb7341e41f862794100000", "type": "c", "name": "Payments in EUR", "status": "1", "balance": "180.0000", "frozen": "30.0000", "turnover": "200.0000", "settings": { "{co}": "5785ff6b3d1eafa97e000000" }, "created": "2023-05-23 03:03:27", "blockedAmount": "50" } } ``` -------------------------------- ### Get Checkout Invoice Response Sample Source: https://docs.unityfinance.com/ This is a sample JSON response for retrieving checkout invoice details. It includes status, code, and detailed data about the invoice. ```json { "status": "ok", "code": 0, "data": { "id": "100873000", "coId": "5785ff6b3d1eaf97e000000", "coPurseId": "916543644795", "paymentNo": "ID_4233", "paywayId": "5b3a0c353d1eafbb01000000", "state": "2", "result": "0", "expired": "2018-08-02 10:56:55", "processed": null, "created": "2018-07-03 10:56:55", "coAmount": "100.00", "coRefund": "97.0000", "ikFee": "3.0000", "ikFeeIn": "3.0000", "ikFeeOut": "0.0000", "ikPsFeeIn": "3.0000", "ikPrice": "0.0000", "psAmount": "0.0000", "psIkFee": "0.0000", "psExchFee": "0.0000", "psFeeIn": "0.0000", "psFeeOut": "0.0000", "psPrice": "0.0000", "psAccepted": "0.0000", "ikExchRate": "0.0000", "ikExchRateSys": "1", "psCurRate": "0.0000", "stateName": "waitAccept", "currencyId": 20, "currencyCodeChar": "USD", "currencyCodeNum": "700", "subAccountNo": "676276568" } } ``` -------------------------------- ### Send Payment Success Callback Example Source: https://docs.unityfinance.com/ This cURL command demonstrates how to send a POST request to simulate a successful payment callback. Ensure your Interaction URL supports HTTPS and the server responds with a 200 OK status to confirm receipt. ```curl curl --location -g --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'ik_payment_method=card' \ --data-urlencode 'ik_payment_currency=EUR' \ --data-urlencode 'ik_cur=EUR' \ --data-urlencode 'ik_co_id=63c1058f418de0000002d0f0' \ --data-urlencode 'ik_co_prs_id=370000096' \ --data-urlencode 'ik_inv_id=568704592' \ --data-urlencode 'ik_inv_st=success' \ --data-urlencode 'ik_inv_crt=2023-11-01 17:42:47' \ --data-urlencode 'ik_inv_prc=2023-11-01 16:42:58' \ --data-urlencode 'ik_trn_id=92000025' \ --data-urlencode 'ik_pm_no=1' \ --data-urlencode 'ik_am=50' \ --data-urlencode 'ik_co_rfn=48.0000' \ --data-urlencode 'ik_ps_price=50' \ --data-urlencode 'ik_desc=payment3' \ --data-urlencode 'ik_customer_last_name=Dou' \ --data-urlencode 'ik_customer_first_name=John' \ --data-urlencode 'ik_sign=6ENy92FMl8rSkA9Fdwl/A6hhl2px000000000iBsFlM=' \ ``` -------------------------------- ### Get User Accounts Source: https://docs.unityfinance.com/ Retrieves a list of accounts available to the user. Requires authorization. ```json { "status": "ok", "code": 0, "data": { "53fc71c9bf4efc7e6fea0f53": { "_id": "53fc71c9bf4efc7e6fea0f53", "nm": "Personal", "tp": "c", "usr": [ { "id": "53fc7175bf4efc8470ea0f38", "rl": "o" } ] }, "53fc8db9bf4efc7449ea0f3d": { "_id": "53fc8db9bf4efc7449ea0f3d", "nm": "Business", "tp": "b", "usr": [ { "id": "53fc7175bf4efc8470ea0f38", "rl": "o" } ] } } } ``` -------------------------------- ### Get All Accounts Source: https://docs.unityfinance.com/ Retrieves a list of all accounts available to the user. Requires authorization. ```APIDOC ## Get All Accounts ### Description Retrieves a list of all accounts available to the user. Requires authorization. ### Method GET ### Endpoint /account ### Request Example (No request body specified) ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation. - **code** (integer) - A status code, 0 typically indicates success. - **data** (object) - Contains account details. - **account_id** (object) - An object representing a specific account. - **_id** (string) - The unique identifier for the account. - **nm** (string) - The name of the account. - **tp** (string) - The type of the account (e.g., 'c' for client, 'b' for business). - **usr** (array) - A list of users associated with the account. - **id** (string) - The user ID. - **rl** (string) - The user's role. #### Response Example ```json { "status": "ok", "code": 0, "data": { "53fc71c9bf4efc7e6fea0f53": { "_id": "53fc71c9bf4efc7e6fea0f53", "nm": "Personal", "tp": "c", "usr": [ { "id": "53fc7175bf4efc8470ea0f38", "rl": "o" } ] }, "53fc8db9bf4efc7449ea0f3d": { "_id": "53fc8db9bf4efc7449ea0f3d", "nm": "Business", "tp": "b", "usr": [ { "id": "53fc7175bf4efc8470ea0f38", "rl": "o" } ] } } } ``` ``` -------------------------------- ### Get Account Details by ID Source: https://docs.unityfinance.com/ Retrieves detailed information about a specific account using its ID. The account ID must be included in the X-Api-Account-Id header. Requires authorization. ```json { "status": "ok", "code": 0, "data": { "_id": "62e17052bf99417a3f2e92e3", "nm": "Business", "tp": "b", "usr": [ { "id": "62e17052bf99417a3f2e92e2", "o": "1", "rl": "b_o" } ] } } ``` -------------------------------- ### Get Checkout Invoice Source: https://docs.unityfinance.com/ Retrieves the details of a specific checkout invoice using its ID. ```APIDOC ## GET /co-invoice/{co-invoice_id} ### Description Retrieves the details of a specific checkout invoice. ### Method GET ### Endpoint https://old-api.unityfinance.com/v1/co-invoice/{co-invoice_id} ### Parameters #### Header Parameters - **Authorization** (string) - Required - Authorize (HTTP) - **Ik-Api-Account-Id** (string) - Required - The business account ID ### Responses #### Success Response (200) - **status** (string) - OK - **code** (integer) - 0 - **data** (object) - The checkout invoice details #### Response Example (200) ```json { "status": "ok", "code": 0, "data": { "id": "100873000", "coId": "5785ff6b3d1eafa97e000000", "coPurseId": "916543644795", "paymentNo": "ID_4233", "paywayId": "5b3a0c353d1eafbb01000000", "state": "2", "result": "0", "expired": "2018-08-02 10:56:55", "processed": null, "created": "2018-07-03 10:56:55", "coAmount": "100.00", "coRefund": "97.0000", "ikFee": "3.0000", "ikFeeIn": "3.0000", "ikFeeOut": "0.0000", "ikPsFeeIn": "3.0000", "ikPrice": "0.0000", "psAmount": "0.0000", "psIkFee": "0.0000", "psExchFee": "0.0000", "psFeeIn": "0.0000", "psFeeOut": "0.0000", "psPrice": "0.0000", "psAccepted": "0.0000", "ikExchRate": "0.0000", "ikExchRateSys": "1", "psCurRate": "0.0000", "stateName": "waitAccept", "currencyId": 20, "currencyCodeChar": "USD", "currencyCodeNum": "700", "subAccountNo": "676276568" } } ``` #### Error Response (401) - **message** (string) - Auth: user not found ``` -------------------------------- ### POST: Create a new withdrawal Source: https://docs.unityfinance.com/ Use this endpoint to initiate a new withdrawal. Ensure all required parameters such as amount, purseId, and method are correctly provided. The 'action' parameter can be set to 'process' to create the withdrawal or 'calc' to only calculate fees. ```bash curl --location -g --request POST 'https://old-api.unityfinance.com/v1/withdraw' \ --header 'Authorization: Basic ****' \ --data-urlencode 'amount=50' \ --data-urlencode 'purseId=306077240000' \ --data-urlencode 'calcKey=psPayeeAmount' \ --data-urlencode 'action=process' \ --data-urlencode 'paymentNo=2134' \ --data-urlencode 'useShortAlias=true' \ --data-urlencode 'method=advcash' \ --data-urlencode 'currency=USD' \ --data-urlencode 'comment=withdrawal to my personal wallet' \ --data-urlencode 'details[account_number]=U150000012302' \ --data-urlencode 'interactionUrl=https://callback-url.com' ``` -------------------------------- ### Digital Signature Verification Values Source: https://docs.unityfinance.com/ These are example values for a SHA256 hash and its corresponding HMAC-SHA256 hash, used for verifying the integrity of API requests. ```text $sha256hash = '3bb2d70e485dbbe7bde2250635c0d5656f586fc025ad89bb1073f3f6af4e0b91' $hmac_hash = 'xjPx3hIc6fI3imCTf4RV6WFiHuxUFH3mro4eYI7cYL8=' ``` -------------------------------- ### Get Wallet Data by ID Source: https://docs.unityfinance.com/ Retrieves detailed data for a specific wallet using its ID. This includes balance, status, and creation details. ```APIDOC ## Get Wallet Data by ID Provides data for a given wallet ID. ### Method GET ### Endpoint /purse/{purse_id} ### Parameters #### Path Parameters - **purse_id** (string) - Required - ID of the purse #### Header Parameters - **Authorization** (string) - Required - Authorize (HTTP) - **Ik-Api-Account-Id** (string) - The business account ID ### Responses #### Success Response (200) Data for a given wallet ID #### Error Response (401) Auth: user not found ``` -------------------------------- ### Retrieve the list of used currencies and rates in the system. Source: https://docs.unityfinance.com/ This public endpoint allows you to fetch a list of currencies and their conversion rates used in the system. It does not require authorization. ```APIDOC ## GET /currency ### Description Retrieves a list of currencies and their conversion rates used in the system. ### Method GET ### Endpoint https://old-api.unityfinance.com/v1/currency ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the status of the response, typically "ok". - **code** (integer) - A status code, usually 0 for success. - **data** (object) - An object containing currency information and rates. - **{CURRENCY}** (object) - Represents a specific currency. - **id** (integer) - The unique identifier for the currency. - **{Currency-1}** (object) - Exchange rates to another currency. - **out** (float) - The rate for converting out of the base currency. - **in** (float) - The rate for converting into the base currency. #### Response Example ```json { "status": "ok", "code": 0, "data": { "EUR": { "id": 30, "USD": { "out": 0.061061, "in": 0.066883 }, "EUR": { "out": 0.048787, "in": 0.053786 } }, "USD": { "id": 20, "EUR": { "out": 15.247525, "in": 17.49 }, "EUR": { "out": 0.766931, "in": 0.855127 } } } } ``` ``` -------------------------------- ### Get a specific withdrawal Source: https://docs.unityfinance.com/ This endpoint fetches details about a specific withdrawal, identified by its unique ID. The response includes information such as the withdrawal ID, amount, method, and status. ```APIDOC ## Get a specific withdrawal This endpoint fetches details about a specific withdrawal, identified by its unique ID. The response includes information such as the withdrawal ID, amount, method, and status. ### Path Parameters - **withdrawal_id** (string, required) - The ID of the withdrawal to fetch. ### Header Parameters - **Authorization** (string, required) - Authorize (HTTP) - **Ik-Api-Account-Id** (string) - The business account ID ### Responses #### Success Response (200) The list of withdrawals #### Error Response (401) Auth: user not found ### Method GET ### Endpoint https://old-api.unityfinance.com/v1/withdraw/{withdrawal_id} ### Response Example (200) ```json { "status": "ok", "code": 0, "data": { "id": "178", "psTrnId": "310036", "purseId": "306077243209", "accountId": "53fc8db9bf4efc74000000000", "coId": "5469f815bf4efc3000000000", "paymentNo": "pay123", "paywayId": "5f07000000000d24008b456c", "state": "8", "result": "0", "created": "2023-05-25T14:15:22Z", "processed": "2023-05-25T14:25:24Z", "chargebacked": null, "payerWriteoff": "100.00", "payeeReceive": "98.00", "ikFee": "2.00", "ikPrice": "100.00", "ikPsPrice": "100.00", "psFeeOut": "0.00", "psAmount": "100.00", "psValue": "100.00", "psPrice": "100.00", "psCurRate": "1.00", "details": { "walletId": "155026360150" }, "comment": "Withdrawal to my wallet", "calc": "payer", "stateName": "success", "currencyId": 30, "currencyCodeChar": "USD", "currencyCodeNum": 980 } } ``` ``` -------------------------------- ### Refund Request Response Sample Source: https://docs.unityfinance.com/ This is a sample JSON response indicating the status of a refund request. It confirms if the request was sent successfully. ```json { "status": "ok", "code": 0, "data": { "@resultCode": 0, "@resultMessage": "Refund request sent successfully. Please, wait for a callback from the Payment System." }, "message": "Success" } ``` -------------------------------- ### Get Payment Data for Specific Invoice ID Source: https://docs.unityfinance.com/ Retrieves detailed information for a specific invoice using its unique ID. This includes status, creation date, and amount. ```APIDOC ## Get payment data for a specific ID This endpoint provides detailed information for a specific invoice, identified by its unique invoice ID in the URL. The returned data contains an invoice object with properties such as its unique ID, current state (both a numeric code and textual description), the date and time the invoice was created, and the total amount of the invoice. This allows for invoice-specific queries and management. ### Method GET ### Endpoint /co-invoice/{co-invoice_id} ### Parameters #### Path Parameters - **co-invoice_id** (string) - Required - The ID of the co-invoice ``` -------------------------------- ### Send Payment Request to Gateway Source: https://docs.unityfinance.com/ Use this cURL command to send a POST request to the payment gateway with all necessary payment details. Ensure 'ik_act' is set to 'payway' and include payment method and currency. ```bash curl --location --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'ik_co_id=51237daa8f2a2d8413000000' \ --data-urlencode 'ik_pm_no=ID_4233' \ --data-urlencode 'ik_am=1.44' \ --data-urlencode 'ik_cur=EUR' \ --data-urlencode 'ik_desc=Payment Description' \ --data-urlencode 'ik_act=payway' \ --data-urlencode 'ik_int=json' \ --data-urlencode 'ik_payment_method=visa' \ --data-urlencode 'ik_payment_currency=EUR' ``` -------------------------------- ### Response Sample for Wallet Data Source: https://docs.unityfinance.com/ This JSON structure represents a successful response (200 OK) when retrieving data for a specific wallet. It includes details such as account ID, wallet type, name, status, and balance information. ```json { "status": "ok", "code": 0, "data": { "103313815000": { "id": "103313815000", "accountId": "63eb7341e41f862794100000", "type": "c", "name": "Payments in EUR", "status": "1", "balance": "180.0000", "frozen": "30.0000", "turnover": "200.0000", "settings": { "co": "5785ff6b3d1eafa97e000000" }, "created": "2023-05-23 03:03:27", "blockedAmount": "50" } } } ``` -------------------------------- ### Make Refund Source: https://docs.unityfinance.com/ Initiates a full or partial refund for a previously paid payment. Currently only supports bank card payments. ```APIDOC ## POST /refund ### Description Initiates a full or partial refund for a previously paid payment. Currently, refunds are possible only for bank card payments. ### Method POST ### Endpoint https://old-api.unityfinance.com/v1/refund ### Parameters #### Header Parameters - **Authorization** (string) - Required - Authorize (HTTP) - **Ik-Api-Account-Id** (string) - Required - The business account ID #### Request Body - **id** (string) - Required - The ID of the payment to make a refund from - **amount** (string) - Required - The refund amount ### Responses #### Success Response (200) - **status** (string) - OK - **code** (integer) - 0 - **data** (object) - Contains refund request status details #### Response Example (200) ```json { "status": "ok", "code": 0, "data": { "@resultCode": 0, "@resultMessage": "Refund request sent successfully. Please, wait for a callback from the Payment System." }, "message": "Success" } ``` #### Error Response (401) - **message** (string) - Auth: user not found ``` -------------------------------- ### Get a list of purses connected to the account Source: https://docs.unityfinance.com/ This endpoint retrieves a list of all purses linked to your merchant account. You can filter this list by passing the `checkoutId` for a specific checkout or the `currency` ID for a specific currency. ```APIDOC ## GET /purse ### Description Retrieves a list of all purses linked to your merchant account. Can be filtered by `checkoutId` or `currency`. ### Method GET ### Endpoint /purse ### Parameters #### Query Parameters - **checkoutId** (string) - Optional - The ID of a specific checkout - **currency** (string) - Optional - Enum: "10" "20" "30" "40" - The ID of a specific currency #### Header Parameters - **Authorization** (string) - Required - Authorize (HTTP) - **Ik-Api-Account-Id** (string) - Required - The business account ID ### Responses #### Success Response (200) A list of purses connected to the account. #### Error Response (401) - **status** (string) - Auth: user not found ``` -------------------------------- ### Retrieve details for the specified currency Source: https://docs.unityfinance.com/ This endpoint retrieves a specific currency and its exchange rates within the Unity Finance system. It does not require any authorization. ```APIDOC ## GET /currency/{currency_id} ### Description Retrieves details for a specific currency, including its exchange rates. ### Method GET ### Endpoint https://old-api.unityfinance.com/v1/currency/{currency_id} ### Parameters #### Path Parameters - **currency_id** (string) - Required - The ID of the currency to retrieve. ### Request Example ``` GET /currency/10 ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the response, typically "ok". - **code** (integer) - A status code, usually 0 for success. - **data** (object) - An object containing currency information and rates. - **{CURRENCY}** (object) - Represents the requested currency. - **id** (integer) - The unique identifier for the currency. - **{Currency-1}** (object) - Exchange rates to another currency. - **out** (float) - The rate for converting out of the base currency. - **in** (float) - The rate for converting into the base currency. #### Response Example ```json { "status": "ok", "code": 0, "data": { "EUR": { "USD": { "out": 0.061061, "in": 0.066883 }, "EUR": { "out": 0.048787, "in": 0.053786 } } } } ``` ``` -------------------------------- ### Payment Gateway Response Structure Source: https://docs.unityfinance.com/ This is a sample JSON response from the payment gateway detailing the invoice information after a successful payment request. It includes transaction IDs, amounts, and fees. ```json { "resultCode":0, "resultMsg":"Success", "resultData": { "invoice": { "checkoutId":"51237daa8f2a2d8413000000", "checkoutPurseId":"307447812424", "paymentNo":"218", "paywayId":"4f217ec98f2a2d4c0c000318", "paywayPurseId":"50d828d159d93cfb72000001", "expired":1385305065, "coAmount":5, "coRefund":4.925, "ikFee":0.15, "ikFeeIn":0.075, "ikFeeOut":0.075, "ikPrice":5.075, "psAmount":0.4323, "psFeeIn":0, (deprecated) "psFeeOut":3, "psPrice":0.44, "psExchRate":0.085166 } } } ``` -------------------------------- ### Retrieve Payment Cost Source: https://docs.unityfinance.com/ Fetch the payment form from the payment system's gateway by setting specific action and payment parameters. This endpoint can be accessed using either POST or GET methods. ```APIDOC ## POST/GET / ### Description To fetch the payment form from the payment system's gateway, ensure you set these parameters: `ik_act=payway`, `ik_payment_method`, and `ik_payment_currency`. ### Method POST or GET ### Endpoint https://old-pay.unityfinance.com ### Parameters #### Query Parameters - **ik_co_id** (string) - Required - Your company ID. - **ik_pm_no** (string) - Required - Payment method number. - **ik_am** (number) - Required - The amount to be paid. - **ik_cur** (string) - Required - The currency of the payment. - **ik_desc** (string) - Required - Description of the payment. - **ik_act** (string) - Required - Action type, should be `payway`. - **ik_int** (string) - Required - Integration type, should be `json`. - **ik_payment_method** (string) - Required - The payment method to use (e.g., `visa`). - **ik_payment_currency** (string) - Required - The currency for the payment method. ### Request Example ```curl curl --location --request POST 'https://old-pay.unityfinance.com' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'ik_co_id=51237daa8f2a2d8413000000' \ --data-urlencode 'ik_pm_no=ID_4233' \ --data-urlencode 'ik_am=1.44' \ --data-urlencode 'ik_cur=EUR' \ --data-urlencode 'ik_desc=Payment Description' \ --data-urlencode 'ik_act=payway' \ --data-urlencode 'ik_int=json' \ --data-urlencode 'ik_payment_method=visa' \ --data-urlencode 'ik_payment_currency=EUR' ``` ### Response #### Success Response (200) - **resultCode** (integer) - Indicates the result of the operation. - **resultMsg** (string) - A message describing the result. - **resultData** (object) - Contains detailed payment information. - **invoice** (object) - Invoice details. - **checkoutId** (string) - The ID of the checkout. - **checkoutPurseId** (string) - The purse ID for the checkout. - **paymentNo** (string) - The payment number. - **paywayId** (string) - The ID of the payment gateway. - **paywayPurseId** (string) - The purse ID for the payment gateway. - **expired** (integer) - Expiration timestamp. - **coAmount** (number) - The checkout amount. - **coRefund** (number) - The checkout refund amount. - **ikFee** (number) - The fee charged by UnityFinance. - **ikFeeIn** (number) - Internal fee. - **ikFeeOut** (number) - External fee. - **ikPrice** (number) - Total price including fees. - **psAmount** (number) - Payment service amount. - **psFeeOut** (number) - Payment service external fee. - **psPrice** (number) - Total price including payment service fees. - **psExchRate** (number) - Payment service exchange rate. #### Response Example ```json { "resultCode":0, "resultMsg":"Success", "resultData": { "invoice": { "checkoutId":"51237daa8f2a2d8413000000", "checkoutPurseId":"307447812424", "paymentNo":"218", "paywayId":"4f217ec98f2a2d4c0c000318", "paywayPurseId":"50d828d159d93cfb72000001", "expired":1385305065, "coAmount":5, "coRefund":4.925, "ikFee":0.15, "ikFeeIn":0.075, "ikFeeOut":0.075, "ikPrice":5.075, "psAmount":0.4323, "psFeeOut":3, "psPrice":0.44, "psExchRate":0.085166 } } } ``` ``` -------------------------------- ### Withdrawal Response Sample (200 OK) Source: https://docs.unityfinance.com/ This JSON object represents a successful withdrawal creation. It includes details about the transaction, such as IDs, amounts, fees, and status. ```json { "status": "ok", "code": 0, "data": { "messageArg": { "paysystemCode": "2119", "codeDescription": "Transaction is processing" }, "withdraw": { "id": "abc", "trnId": "3167636", "purseId": "306077243209", "accountId": "53fc8db9bf4efc74000000000", "coId": "5469f815bf4efc3000000000", "paymentNo": "pay123", "paywayId": "5f07000000000d24008b456c", "paywayPurseId": "5f0707621ae1bd2", "state": 12, "result": 43101, "created": "2023-05-25T14:15:22Z", "payerWriteoff": "100.00", "payeeReceive": "98.00", "ikFee": "2.00", "ikPrice": "100.00", "ikPsPrice": "100.00", "psFeeIn": "0.00", "psFeeOut": "0.00", "psCost": "0.00", "ikIncome": "0.00", "psAmount": "100.00", "psValue": "100.00", "psPrice": "100.00", "psCurRate": "1.00", "details": { "walletId": "155026360150" }, "calc": "payer", "psResultDesc": "Success", "comment": "withdrawal to my personal wallet" }, "transaction": { "id": "abc", "opId": "9231849", "opType": "wd", "payerPurseId": "abc", "payerBalance": "1000.00", "state": 3, "created": "2023-05-25T14:15:22Z", "payerAmount": "100.00", "payerPrice": "100.00", "payerFee": "2.00", "payerExchFee": "0.00", "payeeAmount": "98.00", "payeeFee": "0.00", "payeePrice": "98.00", "exchRate": "1.00" }, "@resultCode": 43101, "@resultMessage": "[2119] [Transaction is processing]" }, "message": "[2119] [Transaction is processing]" } ```