Skip to content

Latest commit

 

History

History
511 lines (408 loc) · 17 KB

SuppliersApi.md

File metadata and controls

511 lines (408 loc) · 17 KB

It.FattureInCloud.Sdk.Api.SuppliersApi

All URIs are relative to https://api-v2.fattureincloud.it

Method HTTP request Description
CreateSupplier POST /c/{company_id}/entities/suppliers Create Supplier
DeleteSupplier DELETE /c/{company_id}/entities/suppliers/{supplier_id} Delete Supplier
GetSupplier GET /c/{company_id}/entities/suppliers/{supplier_id} Get Supplier
ListSuppliers GET /c/{company_id}/entities/suppliers List Suppliers
ModifySupplier PUT /c/{company_id}/entities/suppliers/{supplier_id} Modify Supplier

CreateSupplier

CreateSupplierResponse CreateSupplier (int companyId, CreateSupplierRequest createSupplierRequest = null)

Create Supplier

Creates a new supplier.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class CreateSupplierExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SuppliersApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var createSupplierRequest = new CreateSupplierRequest(); // CreateSupplierRequest | The supplier to create (optional) 

            try
            {
                // Create Supplier
                CreateSupplierResponse result = apiInstance.CreateSupplier(companyId, createSupplierRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SuppliersApi.CreateSupplier: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateSupplierWithHttpInfo variant

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

try
{
    // Create Supplier
    ApiResponse<CreateSupplierResponse> response = apiInstance.CreateSupplierWithHttpInfo(companyId, createSupplierRequest);
    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 SuppliersApi.CreateSupplierWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
createSupplierRequest CreateSupplierRequest The supplier to create [optional]

Return type

CreateSupplierResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Example response -

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

DeleteSupplier

void DeleteSupplier (int companyId, int supplierId)

Delete Supplier

Deletes the specified supplier.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class DeleteSupplierExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SuppliersApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var supplierId = 56;  // int | The ID of the supplier.

            try
            {
                // Delete Supplier
                apiInstance.DeleteSupplier(companyId, supplierId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SuppliersApi.DeleteSupplier: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteSupplierWithHttpInfo variant

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

try
{
    // Delete Supplier
    apiInstance.DeleteSupplierWithHttpInfo(companyId, supplierId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling SuppliersApi.DeleteSupplierWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
supplierId int The ID of the supplier.

Return type

void (empty response body)

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Entity Removed -
401 Unauthorized -
404 Not Found -

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

GetSupplier

GetSupplierResponse GetSupplier (int companyId, int supplierId, string fields = null, string fieldset = null)

Get Supplier

Gets the specified supplier.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class GetSupplierExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SuppliersApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var supplierId = 56;  // int | The ID of the supplier.
            var fields = "fields_example";  // string | List of comma-separated fields. (optional) 
            var fieldset = "basic";  // string | Name of the fieldset. (optional) 

            try
            {
                // Get Supplier
                GetSupplierResponse result = apiInstance.GetSupplier(companyId, supplierId, fields, fieldset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SuppliersApi.GetSupplier: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetSupplierWithHttpInfo variant

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

try
{
    // Get Supplier
    ApiResponse<GetSupplierResponse> response = apiInstance.GetSupplierWithHttpInfo(companyId, supplierId, fields, fieldset);
    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 SuppliersApi.GetSupplierWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
supplierId int The ID of the supplier.
fields string List of comma-separated fields. [optional]
fieldset string Name of the fieldset. [optional]

Return type

GetSupplierResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Example response -
401 Unauthorized -
404 Not Found -

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

ListSuppliers

ListSuppliersResponse ListSuppliers (int companyId, string fields = null, string fieldset = null, string sort = null, int? page = null, int? perPage = null, string q = null)

List Suppliers

Lists the suppliers.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class ListSuppliersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SuppliersApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var fields = "fields_example";  // string | List of comma-separated fields. (optional) 
            var fieldset = "basic";  // string | Name of the fieldset. (optional) 
            var sort = "sort_example";  // string | List of comma-separated fields for result sorting (minus for desc sorting). (optional) 
            var page = 1;  // int? | The page to retrieve. (optional)  (default to 1)
            var perPage = 5;  // int? | The size of the page. (optional)  (default to 5)
            var q = "q_example";  // string | Query for filtering the results. (optional) 

            try
            {
                // List Suppliers
                ListSuppliersResponse result = apiInstance.ListSuppliers(companyId, fields, fieldset, sort, page, perPage, q);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SuppliersApi.ListSuppliers: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListSuppliersWithHttpInfo variant

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

try
{
    // List Suppliers
    ApiResponse<ListSuppliersResponse> response = apiInstance.ListSuppliersWithHttpInfo(companyId, fields, fieldset, sort, page, perPage, q);
    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 SuppliersApi.ListSuppliersWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
fields string List of comma-separated fields. [optional]
fieldset string Name of the fieldset. [optional]
sort string List of comma-separated fields for result sorting (minus for desc sorting). [optional]
page int? The page to retrieve. [optional] [default to 1]
perPage int? The size of the page. [optional] [default to 5]
q string Query for filtering the results. [optional]

Return type

ListSuppliersResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Example response -
401 Unauthorized -

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

ModifySupplier

ModifySupplierResponse ModifySupplier (int companyId, int supplierId, ModifySupplierRequest modifySupplierRequest = null)

Modify Supplier

Modifies the specified supplier.

Example

using System.Collections.Generic;
using System.Diagnostics;
using It.FattureInCloud.Sdk.Api;
using It.FattureInCloud.Sdk.Client;
using It.FattureInCloud.Sdk.Model;

namespace Example
{
    public class ModifySupplierExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api-v2.fattureincloud.it";
            // Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SuppliersApi(config);
            var companyId = 12345;  // int | The ID of the company.
            var supplierId = 56;  // int | The ID of the supplier.
            var modifySupplierRequest = new ModifySupplierRequest(); // ModifySupplierRequest | The modified Supplier. First level parameters are managed in delta mode. (optional) 

            try
            {
                // Modify Supplier
                ModifySupplierResponse result = apiInstance.ModifySupplier(companyId, supplierId, modifySupplierRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SuppliersApi.ModifySupplier: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ModifySupplierWithHttpInfo variant

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

try
{
    // Modify Supplier
    ApiResponse<ModifySupplierResponse> response = apiInstance.ModifySupplierWithHttpInfo(companyId, supplierId, modifySupplierRequest);
    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 SuppliersApi.ModifySupplierWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
companyId int The ID of the company.
supplierId int The ID of the supplier.
modifySupplierRequest ModifySupplierRequest The modified Supplier. First level parameters are managed in delta mode. [optional]

Return type

ModifySupplierResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Example response -
401 Unauthorized -
404 Not Found -

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