Skip to main content

Translator

Introduction

AmplifierApiClient .NET package provides ways to authenticate and communicate with Amplifier API. This includes access to B2B WS.

Nuget

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

        <ItemGroup>
              <PackageReference Include="AmperApiClient.NET" Version="1.x.x" />
          </ItemGroup> 
    

Example project

Import

  using Amplifier;

AmplifierJWTAuth

Constructors

NameDescription
Constructor(username, password, authUrl)Creates an AmplifierJWTAuth with specified credentials

Methods

Return TypeNameDescription
Task<string>GetTokenFetches your JSON Web Token required for communication with backend of Amplifier

Constructor(username, password, authUrl)

  using Amplifier;
  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

NameTypeDescription
your_ws_endpointStringYour dedicated AMPER WS endpoint
usernameString
passwordString

GetToken()

  using Amplifier;
  AmplifierJWTAuth amplifierJWTAuth = new AmplifierJWTAuth(USERNAME, PASSWORD, AUTH_URL);

  string token = await amplifierJWTAuth.getToken();

Returns

Personal JSON Web Token

B2BWSConfig

Properties

NameTypeDescription
B2BWSUrlstringtarget AMPER Web Service URL
ERPConnectionStringstring
JWTTokenstringJSON Web Token fetched by AmplifierJWTAuth

B2BWSBackend

Constructors

NameDescription
Constructor(b2BWSConfig)Creates an B2BWSBackend using config containing JWT and WS URL

Methods

Return TypeNameDescription
Task<string>ChangeOrderStatus(status, token)Asynchronously changes the status of an order
Task<string>GetListOfComplaintsAsynchronously fetches the list of complaints
Task<string>GetListOfOrders(status)Asynchronously fetches list of orders with a specified status
Task<string>GetOrder(token)Asynchronously fetches an order by it's token
TaskSendAccountsAsync(accounts)Asynchronously sends the list of accounts
TaskSendAddresses(addresses)Asynchronously Sends the list of addresses
TaskSendCategoryDiscountAsync(category_discounts)Asynchronously sends the list of category discounts
TaskSendCustomerProductLogisticMinimumAsync(relations)Asynchronously sends the list of logistic minimums for customers and products
TaskSendCustomerProductsRelationAsyncsAsync(relations)Asynchronously sends the list of customer product relations
Task*SendDocumentsAsync(documents)Asynchronously sends the list of documents
TaskSendFile(path, fileName, product_external_id, order)Asynchronously sends a file
TaskSendPriceLevelsAsync(priceLevels)Asynchronously sends the list of price levels
TaskSendPricesAsync(priceLevels)Asynchronously sends the list of prices
TaskSendProductCategoriesAsync(categories)Asynchronously sends the list of product categories
TaskSendProductCategoriesRelationAsyncsAsync(relations)Asynchronously sends the list of product category relations
TaskSendProductsAsync(products)Asynchronously sends the list of products
TaskSendRelatedProductsAsync(related_products)Asynchronously sends the list of related products
TaskSendSettlementsAsync(settlements)Asynchronously sends the list of settlements
TaskSendStockLocationsAsync(stockLocations)Asynchronously sends the list of location of the product stock
TaskSendStocksAsync(stocks)Asynchronously sends the list of product stock

Constructor(b2BWSConfig)

Parameters

NameTypeDescription
b2BWSConfigB2BWSConfig

ChangeOrderStatus(status, token)

NameTypeDescription
statusStringNew status
tokenStringOrder'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

NameTypeDescription
statusStringStatus of orders

Returns

Task object containing list of orders in JSON format as a string

GetOrder(token)

Parameters

NameTypeDescription
tokenStringOrder's token

Returns

Task object containing order in JSON format as a string

SendAccountsAsync(accounts)

Parameters

NameTypeDescription
accountsList<Account>List of accounts

Returns

Task object representing the result of the operation

SendAddresses(addresses)

Parameters

NameTypeDescription
addressesList<Address>List of addresses

Returns

Task object representing the result of the operation

SendCategoryDiscountAsync(category_discounts)

