Skip to content

Latest commit

 

History

History
323 lines (260 loc) · 11.7 KB

TaxesApi.md

File metadata and controls

323 lines (260 loc) · 11.7 KB

Conekta.net.Api.TaxesApi

All URIs are relative to https://api.conekta.io

Method HTTP request Description
OrdersCreateTaxes POST /orders/{id}/tax_lines Create Tax
OrdersDeleteTaxes DELETE /orders/{id}/tax_lines/{tax_id} Delete Tax
OrdersUpdateTaxes PUT /orders/{id}/tax_lines/{tax_id} Update Tax

OrdersCreateTaxes

UpdateOrderTaxResponse OrdersCreateTaxes (string id, OrderTaxRequest orderTaxRequest, string acceptLanguage = null, string xChildCompanyId = null)

Create Tax

Create new taxes for an existing orden

Example

using System.Collections.Generic;
using System.Diagnostics;
using Conekta.net.Api;
using Conekta.net.Client;
using Conekta.net.Model;

namespace Example
{
    public class OrdersCreateTaxesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.conekta.io";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new TaxesApi(config);
            var id = 6307a60c41de27127515a575;  // string | Identifier of the resource
            var orderTaxRequest = new OrderTaxRequest(); // OrderTaxRequest | requested field for a taxes
            var acceptLanguage = es;  // string | Use for knowing which language to use (optional)  (default to es)
            var xChildCompanyId = 6441b6376b60c3a638da80af;  // string | In the case of a holding company, the company id of the child company to which will process the request. (optional) 

            try
            {
                // Create Tax
                UpdateOrderTaxResponse result = apiInstance.OrdersCreateTaxes(id, orderTaxRequest, acceptLanguage, xChildCompanyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TaxesApi.OrdersCreateTaxes: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the OrdersCreateTaxesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create Tax
    ApiResponse<UpdateOrderTaxResponse> response = apiInstance.OrdersCreateTaxesWithHttpInfo(id, orderTaxRequest, acceptLanguage, xChildCompanyId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling TaxesApi.OrdersCreateTaxesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string Identifier of the resource
orderTaxRequest OrderTaxRequest requested field for a taxes
acceptLanguage string Use for knowing which language to use [optional] [default to es]
xChildCompanyId string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

UpdateOrderTaxResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

HTTP response details

Status code Description Response headers
200 successful -
401 authentication error -
404 not found entity -
500 internal server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

OrdersDeleteTaxes

UpdateOrderTaxResponse OrdersDeleteTaxes (string id, string taxId, string acceptLanguage = null, string xChildCompanyId = null)

Delete Tax

Delete taxes for an existing orden

Example

using System.Collections.Generic;
using System.Diagnostics;
using Conekta.net.Api;
using Conekta.net.Client;
using Conekta.net.Model;

namespace Example
{
    public class OrdersDeleteTaxesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.conekta.io";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new TaxesApi(config);
            var id = 6307a60c41de27127515a575;  // string | Identifier of the resource
            var taxId = tax_lin_2tQ974hSHcsdeSZHG;  // string | identifier
            var acceptLanguage = es;  // string | Use for knowing which language to use (optional)  (default to es)
            var xChildCompanyId = 6441b6376b60c3a638da80af;  // string | In the case of a holding company, the company id of the child company to which will process the request. (optional) 

            try
            {
                // Delete Tax
                UpdateOrderTaxResponse result = apiInstance.OrdersDeleteTaxes(id, taxId, acceptLanguage, xChildCompanyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TaxesApi.OrdersDeleteTaxes: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the OrdersDeleteTaxesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete Tax
    ApiResponse<UpdateOrderTaxResponse> response = apiInstance.OrdersDeleteTaxesWithHttpInfo(id, taxId, acceptLanguage, xChildCompanyId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling TaxesApi.OrdersDeleteTaxesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string Identifier of the resource
taxId string identifier
acceptLanguage string Use for knowing which language to use [optional] [default to es]
xChildCompanyId string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

UpdateOrderTaxResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

HTTP response details

Status code Description Response headers
200 successful -
401 authentication error -
422 parameter validation error -
404 not found entity -
500 internal server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

OrdersUpdateTaxes

UpdateOrderTaxResponse OrdersUpdateTaxes (string id, string taxId, UpdateOrderTaxRequest updateOrderTaxRequest, string acceptLanguage = null, string xChildCompanyId = null)

Update Tax

Update taxes for an existing orden

Example

using System.Collections.Generic;
using System.Diagnostics;
using Conekta.net.Api;
using Conekta.net.Client;
using Conekta.net.Model;

namespace Example
{
    public class OrdersUpdateTaxesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.conekta.io";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new TaxesApi(config);
            var id = 6307a60c41de27127515a575;  // string | Identifier of the resource
            var taxId = tax_lin_2tQ974hSHcsdeSZHG;  // string | identifier
            var updateOrderTaxRequest = new UpdateOrderTaxRequest(); // UpdateOrderTaxRequest | requested field for taxes
            var acceptLanguage = es;  // string | Use for knowing which language to use (optional)  (default to es)
            var xChildCompanyId = 6441b6376b60c3a638da80af;  // string | In the case of a holding company, the company id of the child company to which will process the request. (optional) 

            try
            {
                // Update Tax
                UpdateOrderTaxResponse result = apiInstance.OrdersUpdateTaxes(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling TaxesApi.OrdersUpdateTaxes: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the OrdersUpdateTaxesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update Tax
    ApiResponse<UpdateOrderTaxResponse> response = apiInstance.OrdersUpdateTaxesWithHttpInfo(id, taxId, updateOrderTaxRequest, acceptLanguage, xChildCompanyId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling TaxesApi.OrdersUpdateTaxesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id string Identifier of the resource
taxId string identifier
updateOrderTaxRequest UpdateOrderTaxRequest requested field for taxes
acceptLanguage string Use for knowing which language to use [optional] [default to es]
xChildCompanyId string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

UpdateOrderTaxResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

HTTP response details

Status code Description Response headers
200 successful -
401 authentication error -
422 parameter validation error -
404 not found entity -
500 internal server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]