### C# HttpClient API Request Example Source: https://developer.makecommerce.net/api/get-transaction An example demonstrating how to make a GET request to the MakeCommerce API using HttpClient in C#. It includes setting the Authorization header with Basic Authentication. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/transactions/:transaction_id"); request.Headers.Add("Accept", "application/hal+json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### HTTP Basic Authentication Example in C# Source: https://developer.makecommerce.net/api/get-refund-list Example of making an authenticated GET request using HttpClient in C#. Ensure your Authorization header is correctly formatted with Base64 encoded credentials. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/refunds"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Basic Authentication Source: https://developer.makecommerce.net/api/get-payment-methods Demonstrates how to make a GET request to the MakeCommerce API using HttpClient in C#. Ensure the Authorization header is correctly formatted with base64-encoded credentials. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/methods"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Get Fees Source: https://developer.makecommerce.net/api/get-fees This C# code snippet demonstrates how to make a GET request to the shop fees endpoint using HttpClient. It includes setting the request method, URL, Accept header, and Authorization header with Basic Authentication. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/shop/fees"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Basic Authentication C# Example Source: https://developer.makecommerce.net/api/get-refund This C# code demonstrates how to make a GET request to the refunds endpoint using Basic Authentication. Ensure your shop ID and API secret key are correctly base64-encoded and included in the Authorization header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/refunds/:refund_id"); request.Headers.Add("Accept", "application/hal+json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Account Statement XML Source: https://developer.makecommerce.net/api/get-account-statement-xml Example of making a GET request to the Account Statement XML endpoint using C# HttpClient. Includes setting headers for Accept and Authorization. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/shop/accountstatements/xml"); request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Basic Authentication Source: https://developer.makecommerce.net/api/get-transaction-statement Demonstrates how to make a GET request to the transactions statement endpoint using HttpClient in C#. Ensure your Authorization header is correctly formatted with Base64 encoded credentials. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/transactions/:transaction_id/statement"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Basic Authentication with HttpClient in C# Source: https://developer.makecommerce.net/api/get-shop-configuration Use this snippet to perform GET requests with Basic Authentication. Ensure your shop ID and API secret key are correctly base64-encoded and placed in the Authorization header. This example fetches shop configuration. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/shop/configuration"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Basic Authentication Example in C# Source: https://developer.makecommerce.net/api/get-account-statement-camt-053 This C# code snippet demonstrates how to make a GET request to the account statements API using Basic Authentication. It includes setting the Authorization header with base64-encoded credentials. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/shop/accountstatements/camt053"); request.Headers.Add("Accept", "application/xml"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example Payment Methods Response Source: https://developer.makecommerce.net/api/get-payment-methods This snippet provides an example of a successful response when querying for payment methods, showcasing sample data for bank links. ```APIDOC ## Example Payment Methods Response ### Description This is an example of the response body for a successful request to retrieve payment methods. ### Response Example (200 OK) ```json { "banklinks": [ { "name": "swedbank", "url": "https://payment.test.maksekeskus.ee/open-banking.html?method=EE_SWED_OB&trx=", "country": "ee", "countries": [ "ee" ], "channel": "Swedbank EE OB", "max_amount": 15000, "display_name": "Swedbank", "logo_url": "https://static.test.maksekeskus.ee/img/channel/lnd/swedbank.png" }, { "name": "seb", "url": "https://payment.test.maksekeskus.ee/open-banking.html?method=EE_SEB_OB&trx=", "country": "ee", "countries": [ "ee" ], "channel": "SEB EE OB", "max_amount": 15000, "display_name": "SEB", "logo_url": "https://static.test.maksekeskus.ee/img/channel/lnd/seb.png" }, { "name": "lhv", "url": "https://payment.test.maksekeskus.ee/open-banking.html?method=EE_LHV_OB&trx=", "country": "ee", "countries": [ "ee" ], "channel": "LHV EE OB", "max_amount": 15000, "display_name": "LHV", "logo_url": "https://static.test.maksekeskus.ee/img/channel/lnd/lhv.png" } ] } ``` ``` -------------------------------- ### Example Transaction Object Source: https://developer.makecommerce.net/api/get-transaction An example of a transaction object, showing typical values for created transactions. ```json { "_links": { "self": { "href": "https://api.test.maksekeskus.ee/v1/transactions/1fea72b7-cc54-4844-8409-5ff188eb40c3" } }, "amount": 75.95, "channel": null, "country": "ee", "created_at": "2024-01-06T12:04:14+0000", "currency": "EUR", "customer": { "country": "ee", "created_at": "2024-01-06T12:04:14+0000", "email": "mk.test@maksekeskus.ee", "id": "d4c7bcc8-c962-49d9-b18b-a9c79fdbd8cc", "ip": "10.128.96.76", "locale": "en", "name": "d4c7bcc8-c962-49d9-b18b-a9c79fdbd8cc", "object": "customer" }, "id": "1fea72b7-cc54-4844-8409-5ff188eb40c3", "merchant_data": "Internal Order ID: 321", "method": null, "object": "transaction", "recurring_required": false, "terms_required": false, "reference": "123abc", "status": "CREATED", "transaction_url": { "cancel_url": { "method": "POST", "url": "https://example.com/cancel_url" }, "cart_url": null, "notification_url": { "method": "POST", "url": "https://example.com/notification_url" }, "return_url": { "method": "POST", "url": "https://example.com/return_url" } }, "type": null } ``` -------------------------------- ### GET /v1/shop/configuration Source: https://developer.makecommerce.net/api/get-shop-configuration Retrieves the current configuration settings for the shop. ```APIDOC ## GET /v1/shop/configuration ### Description Returns configuration of the Shop. ### Method GET ### Endpoint /v1/shop/configuration ### Response #### Success Response (200) - **configuration** (object) - The shop's configuration details. ``` -------------------------------- ### Transaction Statement Example Data Source: https://developer.makecommerce.net/api/get-transaction-statement This example provides sample data for a transaction statement, including income, fees, and refunds. ```json [ { "created": "2024-01-06T13:32:20+0000", "amount": 75.95, "type": "INCOME", "transaction": "1540286", "channel": "Visa/Mastercard", "merchant_reference": "123abc", "original_amount": 0, "exchange_rate": 0 }, { "created": "2024-01-06T13:32:20+0000", "amount": -0.38, "type": "TRX_FEE", "transaction": "1540286", "channel": "Visa/Mastercard", "merchant_reference": "123abc", "original_amount": 0, "exchange_rate": 0 }, { "created": "2024-01-06T13:32:20+0000", "amount": -0.08, "type": "VAT", "transaction": "1540286", "channel": "Visa/Mastercard", "merchant_reference": "123abc", "original_amount": 0, "exchange_rate": 0 }, { "created": "2024-01-06T13:32:20+0000", "amount": -0.3, "type": "TRX_FEE_FIX", "transaction": "1540286", "channel": "Visa/Mastercard", "merchant_reference": "123abc", "original_amount": 0, "exchange_rate": 0 }, { "created": "2024-01-06T13:32:20+0000", "amount": -0.06, "type": "VAT", "transaction": "1540286", "channel": "Visa/Mastercard", "merchant_reference": "123abc", "original_amount": 0, "exchange_rate": 0 }, { "created": "2024-01-06T13:33:29+0000", "amount": -5, "type": "REFUND", "transaction": "1540286", "merchant_reference": "123abc", "original_amount": 0, "exchange_rate": 0 } ] ``` -------------------------------- ### Example Bad Request Error Response (Missing Parameters) Source: https://developer.makecommerce.net/api/get-account-statement This example shows a bad request error response when required parameters like 'since' or 'payout_id' are missing. ```json { "code": 1001, "message": "since or payout_id must be present", "errors": [ { "type": "missing", "parameter": "since" }, { "type": "missing", "parameter": "payout_id" } ] } ``` -------------------------------- ### Example JSON Response for Fees (Data) Source: https://developer.makecommerce.net/api/get-fees This example shows a sample JSON response containing actual accounting fee data. It includes entries with 'object' type 'accounting', amounts, VAT, unique IDs, and creation timestamps. ```json [ { "object": "accounting", "amount": -10, "vat": -2, "id": "8bf8e1ac-9796-4db9-848b-4819eb0f42f4", "created_at": "2023-11-30T02:01:46+0000" }, { "object": "accounting", "amount": -5, "vat": -1, "id": "218aad9f-c5e3-4b19-bfdf-5df430ad0b05", "created_at": "2023-12-31T21:30:12+0000" } ] ``` -------------------------------- ### Example JSON Response for Fees (Schema) Source: https://developer.makecommerce.net/api/get-fees This example demonstrates the structure of the JSON response when successfully retrieving accounting fee records. It outlines the fields and their expected data types. ```json [ { "accounting_id": "string", "object": "string", "created_at": "2024-07-29T15:51:28.071Z", "amount": 0, "vat": 0 } ] ``` -------------------------------- ### Open Banking Transaction Examples Source: https://developer.makecommerce.net/api/get-transaction-list These snippets illustrate open banking transactions, showing examples of completed and expired statuses with different channel identifiers. ```json [ { "amount": 10, "currency": "EUR", "object": "transaction", "status": "COMPLETED", "reference": "autotest", "customer": { "object": "customer", "locale": "et", "country": "ee", "ip": "13.48.4.195", "name": "83368374-c835-43de-a857-d7761143bf22", "links": [], "id": "83368374-c835-43de-a857-d7761143bf22", "created_at": "2023-01-06T04:05:01+0000", "ip_country": "se" }, "type": "open_banking", "method": "swedbank", "channel": "Swedbank EE OB", "country": "ee", "links": [ { "rel": "self", "href": "https://api.test.maksekeskus.ee/v1/transactions/58185cbc-c844-4b65-848b-de26e4f4b3d3" } ], "id": "58185cbc-c844-4b65-848b-de26e4f4b3d3", "created_at": "2023-01-06T04:05:01+0000", "completed_at": "2023-01-06T04:05:25+0000", "fees": 0.55, "fees_vat": 0.11, "net_amount": 9.34, "recurring_required": false, "terms_required": false }, { "amount": 10, "currency": "EUR", "object": "transaction", "status": "EXPIRED", "reference": "autotest", "customer": { "object": "customer", "locale": "et", "country": "ee", "ip": "13.48.4.195", "name": "97cd5cc7-2e1c-447a-88f2-93d1e584269c", "links": [], "id": "97cd5cc7-2e1c-447a-88f2-93d1e584269c", "created_at": "2023-01-06T04:05:52+0000", "ip_country": "se" }, "type": "open_banking", "method": "swedbank", "channel": "Swedbank LV OB", "country": "ee", "links": [ { "rel": "self", "href": "https://api.test.maksekeskus.ee/v1/transactions/ddd76f9c-adc3-4459-b8fd-7b7b4634a4ac" } ], "id": "ddd76f9c-adc3-4459-b8fd-7b7b4634a4ac", "created_at": "2023-01-06T04:05:52+0000", "recurring_required": false, "terms_required": false }, { "amount": 10, "currency": "EUR", "object": "transaction", "status": "EXPIRED", "reference": "autotest", "customer": { "object": "customer", "locale": "et", ``` -------------------------------- ### Detailed Transaction History Example Source: https://developer.makecommerce.net/api/get-account-statement This example showcases a more detailed transaction history, including various transaction types like PAYOUT, INCOME, TRX_FEE_FIX, VAT, and TRX_FEE. It illustrates how different fields like transaction, channel, and merchant_reference are populated for each entry. ```json [ { "created": "2023-01-06T00:00:02+0000", "amount": -9.34, "type": "PAYOUT", "balance_before": 9.34, "balance_after": 0, "payout_id": "48831", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T04:10:08+0000", "amount": 10, "type": "INCOME", "transaction": "1347131", "channel": "EE_SWED_OB", "balance_before": 0, "balance_after": 10, "transaction_id": "58185cbc-c844-4b65-848b-de26e4f4b3d3", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T04:10:08+0000", "amount": -0.3, "type": "TRX_FEE_FIX", "transaction": "1347131", "channel": "EE_SWED_OB", "balance_before": 10, "balance_after": 9.7, "transaction_id": "58185cbc-c844-4b65-848b-de26e4f4b3d3", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T04:10:08+0000", "amount": -0.06, "type": "VAT", "transaction": "1347131", "channel": "EE_SWED_OB", "balance_before": 9.7, "balance_after": 9.64, "transaction_id": "58185cbc-c844-4b65-848b-de26e4f4b3d3", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T04:10:08+0000", "amount": -0.25, "type": "TRX_FEE", "transaction": "1347131", "channel": "EE_SWED_OB", "balance_before": 9.64, "balance_after": 9.39, "transaction_id": "58185cbc-c844-4b65-848b-de26e4f4b3d3", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T04:10:08+0000", "amount": -0.05, "type": "VAT", "transaction": "1347131", "channel": "EE_SWED_OB", "balance_before": 9.39, "balance_after": 9.34, "transaction_id": "58185cbc-c844-4b65-848b-de26e4f4b3d3", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T08:22:32+0000", "amount": 10, "type": "INCOME", "transaction": "1347258", "channel": "LV_SWED_OB", "balance_before": 9.34, "balance_after": 19.34, "transaction_id": "6e7bf70d-370c-4e4e-bae0-091fe1ee0343", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T08:22:32+0000", "amount": -0.3, "type": "TRX_FEE_FIX", "transaction": "1347258", "channel": "LV_SWED_OB", "balance_before": 19.34, "balance_after": 19.04, "transaction_id": "6e7bf70d-370c-4e4e-bae0-091fe1ee0343", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T08:22:32+0000", "amount": -0.06, "type": "VAT", "transaction": "1347258", "channel": "LV_SWED_OB", "balance_before": 19.04, "balance_after": 18.98, "transaction_id": "6e7bf70d-370c-4e4e-bae0-091fe1ee0343", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T08:22:32+0000", "amount": -0.25, "type": "TRX_FEE", "transaction": "1347258", "channel": "LV_SWED_OB", "balance_before": 18.98, "balance_after": 18.73, "transaction_id": "6e7bf70d-370c-4e4e-bae0-091fe1ee0343", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 }, { "created": "2023-01-06T08:22:32+0000", "amount": -0.05, "type": "VAT", "transaction": "1347258", "channel": "LV_SWED_OB", "balance_before": 18.73, "balance_after": 18.68, "transaction_id": "6e7bf70d-370c-4e4e-bae0-091fe1ee0343", "merchant_reference": "autotest", "payout_id": "48862", "original_amount": 0, "exchange_rate": 0 } ] ``` -------------------------------- ### Example Banklink Payment Methods Source: https://developer.makecommerce.net/api/get-payment-methods Provides examples of banklink payment methods available, including Swedbank, SEB, and LHV for Estonia. Each entry shows the payment method name, URL, country, channel, maximum amount, display name, and logo URL. ```json { "banklinks": [ { "name": "swedbank", "url": "https://payment.test.maksekeskus.ee/open-banking.html?method=EE_SWED_OB&trx=", "country": "ee", "countries": [ "ee" ], "channel": "Swedbank EE OB", "max_amount": 15000, "display_name": "Swedbank", "logo_url": "https://static.test.maksekeskus.ee/img/channel/lnd/swedbank.png" }, { "name": "seb", "url": "https://payment.test.maksekeskus.ee/open-banking.html?method=EE_SEB_OB&trx=", "country": "ee", "countries": [ "ee" ], "channel": "SEB EE OB", "max_amount": 15000, "display_name": "SEB", "logo_url": "https://static.test.maksekeskus.ee/img/channel/lnd/seb.png" }, { "name": "lhv", "url": "https://payment.test.maksekeskus.ee/open-banking.html?method=EE_LHV_OB&trx=", "country": "ee", "countries": [ "ee" ], ``` -------------------------------- ### C# HttpClient Example for POST Request Source: https://developer.makecommerce.net/api/create-transaction Demonstrates how to make a POST request to the /v1/transactions endpoint using HttpClient in C#. Ensure your shop credentials are base64-encoded and included in the Authorization header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.test.maksekeskus.ee/v1/transactions"); request.Headers.Add("Accept", "application/hal+json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var content = new StringContent("{\n \"transaction\": {\n \"amount\": \"75.95\",\n \"currency\": \"EUR\",\n \"reference\": \"123abc\",\n \"merchant_data\": \"Internal Order ID: 321\",\n \"recurring_required\": \"false\",\n \"terms_required\": \"false\",\n \"transaction_url\": {\n \"return_url\": {\n \"url\": \"https://example.com/return_url\",\n \"method\": \"POST\"\n },\n \"cancel_url\": {\n \"url\": \"https://example.com/cancel_url\",\n \"method\": \"POST\"\n },\n \"notification_url\": {\n \"url\": \"https://example.com/notification_url\",\n \"method\": \"POST\"\n }\n }\n },\n \"customer\": {\n \"email\": \"mk.test@maksekeskus.ee\",\n \"ip\": \"10.128.96.76\",\n \"country\": \"ee\",\n \"locale\": \"ee\",\n \"name\": \"John Smith\"\n },\n \"app_info\": {\n \"module\": \"WooCommerce\",\n \"module_version\": \"3.2.0\",\n \"platform\": \"Wordpress\",\n \"platform_version\": \"5.1\"\n }\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Create Payment with Token (C#) Source: https://developer.makecommerce.net/api/create-payment This C# code snippet demonstrates how to create a payment for a transaction using a token. It requires setting up an HttpClient, defining the request, and including the Authorization header with Basic authentication. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://api.test.maksekeskus.ee/v1/transactions/:transaction_id/payments"); request.Headers.Add("Accept", "application/hal+json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var content = new StringContent("{\n \"token\": \"{{token_id}}\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Refund API Endpoint Example Source: https://developer.makecommerce.net/api/create-refund Example of a response from a refund API endpoint, illustrating the structure of refund and transaction details. ```APIDOC ## GET /v1/refunds/{id} ### Description Retrieves the details of a specific refund by its ID. ### Method GET ### Endpoint `/v1/refunds/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the refund. ### Response #### Success Response (200) - **_links** (object) - Links related to the refund. - **self** (object) - Link to the refund resource. - **href** (string) - The URL of the refund resource. - **amount** (number) - The amount of the refund. - **comment** (string) - A comment associated with the refund. - **created_at** (string) - The timestamp when the refund was created. - **currency** (string) - The currency of the refund. - **id** (string) - The unique identifier for the refund. - **object** (string) - The type of object, which is 'refund'. - **status** (string) - The current status of the refund. - **transaction** (object) - Details of the transaction related to the refund. - **_links** (object) - Links related to the transaction. - **self** (object) - Link to the transaction resource. - **href** (string) - The URL of the transaction resource. - **amount** (number) - The total amount of the transaction. - **channel** (string) - The channel through which the transaction was processed. - **completed_at** (string) - The timestamp when the transaction was completed. - **country** (string) - The country where the transaction occurred. - **created_at** (string) - The timestamp when the transaction was created. - **currency** (string) - The currency of the transaction. - **customer** (object) - Information about the customer. - **country** (string) - The country of the customer. - **created_at** (string) - The timestamp when the customer was created. - **email** (string) - The email address of the customer. - **id** (string) - The unique identifier for the customer. - **ip** (string) - The IP address of the customer. - **locale** (string) - The locale setting for the customer. - **name** (string) - The name of the customer. - **object** (string) - The type of object, which is 'customer'. - **fees** (number) - The fees associated with the transaction. - **fees_vat** (number) - The VAT amount for the transaction fees. - **id** (string) - The unique identifier for the transaction. - **merchant_data** (string) - Additional data provided by the merchant. - **method** (string) - The payment method used for the transaction. - **net_amount** (number) - The net amount of the transaction. - **object** (string) - The type of object, which is 'transaction'. - **recurring_required** (boolean) - Indicates if recurring payments are required. - **terms_required** (boolean) - Specifies whether to require buyer consent for Terms and Conditions and Privacy Policy. - **reference** (string) - A reference identifier for the transaction. - **refunded_amount** (number) - The amount that has been refunded. - **refunded_at** (string) - The timestamp when the refund was processed. - **status** (string) - The status of the transaction. - **transaction_url** (object) - URLs related to the transaction. - **cancel_url** (object) - The URL and method to redirect when the operation is canceled. - **method** (string) - The HTTP method for the cancel link. - **url** (string) - The URL to return to. - **cart_url** (object) - The URL and method to access the shopping cart. - **method** (string) - The HTTP method for the cart link. - **url** (string) - The URL to return to. - **notification_url** (object) - The URL and method for notifications regarding the operation. - **method** (string) - The HTTP method for the notification link. - **url** (string) - The URL to return to. #### Response Example (Success) ```json { "_links": { "self": { "href": "https://api.test.maksekeskus.ee/v1/refunds/51235" } }, "amount": 5, "comment": "Refund reason", "created_at": "2024-01-06T13:33:24+0000", "currency": "EUR", "id": "51235", "object": "refund", "status": "SETTLED", "transaction": { "_links": { "self": { "href": "https://api.test.maksekeskus.ee/v1/transactions/152ea1fe-398b-47f1-a85a-28f0ca3406c1" } }, "amount": 75.95, "channel": "Visa/MasterCard", "completed_at": "2024-01-06T13:30:53+0000", "country": "ee", "created_at": "2024-01-06T13:29:20+0000", "currency": "EUR", "customer": { "country": "lt", "created_at": "2024-01-06T13:29:20+0000", "email": "mk.test@maksekeskus.ee", "id": "e32a8562-1ced-46ba-b575-d7fd95d26a43", "ip": "84.240.58.200", "locale": "en", "name": "NameSurname", "object": "customer" }, "fees": 0.68, "fees_vat": 0.14, "id": "152ea1fe-398b-47f1-a85a-28f0ca3406c1", "merchant_data": "Internal Order ID: 321", "method": "visa_mastercard_placeholder", "net_amount": 70.13, "object": "transaction", "recurring_required": false, "terms_required": false, "reference": "123abc", "refunded_amount": 5, "refunded_at": "2024-01-06T13:33:29+0000", "status": "PART_REFUNDED", "transaction_url": { "cancel_url": { "method": "POST", "url": "https://example.com/cancel_url" }, "cart_url": null, "notification_url": { "method": "POST", "url": "https://example.com/notification_url" } } } } ``` ``` -------------------------------- ### Basic Authentication with HttpClient in C# Source: https://developer.makecommerce.net/api/get-transaction-list Demonstrates how to make a GET request to the transactions endpoint using Basic Authentication with HttpClient in C#. Ensure your shop ID and API secret key are correctly base64-encoded for the Authorization header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/transactions"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Transaction Statement Schema Example (Empty) Source: https://developer.makecommerce.net/api/get-transaction-statement This example shows the structure of an empty transaction statement response. It is an array of transaction objects. ```json [ { "created": "2024-07-29T15:51:28.071Z", "amount": 0, "type": "string", "transaction": "string", "channel": "string", "merchant_reference": "string", "original_amount": 0, "exchange_rate": 0 } ] ``` -------------------------------- ### CAMT053 Missing Parameter Error Example Source: https://developer.makecommerce.net/api/get-account-statement-camt-053 This JSON example shows an error response when a mandatory parameter, such as 'until', is missing from the request. ```json { "code": 1001, "message": "Invalid request", "errors": [ { "type": "missing", "parameter": "until" } ] } ``` -------------------------------- ### HTTP Basic Authentication Example in C# Source: https://developer.makecommerce.net/api/get-account-statement This C# code snippet demonstrates how to make an API request using HTTP Basic Authentication. Ensure your shop ID and API secret key are correctly base64-encoded. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.test.maksekeskus.ee/v1/shop/accountstatements"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Account Statement XML API - Unauthorized Example Source: https://developer.makecommerce.net/api/get-account-statement-xml Example of a JSON response when the request is unauthorized. It includes an error code and a message. ```json { "code": 0, "message": "string" } ``` ```json { "code": 1004, "message": "Unauthorized" } ``` -------------------------------- ### Full Transaction Object Example Source: https://developer.makecommerce.net/api/get-transaction-list This snippet shows a comprehensive transaction object, including details like creation and completion timestamps, customer information, payment method, and associated URLs. ```json [ { "links": { "rel": "string", "href": "string" }, "id": "string", "object": "string", "created_at": "2024-07-29T15:51:28.071Z", "completed_at": "2024-07-29T15:51:28.071Z", "refunded_at": "2024-07-29T15:51:28.071Z", "status": "string", "reference": "string", "customer": { "id": "string", "object": "string", "created_at": "2024-07-29T15:51:28.071Z", "email": "string", "locale": "string", "country": "string", "ip": "string", "ip_country": "string", "name": "string" }, "refunded_amount": 0, "refunded_original_amount": 0, "type": "string", "method": "string", "channel": "string", "country": "string", "fees": 0, "fees_vat": 0, "net_amount": 0, "merchant_data": "string", "banklink": { "object": "string", "created_at": "2024-07-29T15:51:28.071Z", "iban": "string", "description": "string" }, "card": { "amount": 75.95, "card": { "last2": "11", "maskedPan": "450513********11", "name": "Name Surname", "object": "card", "type": "VISA" }, "created_at": "2024-01-07T17:16:05+0000", "currency": "EUR", "id": "5bff0af2-aa79-4cae-b532-c5845d10028a", "object": "payment", "status": "DEPOSITED", "token": { "created_at": "2023-10-23T14:23:09+0000", "id": "1450aaf4-e127-4e03-813e-864effeb92e4", "multiuse": true, "object": "token", "status": "active", "valid_until": "2024-06-30" } }, "transaction_url": { "return_url": { "url": "string", "method": "string" }, "cancel_url": { "url": "string", "method": "string" }, "notification_url": { "url": "string", "method": "string" }, "cart_url": { "url": "string", "method": "string" } }, "recurring_required": true, "terms_required": true } ] ``` -------------------------------- ### JSON Request Body Example Source: https://developer.makecommerce.net/api/create-transaction This is an example of the JSON payload structure for a transaction request. It includes details about the transaction, customer, and application information. ```json { "transaction": { "amount": "75.95", "currency": "EUR", "reference": "123abc", "merchant_data": "Internal Order ID: 321", "recurring_required": "false", "terms_required": "false", "transaction_url": { "return_url": { "url": "https://example.com/return_url", "method": "POST" }, "cancel_url": { "url": "https://example.com/cancel_url", "method": "POST" }, "notification_url": { "url": "https://example.com/notification_url", "method": "POST" } } }, "customer": { "email": "mk.test@maksekeskus.ee", "ip": "10.128.96.76", "country": "ee", "locale": "ee", "name": "John Smith" }, "app_info": { "module": "WooCommerce", "module_version": "3.2.0", "platform": "Wordpress", "platform_version": "5.1" } } ```