Parameters

NameTypeDescription
category_discountsList<CategoryDiscount>List of category discounts

Returns

Task object representing the result of the operation

SendCustomerProductLogisticMinimumAsync(relations)

Parameters

NameTypeDescription
relationsList<CustomerProductLogisticMinimum>List of logistic minimums for customers and products

Returns

Task object representing the result of the operation

SendCustomerProductsRelationAsyncsAsync(relations)

Parameters

NameTypeDescription
relationsList<CustomerProductRelation>List of customer product relations

Returns

Task object representing the result of the operation

SendDocumentsAsync(documents)

Parameters

NameTypeDescription
documentsList<Document>List of documents

Returns

Task object representing the result of the operation

SendFile(path, fileName, product_external_id, order)

Parameters

NameTypeDescription
pathStringPath to a file
fileNameStringName of a file after it's sent
product_external_idStringProduct's Id in client's database
orderString

Returns

Task object representing the result of the operation

SendPriceLevelsAsync(priceLevels)

Parameters

NameTypeDescription
priceLevelsList<PriceLevel>List of price levels

Returns

Task object representing the result of the operation

SendPricesAsync(priceLevels)

Parameters

NameTypeDescription
priceLevelsList<Price>List of prices

Returns

Task object representing the result of the operation

SendProductCategoriesAsync(categories)

Parameters

NameTypeDescription
categoriesList<ProductCategory>List of product categories

Returns Task object representing the result of the operation

SendProductCategoriesRelationAsyncsAsync(relations)

Parameters

NameTypeDescription
relationsList<ProductCategoryRelation>List of product category relations

Returns

Task object representing the result of the operation

SendProductsAsync(products)

Parameters

NameTypeDescription
productsList<Product>List of products

Returns

Task object representing the result of asynchrous operation

SendRelatedProductsAsync(related_products)

Parameters

NameTypeDescription
related_productsList<RelatedProducts>List of related products

Returns

Task object representing the result of the operation

SendSettlementsAsync(settlements)

Parameters

NameTypeDescription
settlementsList<Settlement>List of settlements

Returns

Task object representing the result of the operation

SendStockLocationsAsync(stockLocations)

Parameters

NameTypeDescription
stockLocationsList<StockLocation>List of location of the product stock

Returns

Task object representing the result of the operation

SendStocksAsync(stocks)

Parameters

NameTypeDescription
stocksList<Stock>List of product stock

Returns

Task object representing the result of the operation

Models

Account

Properties

NameTypeDescription
customersList<Customer>
external_idstringAccount's Id in client's database
namestring
short_namestring

Address

Properties

NameTypeDescription
citystring
customer_external_idstringCustomer's Id in client's database
emailstring
external_idstringAddres's Id in client's database
namestring
phonestring
postal_codestring
streetstring
street_continuationstring
voivodeshipstring

CategoryDiscount

Properties

NameTypeDescription
category_external_idstringCategory's Id in client's database
discountdecimal
end_datestring
external_idstringCategory discount's Id in client's database
orderint
price_level_external_idstringPrice level's Id in client's database
start_datestring

Complaint

Properties

NameTypeDescription
attachmentsList<object>
created_atDateTime
created_byDateTime
customer_external_idstringCustomer's Id in client's database
idint
linesList<ComplaintLine>
notestring
notesList<object>
nrstring
statusstring
updated_atint?
updated_byint?

ComplaintLine

Properties

NameTypeDescription
complaintid
descriptionstring
idid
namestring
orderstring
product_external_idstringProduct's Id in client's database
product_idint
purchase_datestring

Customer

Properties

NameTypeDescription
citystring
commentsstring
discountdecimal
doc_exportbool
external_idstringCustomer's Id in client's database
ftp_exportbool
loginstring
mail_exportbool
namestring
offer_exportbool
overdue_limitdecimal
passwordstring
phonestring
postal_codestring
price_level_external_idstringPrice level's Id in client's database
primary_emailstring
short_namestring
streetstring
tax_idstring
templatestring
trade_credit_limitdecimal

