# Translator
# Introduction
**AmplifierApiClient** .NET package provides ways to authenticate and communicate with Amplifier API. This includes access to B2B WS.
[Nuget](https://www.nuget.org/packages/AmperApiClient.NET/)
You can add this package to your .NET project by using:
* **Package Manager Console in Visual Studio**
```Install-Package AmperApiClient.NET```
* **.NET CLI**
```dotnet add package AmperApiClient.NET```
* **add reference directly to your .csproj file**
``` xml
```
[Example project](https://bitbucket.org/amplifierspzoo/amper-translator-example)
Import
```
using Amplifier;
```
# AmplifierJWTAuth
### Constructors
Name | Description
---- | -----------
| **Constructor(username, password, authUrl)** | Creates an **AmplifierJWTAuth** with specified credentials
### Methods
Return Type | Name | Description
----------- | ---- | -----------
| *Task\* | **GetToken** | Fetches your JSON Web Token required for communication with backend of Amplifier
### Constructor(username, password, authUrl)
```cs
using Amplifier;
```
```csharp
string AUTH_URL = "your_ws_endpoint";
string USERNAME = "your_user_name";
string PASSWORD = "your_password";
AmplifierJWTAuth amplifierJWTAuth = new AmplifierJWTAuth(USERNAME, PASSWORD, AUTH_URL);
```
> replace `"your_ws_endpoint"`, `"your_user_name"` and `"your_password"` with your credentials
Name | Type | Description |
---- | ---- | ----------- |
| **your_ws_endpoint** | *String* | Your dedicated AMPER WS endpoint |
| **username** | *String* | |
| **password** | *String* | |
### GetToken()
```cs
using Amplifier;
```
```csharp
AmplifierJWTAuth amplifierJWTAuth = new AmplifierJWTAuth(USERNAME, PASSWORD, AUTH_URL);
string token = await amplifierJWTAuth.getToken();
```
**Returns**
Personal JSON Web Token
# B2BWSConfig
### Properties
Name | Type | Description
---- | ---- | -----------
| **B2BWSUrl** | *string* | target AMPER Web Service URL
| **ERPConnectionString** | *string* |
| **JWTToken** | *string* | JSON Web Token fetched by AmplifierJWTAuth
# B2BWSBackend
### Constructors
Name | Description
---- | -----------
| **Constructor(b2BWSConfig)** | Creates an B2BWSBackend using config containing JWT and WS URL
### Methods
Return Type | Name | Description
----------- | ---- | -----------
| *Task\* | **ChangeOrderStatus(status, token)** | Asynchronously changes the status of an order
| *Task\* | **GetListOfComplaints** | Asynchronously fetches the list of complaints
| *Task\* | **GetListOfOrders(status)** | Asynchronously fetches list of orders with a specified status
| *Task\* | **GetOrder(token)** | Asynchronously fetches an order by it's token
| *Task* | **SendAccountsAsync(accounts)** | Asynchronously sends the list of accounts
| *Task* | **SendAddresses(addresses)** | Asynchronously Sends the list of addresses
| *Task* | **SendCategoryDiscountAsync(category_discounts)** | Asynchronously sends the list of category discounts
| *Task* | **SendCustomerProductLogisticMinimumAsync(relations)** | Asynchronously sends the list of logistic minimums for customers and products
| *Task* | **SendCustomerProductsRelationAsyncsAsync(relations)** | Asynchronously sends the list of customer product relations
| Task* | **SendDocumentsAsync(documents)** | Asynchronously sends the list of documents
| *Task* | **SendFile(path, fileName, product_external_id, order)** | Asynchronously sends a file
| *Task* | **SendPriceLevelsAsync(priceLevels)** | Asynchronously sends the list of price levels
| *Task* | **SendPricesAsync(priceLevels)** | Asynchronously sends the list of prices
| *Task* | **SendProductCategoriesAsync(categories)** | Asynchronously sends the list of product categories
| *Task* | **SendProductCategoriesRelationAsyncsAsync(relations)** | Asynchronously sends the list of product category relations
| *Task* | **SendProductsAsync(products)** | Asynchronously sends the list of products
| *Task* | **SendRelatedProductsAsync(related_products)** | Asynchronously sends the list of related products
| *Task* | **SendSettlementsAsync(settlements)** | Asynchronously sends the list of settlements
| *Task* | **SendStockLocationsAsync(stockLocations)** | Asynchronously sends the list of location of the product stock
| *Task* | **SendStocksAsync(stocks)** | Asynchronously sends the list of product stock
### Constructor(b2BWSConfig)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **b2BWSConfig** | *B2BWSConfig* | |
### ChangeOrderStatus(status, token)
Name | Type | Description |
---- | ---- | ----------- |
| **status** | *String* | New status |
| **token** | *String* | Order's token |
**Returns**
Task object containing result of the operation
### GetListOfComplaints()
**Returns**
Task object containing list of complaints in JSON format as a string
### GetListOfOrders(status)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **status** | *String* | Status of orders |
**Returns**
Task object containing list of orders in JSON format as a string
### GetOrder(token)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **token** | *String* | Order's token |
**Returns**
Task object containing order in JSON format as a string
### SendAccountsAsync(accounts)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **accounts** | *List\<Account>* | List of accounts |
**Returns**
Task object representing the result of the operation
### SendAddresses(addresses)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **addresses** | *List\<Address>* | List of addresses |
**Returns**
Task object representing the result of the operation
### SendCategoryDiscountAsync(category_discounts)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **category_discounts** | *List\<CategoryDiscount>* | List of category discounts |
**Returns**
Task object representing the result of the operation
### SendCustomerProductLogisticMinimumAsync(relations)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **relations** | *List\<CustomerProductLogisticMinimum>* | List of logistic minimums for customers and products |
**Returns**
Task object representing the result of the operation
### SendCustomerProductsRelationAsyncsAsync(relations)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **relations** | *List\<CustomerProductRelation>* | List of customer product relations |
**Returns**
Task object representing the result of the operation
### SendDocumentsAsync(documents)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **documents** | *List\<Document>* | List of documents |
**Returns**
Task object representing the result of the operation
### SendFile(path, fileName, product_external_id, order)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **path** | *String* | Path to a file |
| **fileName** | *String* | Name of a file after it's sent |
| **product_external_id** | *String* | Product's Id in client's database |
| **order** | *String* | |
**Returns**
Task object representing the result of the operation
### SendPriceLevelsAsync(priceLevels)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **priceLevels** | *List\<PriceLevel>* | List of price levels |
**Returns**
Task object representing the result of the operation
### SendPricesAsync(priceLevels)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **priceLevels** | *List\<Price>* | List of prices |
**Returns**
Task object representing the result of the operation
### SendProductCategoriesAsync(categories)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **categories** | *List\<ProductCategory>* | List of product categories |
**Returns**
Task object representing the result of the operation
### SendProductCategoriesRelationAsyncsAsync(relations)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **relations** | *List\<ProductCategoryRelation>* | List of product category relations |
**Returns**
Task object representing the result of the operation
### SendProductsAsync(products)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **products** | *List\<Product>* | List of products |
**Returns**
Task object representing the result of asynchrous operation
### SendRelatedProductsAsync(related_products)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **related_products** | *List\<RelatedProducts>* | List of related products |
**Returns**
Task object representing the result of the operation
### SendSettlementsAsync(settlements)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **settlements** | *List\<Settlement>* | List of settlements |
**Returns**
Task object representing the result of the operation
### SendStockLocationsAsync(stockLocations)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **stockLocations** | *List\<StockLocation>* | List of location of the product stock |
**Returns**
Task object representing the result of the operation
### SendStocksAsync(stocks)
**Parameters**
Name | Type | Description |
---- | ---- | ----------- |
| **stocks** | *List\<Stock>* | List of product stock |
**Returns**
Task object representing the result of the operation
# Models
## Account
### Properties
Name | Type | Description
---- | ---- | -----------
| **customers** | *List<Customer>* |
| **external_id** | *string* | Account's Id in client's database
| **name** | *string* |
| **short_name** | *string* |
## Address
### Properties
Name | Type | Description
---- | ---- | -----------
| **city** | *string* |
| **customer_external_id** | *string* | Customer's Id in client's database
| **email** | *string* |
| **external_id** | *string* | Addres's Id in client's database
| **name** | *string* |
| **phone** | *string* |
| **postal_code** | *string* |
| **street** | *string* |
| **street_continuation** | *string* |
| **voivodeship** | *string* |
## CategoryDiscount
### Properties
Name | Type | Description
---- | ---- | -----------
| **category_external_id** | *string* | Category's Id in client's database
| **discount** | *decimal* |
| **end_date** | *string* |
| **external_id** | *string* | Category discount's Id in client's database
| **order** | *int* |
| **price_level_external_id** | *string* | Price level's Id in client's database
| **start_date** | *string* |
## Complaint
### Properties
Name | Type | Description
---- | ---- | -----------
| **attachments** | *List\