CustomerProductLogisticMinimum

Properties

NameTypeDescription
customer_external_idstringCustomer's Id in client's database
external_idstringId of logistic minimum for customer and product in client's database
logistic_minimumdecimal
product_external_idstringProduct's Id in client's database

CustomerProductRelation

Properties

NameTypeDescription
customer_external_idstringCustomer's Id in client's database
external_idstringCustomer product relation's Id in client's database
product_external_idstringProduct's Id in client's database

Document

Properties

NameTypeDescription
customerstring
datestring
descriptionstring
document_linesList<DocumentLine>
due_datestring
external_idstringDocument's Id in client's database
numberstring
value_grossdecimal
value_netdecimal

DocumentLine

Properties

NameTypeDescription
documentstring
groupstring
makestring
manufacturerstring
price_grossdecimal
price_netdecimal
productdecimal
product_eandecimal
product_namestring
product_symbolstring
quantitydecimal
quantity_aggregatedecimal
unitstring
unit_aggregatestring
value_grossdecimal
value_netdecimal
vatint

Order

Properties

NameTypeDescription
billing_addressstring
createdDateTime
customer_external_idstringCustomer's Id in client's database
customer_notestring
discount_amountobject
linesList<OrderLine>
paidobject
products_total_grossstring
products_total_netstring
shipmentint
shipment_typeint
shipping_addressint
shipping_price_grossstring
shipping_price_netstring
statusstring
tokenstring
total_grossdecimal
total_netdecimal
updatedDateTime
user_emailstring

OrderLine

Properties

NameTypeDescription
attributesList<object>
idint
productint
product_external_idstringProduct's Id in client's database
product_namestring
product_skustring
quantityint
tax_ratestring
unit_price_grossstring
unit_price_netstring

Price

Properties

NameTypeDescription
discountdecimal
end_datestring
external_idstringPrice's Id in client's database
orderint
pricedecimal
price_level_external_idstringPrice level's Id in client's database
product_external_idstringProduct's Id in client's database
start_datestring

PriceLevel

Properties

NameTypeDescription
external_idstringPrice level's Id in client's database
namestring
orderint

Product

Properties

NameTypeDescription
attributesList<ProductAttributes>
available_onstring
can_be_splitbool
cumulative_converterdecimal
cumulative_unit_of_measurestring
cumulative_unit_ratio_splitterdecimal
default_pricedecimal
default_unit_of_measurestring
descriptionstring
external_idstringProduct's Id in client's database
friendly_namestring
is_featuredbool
is_publishedbool
namestring
short_codestring
short_descriptionstring
skustring
unit_roundupbool
vatint
weightdecimal

ProductAttributes

Properties

NameTypeDescription
atr_namestring
atr_valstring
keystring

Constructors

NameDescription
Constructor(String, String, String)

Constructor(String, String, String)

ProductCategory

Properties

NameTypeDescription
descriptionstring
external_idstringProduct category's Id in client's database
namestring
orderint
parent_external_idstringCategory's parent category Id in client's database
seo_tagsstring

ProductCategoryRelation

Properties

NameTypeDescription
category_external_idstringCategory's Id in client's database
external_idstringProduct and category relation's Id in client's database
product_external_idstringProduct's Id in client's database

ProductImage

NameTypeDescription
altstring
product_idint
imagestring
orderint
thumbnail_widthint

RelatedProduct

Properties

NameTypeDescription
external_idstringRelated product's Id in client's database

RelatedProducts

Properties

NameTypeDescription
external_idstringProduct's Id in client's database
related_productsList<RelatedProduct>List of related products

Settlement

Properties

NameTypeDescription
customerstring
datestring
due_datestring
external_idstringSettlement's Id in client's database
numberstring
valuedecimal
value_to_paydecimal

Stock

Properties

NameTypeDescription
external_idstring
product_external_idstringProduct's Id in client's database
quantitydecimal
quantity_allocateddecimal
stock_level_external_idstringStock location's Id in client's database

StockLocation

Properties

NameTypeDescription
external_idstring
namestring